sandoz.bbmb.ch 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.travis.yml +26 -0
- data/Gemfile +12 -0
- data/History.txt +6 -0
- data/LICENSE +339 -0
- data/Rakefile +21 -0
- data/doc/index.rbx +14 -0
- data/doc/resources/activex/BbmbBarcodeReader.CAB +0 -0
- data/doc/resources/activex/BbmbBarcodeReader2.CAB +0 -0
- data/doc/resources/bbmb.css +301 -0
- data/doc/resources/errors/appdown.html +14 -0
- data/doc/resources/javascript/bcreader.js +131 -0
- data/doc/resources/javascript/order.js +65 -0
- data/doc/resources/javascript/widget/ContentToggler.js +60 -0
- data/doc/resources/javascript/widget/__package__.js +2 -0
- data/doc/resources/javascript/widget/templates/ContentToggler.html +4 -0
- data/doc/resources/logo.png +0 -0
- data/lib/bbmb/html/util/lookandfeel.rb +202 -0
- data/lib/bbmb/sandoz.rb +4 -0
- data/lib/bbmb/sandoz/html/state/viral/customer.rb +25 -0
- data/lib/bbmb/sandoz/version.rb +5 -0
- data/lib/bbmb/util/csv_importer.rb +123 -0
- data/readme.md +28 -0
- data/sandoz.bbmb.ch.gemspec +45 -0
- data/test/rcov +2 -0
- data/test/selenium.rb +1687 -0
- data/test/selenium/selenium-server.jar +0 -0
- data/test/selenium/test_current_order.rb +336 -0
- data/test/selenium/test_customer.rb +363 -0
- data/test/selenium/test_customers.rb +92 -0
- data/test/selenium/test_favorites.rb +257 -0
- data/test/selenium/test_favorites_result.rb +81 -0
- data/test/selenium/test_history.rb +112 -0
- data/test/selenium/test_login.rb +112 -0
- data/test/selenium/test_orders.rb +111 -0
- data/test/selenium/test_result.rb +157 -0
- data/test/selenium/unit.rb +146 -0
- data/test/stub/http_server.rb +140 -0
- data/test/stub/persistence.rb +58 -0
- data/test/suite.rb +15 -0
- data/test/util/data/Artikel.TXT +50 -0
- data/test/util/data/Kunden.TXT +14 -0
- data/test/util/test_csv_importer.rb +136 -0
- metadata +414 -0
@@ -0,0 +1,301 @@
|
|
1
|
+
body
|
2
|
+
{
|
3
|
+
font-family: Verdana, Arial, Helvetica, sans-serif;
|
4
|
+
font-size: 12px;
|
5
|
+
background-color: #FFFFFF;
|
6
|
+
}
|
7
|
+
a, a:visited {
|
8
|
+
color: blue;
|
9
|
+
text-decoration: none;
|
10
|
+
}
|
11
|
+
a:hover {
|
12
|
+
color: #026;
|
13
|
+
}
|
14
|
+
a.block {
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
a.promotion {
|
18
|
+
background-color: #FF6;
|
19
|
+
}
|
20
|
+
a.promotion, a.sale {
|
21
|
+
border: 1px solid #333;
|
22
|
+
color: #333;
|
23
|
+
padding: 1px 4px;
|
24
|
+
font-weight: bold;
|
25
|
+
font-size: 12px;
|
26
|
+
}
|
27
|
+
a.sale {
|
28
|
+
background-color: #6F6;
|
29
|
+
}
|
30
|
+
td.description, a.commit-time {
|
31
|
+
font-size: 14px;
|
32
|
+
font-weight: bold;
|
33
|
+
}
|
34
|
+
div.address {
|
35
|
+
padding: 4px;
|
36
|
+
}
|
37
|
+
div#admin-address {
|
38
|
+
position: relative;
|
39
|
+
left: 60%;
|
40
|
+
}
|
41
|
+
div#catalogue td {
|
42
|
+
vertical-align: top;
|
43
|
+
font-weight: bold;
|
44
|
+
}
|
45
|
+
div#catalogue td td {
|
46
|
+
font-weight: normal;
|
47
|
+
}
|
48
|
+
div#catalogue td.catalogue {
|
49
|
+
padding: 0px;
|
50
|
+
vertical-align: top;
|
51
|
+
}
|
52
|
+
div#divider {
|
53
|
+
background-color: #026;
|
54
|
+
height: 20px;
|
55
|
+
}
|
56
|
+
div.dojoTooltip {
|
57
|
+
font-size: 12px;
|
58
|
+
}
|
59
|
+
div#head img {
|
60
|
+
margin-bottom: 43px;
|
61
|
+
border: 0;
|
62
|
+
}
|
63
|
+
div.info {
|
64
|
+
padding: 12px 4px;
|
65
|
+
font-size: 14px;
|
66
|
+
font-weight: bold;
|
67
|
+
background-color: #EAEDEF;
|
68
|
+
}
|
69
|
+
div#info td {
|
70
|
+
vertical-align: top;
|
71
|
+
}
|
72
|
+
div.limited {
|
73
|
+
max-width: 90px;
|
74
|
+
}
|
75
|
+
div#language-chooser {
|
76
|
+
float: right;
|
77
|
+
}
|
78
|
+
div#language-chooser a {
|
79
|
+
padding: 0px 4px;
|
80
|
+
border-left: 1px solid black;
|
81
|
+
}
|
82
|
+
div#language-chooser a:first-child {
|
83
|
+
border-left: 0px;
|
84
|
+
}
|
85
|
+
div#language-chooser a {
|
86
|
+
color: black;
|
87
|
+
}
|
88
|
+
div#language-chooser a:link, div#language-chooser a:visited {
|
89
|
+
color: blue;
|
90
|
+
}
|
91
|
+
div#language-chooser a:hover {
|
92
|
+
color: black;
|
93
|
+
}
|
94
|
+
div.login-foot {
|
95
|
+
font-weight: bold;
|
96
|
+
cursor: pointer;
|
97
|
+
color: blue;
|
98
|
+
}
|
99
|
+
div#welcome {
|
100
|
+
font-weight: bold;
|
101
|
+
padding: 4px;
|
102
|
+
}
|
103
|
+
div#logged-in-as {
|
104
|
+
float: right;
|
105
|
+
font-weight: bold;
|
106
|
+
padding: 4px;
|
107
|
+
}
|
108
|
+
div#filter, div#search {
|
109
|
+
float: right;
|
110
|
+
}
|
111
|
+
div#foot, div#title {
|
112
|
+
color: white;
|
113
|
+
background-color: #026;
|
114
|
+
padding: 4px;
|
115
|
+
}
|
116
|
+
div#foot a {
|
117
|
+
color: white;
|
118
|
+
background-color: #026;
|
119
|
+
}
|
120
|
+
div#navigation {
|
121
|
+
float: right;
|
122
|
+
}
|
123
|
+
div#navigation a {
|
124
|
+
padding: 0px 4px;
|
125
|
+
border-left: 1px solid white;
|
126
|
+
}
|
127
|
+
div#navigation a:first-child {
|
128
|
+
border-left: 0px;
|
129
|
+
}
|
130
|
+
div#navigation a {
|
131
|
+
color: red;
|
132
|
+
}
|
133
|
+
div#navigation a:link, div#navigation a:visited {
|
134
|
+
color: white;
|
135
|
+
}
|
136
|
+
div#navigation a:hover {
|
137
|
+
color: red;
|
138
|
+
}
|
139
|
+
div.new-customer {
|
140
|
+
cursor: pointer;
|
141
|
+
color: blue;
|
142
|
+
}
|
143
|
+
div#order-total, td.order-total {
|
144
|
+
font-weight: bold;
|
145
|
+
padding: 8px 4px 8px 8px;
|
146
|
+
background-color: #EAEDEF;
|
147
|
+
border-top: 1px solid #BBB;
|
148
|
+
}
|
149
|
+
div#order-total label {
|
150
|
+
margin-right: 4px;
|
151
|
+
}
|
152
|
+
div#pager {
|
153
|
+
padding: 4px;
|
154
|
+
}
|
155
|
+
div.tab {
|
156
|
+
background-color: #AAF;
|
157
|
+
padding: 4px;
|
158
|
+
border-bottom: 2px solid #026;
|
159
|
+
}
|
160
|
+
div.tab a {
|
161
|
+
padding: 2px 4px 2px 4px;
|
162
|
+
margin: 2px;
|
163
|
+
position: relative;
|
164
|
+
top: 2px;
|
165
|
+
background-color: #026;
|
166
|
+
color: white;
|
167
|
+
border-top: 1px solid #026;
|
168
|
+
border-left: 1px solid #026;
|
169
|
+
border-right: 1px solid #026;
|
170
|
+
}
|
171
|
+
div.tab a:link, div.tab a:visited {
|
172
|
+
background-color: #AAF;
|
173
|
+
color: #026;
|
174
|
+
}
|
175
|
+
div#terms-of-service td, div#order-confirmation td {
|
176
|
+
vertical-align: top;
|
177
|
+
}
|
178
|
+
div#title {
|
179
|
+
font-weight: bold;
|
180
|
+
}
|
181
|
+
div.toggler {
|
182
|
+
cursor: default;
|
183
|
+
border: 1px solid #BBB;
|
184
|
+
padding: 2px;
|
185
|
+
background-color: #CCC;
|
186
|
+
}
|
187
|
+
div#toolbar {
|
188
|
+
min-height: 20px;
|
189
|
+
white-space: nowrap;
|
190
|
+
}
|
191
|
+
div#toolbar div {
|
192
|
+
display: inline;
|
193
|
+
}
|
194
|
+
form {
|
195
|
+
margin: 0px;
|
196
|
+
}
|
197
|
+
form#clear, form#transfer-dat, form#bcread {
|
198
|
+
display: inline;
|
199
|
+
}
|
200
|
+
form#login {
|
201
|
+
border-top: 20px solid #026;
|
202
|
+
}
|
203
|
+
input[type=text], input[type=password] {
|
204
|
+
width: 200px;
|
205
|
+
}
|
206
|
+
input#city {
|
207
|
+
width: 148px;
|
208
|
+
}
|
209
|
+
input#plz, input.tiny, td.tiny, td.tiny input {
|
210
|
+
width: 49px;
|
211
|
+
}
|
212
|
+
label {
|
213
|
+
font-weight: bold;
|
214
|
+
}
|
215
|
+
label.error {
|
216
|
+
color: red;
|
217
|
+
}
|
218
|
+
span.guide {
|
219
|
+
padding: 4px;
|
220
|
+
}
|
221
|
+
table#favorites {
|
222
|
+
background-color:#CEF;
|
223
|
+
}
|
224
|
+
table.list {
|
225
|
+
width: 100%
|
226
|
+
}
|
227
|
+
table#new-customer-form {
|
228
|
+
margin: 4px;
|
229
|
+
background-color: #CDF;
|
230
|
+
border: 1px solid #ABF;
|
231
|
+
width: auto;
|
232
|
+
}
|
233
|
+
td, th, div.processingerror {
|
234
|
+
padding: 4px
|
235
|
+
}
|
236
|
+
td.big {
|
237
|
+
font-weight:bold;
|
238
|
+
font-size:14px;
|
239
|
+
}
|
240
|
+
td.additional-info {
|
241
|
+
padding-left: 8px;
|
242
|
+
}
|
243
|
+
td.contact {
|
244
|
+
font-weight: bold;
|
245
|
+
background-color: #EAEDEF;
|
246
|
+
}
|
247
|
+
td.delete {
|
248
|
+
width: 60px;
|
249
|
+
font-size: 11px;
|
250
|
+
}
|
251
|
+
td.login-foot {
|
252
|
+
padding-top: 30px;
|
253
|
+
vertical-align: top;
|
254
|
+
}
|
255
|
+
td.new-customer a {
|
256
|
+
color: #026;
|
257
|
+
background-color: #FFFFFF;
|
258
|
+
}
|
259
|
+
td.new-customer a:hover {
|
260
|
+
text-decoration: underline;
|
261
|
+
}
|
262
|
+
td.processingerror, div.processingerror {
|
263
|
+
color: red;
|
264
|
+
font-weight: bold;
|
265
|
+
}
|
266
|
+
td.right, th.right, td.total, div.right {
|
267
|
+
text-align: right;
|
268
|
+
}
|
269
|
+
td.stable {
|
270
|
+
white-space: nowrap;
|
271
|
+
}
|
272
|
+
td.total {
|
273
|
+
font-weight: bold;
|
274
|
+
}
|
275
|
+
td.top {
|
276
|
+
vertical-align: top;
|
277
|
+
}
|
278
|
+
textarea {
|
279
|
+
font-size:12px;
|
280
|
+
font-family: Verdana, Arial, Helvetica, sans-serif;
|
281
|
+
width: 200px;
|
282
|
+
height: 80px;
|
283
|
+
}
|
284
|
+
th, th a, th a:visited {
|
285
|
+
text-align: left;
|
286
|
+
color: white;
|
287
|
+
background-color: #026;
|
288
|
+
}
|
289
|
+
th a:hover {
|
290
|
+
color: red;
|
291
|
+
}
|
292
|
+
tr.bg {
|
293
|
+
background-color: #EAEDEF;
|
294
|
+
}
|
295
|
+
tr#controls {
|
296
|
+
background-color: #FFF;
|
297
|
+
}
|
298
|
+
tr.divider {
|
299
|
+
background-color: #CCC;
|
300
|
+
border: 1px solid #BBB;
|
301
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>www.oddb.org - We are sorry</title>
|
4
|
+
<link href="/resources/bbmb.css" rel="stylesheet" type="text/css">
|
5
|
+
<meta HTTP-EQUIV=Refresh CONTENT="60; URL=/">
|
6
|
+
</head>
|
7
|
+
<body class="appdown">
|
8
|
+
<img src="/resources/logo.png"><br><br>
|
9
|
+
<h1>Es tut uns leid</h1>
|
10
|
+
<p>Wegen eines Software-Updates ist sandoz.bbmb.ch in den nächsten Minuten nicht erreichbar.<br>
|
11
|
+
Wir bitten Sie um Ihr Verständnis.<br>
|
12
|
+
</p>
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,131 @@
|
|
1
|
+
function bc_read(bc_comport, bc_noconnection, bc_nocode)
|
2
|
+
{
|
3
|
+
var data = new Object();
|
4
|
+
var BCReader = dojo.byId('BCReader');
|
5
|
+
data['fail'] = bc_noconnection;
|
6
|
+
data['nocd'] = bc_nocode;
|
7
|
+
|
8
|
+
dojo.debug(data);
|
9
|
+
|
10
|
+
if(!BCReader)
|
11
|
+
{
|
12
|
+
alert(data['fail']);
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
if(bc_comport.value < 0)
|
16
|
+
{
|
17
|
+
return bc_select_and_try(bc_comport, data);
|
18
|
+
}
|
19
|
+
else
|
20
|
+
{
|
21
|
+
return bc_try_or_select(bc_comport, data);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
function bc_select_and_try(bc_comport, data)
|
26
|
+
{
|
27
|
+
var port_selected;
|
28
|
+
port_selected = BCReader.SelectCom();
|
29
|
+
if(port_selected < 0)
|
30
|
+
return false;
|
31
|
+
else
|
32
|
+
bc_comport.value = port_selected;
|
33
|
+
if(bc_try(bc_comport, data))
|
34
|
+
{
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
else
|
38
|
+
{
|
39
|
+
alert(data['fail'])
|
40
|
+
return false;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
function bc_try_or_select(bc_comport, data)
|
45
|
+
{
|
46
|
+
return bc_try(bc_comport, data) || bc_select_and_try(bc_comport, data);
|
47
|
+
}
|
48
|
+
|
49
|
+
function bc_try(bc_comport, data)
|
50
|
+
{
|
51
|
+
var numCodes = -1;
|
52
|
+
BCReader.SetCom(bc_comport.value)
|
53
|
+
if(!BCReader.Init())
|
54
|
+
{
|
55
|
+
bc_comport.value = -1;
|
56
|
+
return false;
|
57
|
+
}
|
58
|
+
else
|
59
|
+
{
|
60
|
+
numCodes = BCReader.Read();
|
61
|
+
}
|
62
|
+
if(numCodes < 0)
|
63
|
+
{
|
64
|
+
BCReader.Exit();
|
65
|
+
bc_comport.value = -1;
|
66
|
+
return false;
|
67
|
+
}
|
68
|
+
else if(numCodes == 0)
|
69
|
+
{
|
70
|
+
BCReader.Exit();
|
71
|
+
alert(data['nocd']);
|
72
|
+
return true;
|
73
|
+
}
|
74
|
+
else
|
75
|
+
{
|
76
|
+
var BarCodes = new Object();
|
77
|
+
BarCodes["comport"] = bc_comport.value;
|
78
|
+
|
79
|
+
while(success = BCReader.Next())
|
80
|
+
{
|
81
|
+
fname = BCReader.GetCodeType()+"["+BCReader.GetBarCode()+"]";;
|
82
|
+
if(BarCodes[fname] == null)
|
83
|
+
{
|
84
|
+
BarCodes[fname]=1;
|
85
|
+
}
|
86
|
+
else
|
87
|
+
{
|
88
|
+
BarCodes[fname]++;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
BCReader.Exit();
|
92
|
+
bc_send(BarCodes);
|
93
|
+
}
|
94
|
+
return true;
|
95
|
+
}
|
96
|
+
|
97
|
+
// this function is testable even if there is no Barcode-Reader
|
98
|
+
function bc_send(BarCodes)
|
99
|
+
{
|
100
|
+
BarCodes["event"] = 'scan';
|
101
|
+
var form = document.createElement( "form" );
|
102
|
+
form.method = 'POST';
|
103
|
+
form.action = '/index.rbx';
|
104
|
+
for(fname in BarCodes)
|
105
|
+
{
|
106
|
+
var input = document.createElement( "input" );
|
107
|
+
input.name = fname;
|
108
|
+
input.value = BarCodes[fname];
|
109
|
+
form.appendChild(input);
|
110
|
+
}
|
111
|
+
|
112
|
+
dojo.io.bind({
|
113
|
+
formNode: form,
|
114
|
+
load: function(type, data, evt) {
|
115
|
+
if(data['success']) {
|
116
|
+
bc_clear();
|
117
|
+
}
|
118
|
+
document.location.reload();
|
119
|
+
},
|
120
|
+
mimetype: "text/json"
|
121
|
+
});
|
122
|
+
}
|
123
|
+
|
124
|
+
function bc_clear()
|
125
|
+
{
|
126
|
+
if(BCReader.Init())
|
127
|
+
{
|
128
|
+
BCReader.Clear();
|
129
|
+
BCReader.Exit();
|
130
|
+
}
|
131
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
function delete_position(url, evt, id)
|
2
|
+
{
|
3
|
+
var form = document.createElement( "form" );
|
4
|
+
form.action = url;
|
5
|
+
form.style.display = 'none';
|
6
|
+
form.method = 'POST'
|
7
|
+
var data = {
|
8
|
+
"event": evt
|
9
|
+
};
|
10
|
+
data["quantity[" + id + "]"] = "0";
|
11
|
+
for(var key in data) {
|
12
|
+
var input = document.createElement( "input" );
|
13
|
+
input.type = "hidden";
|
14
|
+
input.name = key;
|
15
|
+
input.value = data[key];
|
16
|
+
form.appendChild(input);
|
17
|
+
}
|
18
|
+
document.body.appendChild(form);
|
19
|
+
form.submit();
|
20
|
+
}
|
21
|
+
|
22
|
+
function update_order_callback(data)
|
23
|
+
{
|
24
|
+
var name, input, value;
|
25
|
+
for(name in data)
|
26
|
+
{
|
27
|
+
if(input = dojo.byId(name))
|
28
|
+
{
|
29
|
+
value = data[name];
|
30
|
+
if(input.tagName == 'SPAN')
|
31
|
+
{
|
32
|
+
input.innerHTML = value;
|
33
|
+
}
|
34
|
+
else
|
35
|
+
{
|
36
|
+
input.value = value;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
function update_order(url, form)
|
43
|
+
{
|
44
|
+
var event = form.event.value;
|
45
|
+
form.event.value = 'ajax';
|
46
|
+
dojo.io.bind({
|
47
|
+
encoding: "utf-8",
|
48
|
+
url: url,
|
49
|
+
formNode: form,
|
50
|
+
load: function(type, data) { update_order_callback(data); },
|
51
|
+
mimetype: "text/json"
|
52
|
+
});
|
53
|
+
form.event.value = event;
|
54
|
+
}
|
55
|
+
|
56
|
+
function zeroise(form)
|
57
|
+
{
|
58
|
+
for(name in form.elements) {
|
59
|
+
var node = form[name];
|
60
|
+
if(node && typeof(node) == 'object' && node.tagName == 'INPUT' && node.type == 'text') {
|
61
|
+
node.value = '0';
|
62
|
+
}
|
63
|
+
|
64
|
+
}
|
65
|
+
}
|