Revision 8fd85060
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
bin/mozilla/pe.pl | ||
---|---|---|
35 | 35 |
|
36 | 36 |
require "bin/mozilla/common.pl"; |
37 | 37 |
|
38 |
use strict; |
|
39 |
|
|
38 | 40 |
1; |
39 | 41 |
|
40 | 42 |
# end of main |
41 | 43 |
|
42 | 44 |
sub add { |
43 |
$lxdebug->enter_sub(); |
|
45 |
$main::lxdebug->enter_sub(); |
|
46 |
|
|
47 |
$main::auth->assert('config'); |
|
44 | 48 |
|
45 |
$auth->assert('config');
|
|
49 |
my $form = $main::form;
|
|
46 | 50 |
|
47 | 51 |
$form->{title} = "Add"; |
48 | 52 |
|
... | ... | |
54 | 58 |
call_sub("form_$form->{type}_header"); |
55 | 59 |
call_sub("form_$form->{type}_footer"); |
56 | 60 |
|
57 |
$lxdebug->leave_sub(); |
|
61 |
$main::lxdebug->leave_sub();
|
|
58 | 62 |
} |
59 | 63 |
|
60 | 64 |
sub edit { |
61 |
$lxdebug->enter_sub(); |
|
65 |
$main::lxdebug->enter_sub();
|
|
62 | 66 |
|
63 |
$auth->assert('config'); |
|
67 |
$main::auth->assert('config'); |
|
68 |
|
|
69 |
my $form = $main::form; |
|
70 |
my %myconfig = %main::myconfig; |
|
64 | 71 |
|
65 | 72 |
# show history button |
66 | 73 |
$form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|; |
... | ... | |
76 | 83 |
call_sub("form_$form->{type}_header"); |
77 | 84 |
call_sub("form_$form->{type}_footer"); |
78 | 85 |
|
79 |
$lxdebug->leave_sub(); |
|
86 |
$main::lxdebug->leave_sub();
|
|
80 | 87 |
} |
81 | 88 |
|
82 | 89 |
sub search { |
83 |
$lxdebug->enter_sub(); |
|
90 |
$main::lxdebug->enter_sub(); |
|
91 |
|
|
92 |
$main::auth->assert('config'); |
|
84 | 93 |
|
85 |
$auth->assert('config'); |
|
94 |
my $form = $main::form; |
|
95 |
my $locale = $main::locale; |
|
86 | 96 |
|
97 |
my ($report, $sort, $number); |
|
87 | 98 |
if ($form->{type} eq 'partsgroup') { |
88 | 99 |
$report = "partsgroup_report"; |
89 | 100 |
$sort = 'partsgroup'; |
... | ... | |
158 | 169 |
</html> |
159 | 170 |
|; |
160 | 171 |
|
161 |
$lxdebug->leave_sub(); |
|
172 |
$main::lxdebug->leave_sub();
|
|
162 | 173 |
} |
163 | 174 |
|
164 | 175 |
sub save { |
165 |
$lxdebug->enter_sub(); |
|
176 |
$main::lxdebug->enter_sub();
|
|
166 | 177 |
|
167 |
$auth->assert('config'); |
|
178 |
$main::auth->assert('config'); |
|
179 |
|
|
180 |
my $form = $main::form; |
|
181 |
my %myconfig = %main::myconfig; |
|
182 |
my $locale = $main::locale; |
|
168 | 183 |
|
169 | 184 |
if ($form->{type} eq 'partsgroup') { |
170 | 185 |
$form->isblank("partsgroup", $locale->text('Group missing!')); |
... | ... | |
184 | 199 |
$form->{addition} = "SAVED"; |
185 | 200 |
$form->save_history($form->dbconnect(\%myconfig)); |
186 | 201 |
} |
187 |
# /saving the history
|
|
202 |
# /saving the history |
|
188 | 203 |
|
189 |
$lxdebug->leave_sub(); |
|
204 |
$main::lxdebug->leave_sub();
|
|
190 | 205 |
} |
191 | 206 |
|
192 | 207 |
sub delete { |
193 |
$lxdebug->enter_sub(); |
|
208 |
$main::lxdebug->enter_sub();
|
|
194 | 209 |
|
195 |
$auth->assert('config'); |
|
210 |
$main::auth->assert('config'); |
|
211 |
|
|
212 |
my $form = $main::form; |
|
213 |
my %myconfig = %main::myconfig; |
|
214 |
my $locale = $main::locale; |
|
196 | 215 |
|
197 | 216 |
PE->delete_tuple(\%myconfig, \%$form); |
198 | 217 |
|
... | ... | |
209 | 228 |
$form->save_history($form->dbconnect(\%myconfig)); |
210 | 229 |
} |
211 | 230 |
# /saving the history |
212 |
$lxdebug->leave_sub(); |
|
231 |
$main::lxdebug->leave_sub();
|
|
213 | 232 |
} |
214 | 233 |
|
215 |
sub continue { call_sub($form->{"nextsub"}); } |
|
234 |
sub continue { call_sub($main::form->{"nextsub"}); }
|
|
216 | 235 |
|
217 | 236 |
sub partsgroup_report { |
218 |
$lxdebug->enter_sub(); |
|
237 |
$main::lxdebug->enter_sub(); |
|
238 |
|
|
239 |
$main::auth->assert('config'); |
|
219 | 240 |
|
220 |
$auth->assert('config'); |
|
241 |
my $form = $main::form; |
|
242 |
my %myconfig = %main::myconfig; |
|
243 |
my $locale = $main::locale; |
|
221 | 244 |
|
222 |
map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup); |
|
245 |
map { $form->{$_} = $form->unescape($form->{$_}) } qw(partsgroup);
|
|
223 | 246 |
PE->partsgroups(\%myconfig, \%$form); |
224 | 247 |
|
225 |
$callback = |
|
248 |
my $callback =
|
|
226 | 249 |
"$form->{script}?action=partsgroup_report&type=$form->{type}&status=$form->{status}"; |
227 | 250 |
|
251 |
my ($option); |
|
228 | 252 |
if ($form->{status} eq 'all') { |
229 | 253 |
$option = $locale->text('All'); |
230 | 254 |
} |
... | ... | |
236 | 260 |
$option .= "\n<br>" . $locale->text('Group') . " : $form->{partsgroup}"; |
237 | 261 |
} |
238 | 262 |
|
239 |
@column_index = $form->sort_columns(qw(partsgroup)); |
|
240 |
|
|
263 |
my @column_index = $form->sort_columns(qw(partsgroup));
|
|
264 |
my %column_header; |
|
241 | 265 |
$column_header{partsgroup} = |
242 | 266 |
qq|<th class=listheading width=90%>| . $locale->text('Group') . qq|</th>|; |
243 | 267 |
|
... | ... | |
274 | 298 |
# escape callback for href |
275 | 299 |
$callback = $form->escape($callback); |
276 | 300 |
|
277 |
foreach $ref (@{ $form->{item_list} }) { |
|
301 |
my ($i, %column_data); |
|
302 |
foreach my $ref (@{ $form->{item_list} }) { |
|
278 | 303 |
|
279 | 304 |
$i++; |
280 | 305 |
$i %= 2; |
... | ... | |
317 | 342 |
</html> |
318 | 343 |
|; |
319 | 344 |
|
320 |
$lxdebug->leave_sub(); |
|
345 |
$main::lxdebug->leave_sub();
|
|
321 | 346 |
} |
322 | 347 |
|
323 | 348 |
sub form_partsgroup_header { |
324 |
$lxdebug->enter_sub(); |
|
349 |
$main::lxdebug->enter_sub(); |
|
350 |
|
|
351 |
$main::auth->assert('config'); |
|
325 | 352 |
|
326 |
$auth->assert('config'); |
|
353 |
my $form = $main::form; |
|
354 |
my $locale = $main::locale; |
|
327 | 355 |
|
328 | 356 |
$form->{title} = $locale->text("$form->{title} Group"); |
329 | 357 |
|
... | ... | |
364 | 392 |
</table> |
365 | 393 |
|; |
366 | 394 |
|
367 |
$lxdebug->leave_sub(); |
|
395 |
$main::lxdebug->leave_sub();
|
|
368 | 396 |
} |
369 | 397 |
|
370 | 398 |
sub form_partsgroup_footer { |
371 |
$lxdebug->enter_sub(); |
|
399 |
$main::lxdebug->enter_sub();
|
|
372 | 400 |
|
373 |
$auth->assert('config'); |
|
401 |
$main::auth->assert('config'); |
|
402 |
|
|
403 |
my $form = $main::form; |
|
404 |
my $locale = $main::locale; |
|
374 | 405 |
|
375 | 406 |
print qq| |
376 | 407 |
|
... | ... | |
389 | 420 |
# button for saving history |
390 | 421 |
print qq| |
391 | 422 |
<input type=button onclick=set_history_window(| |
392 |
. $form->{id}
|
|
423 |
. $form->{id} |
|
393 | 424 |
. qq|); name=history id=history value=| |
394 |
. $locale->text('history')
|
|
425 |
. $locale->text('history') |
|
395 | 426 |
. qq|>|; |
396 | 427 |
# /button for saving history |
397 | 428 |
print qq| |
... | ... | |
401 | 432 |
</html> |
402 | 433 |
|; |
403 | 434 |
|
404 |
$lxdebug->leave_sub(); |
|
435 |
$main::lxdebug->leave_sub();
|
|
405 | 436 |
} |
406 | 437 |
|
407 | 438 |
################################# |
408 | 439 |
# get pricesgroups and build up html-code |
409 | 440 |
# |
410 | 441 |
sub pricegroup_report { |
411 |
$lxdebug->enter_sub(); |
|
442 |
$main::lxdebug->enter_sub(); |
|
443 |
|
|
444 |
$main::auth->assert('config'); |
|
412 | 445 |
|
413 |
$auth->assert('config'); |
|
446 |
my $form = $main::form; |
|
447 |
my %myconfig = %main::myconfig; |
|
448 |
my $locale = $main::locale; |
|
414 | 449 |
|
415 |
map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup); |
|
450 |
map { $form->{$_} = $form->unescape($form->{$_}) } qw(pricegroup);
|
|
416 | 451 |
PE->pricegroups(\%myconfig, \%$form); |
417 | 452 |
|
418 |
$callback = |
|
453 |
my $callback =
|
|
419 | 454 |
"$form->{script}?action=pricegroup_report&type=$form->{type}&status=$form->{status}"; |
420 | 455 |
|
456 |
my $option; |
|
421 | 457 |
if ($form->{status} eq 'all') { |
422 | 458 |
$option = $locale->text('All'); |
423 | 459 |
} |
... | ... | |
430 | 466 |
"\n<br>" . $locale->text('Pricegroup') . " : $form->{pricegroup}"; |
431 | 467 |
} |
432 | 468 |
|
433 |
@column_index = $form->sort_columns(qw(pricegroup)); |
|
434 |
|
|
469 |
my @column_index = $form->sort_columns(qw(pricegroup));
|
|
470 |
my %column_header; |
|
435 | 471 |
$column_header{pricegroup} = |
436 | 472 |
qq|<th class=listheading width=90%>| |
437 | 473 |
. $locale->text('Pricegroup') |
... | ... | |
470 | 506 |
# escape callback for href |
471 | 507 |
$callback = $form->escape($callback); |
472 | 508 |
|
473 |
foreach $ref (@{ $form->{item_list} }) { |
|
509 |
my ($i, %column_data); |
|
510 |
foreach my $ref (@{ $form->{item_list} }) { |
|
474 | 511 |
|
475 | 512 |
$i++; |
476 | 513 |
$i %= 2; |
... | ... | |
513 | 550 |
</html> |
514 | 551 |
|; |
515 | 552 |
|
516 |
$lxdebug->leave_sub(); |
|
553 |
$main::lxdebug->leave_sub();
|
|
517 | 554 |
} |
518 | 555 |
|
519 | 556 |
####################### |
520 | 557 |
#build up pricegroup_header |
521 | 558 |
# |
522 | 559 |
sub form_pricegroup_header { |
523 |
$lxdebug->enter_sub(); |
|
560 |
$main::lxdebug->enter_sub(); |
|
561 |
|
|
562 |
$main::auth->assert('config'); |
|
524 | 563 |
|
525 |
$auth->assert('config'); |
|
564 |
my $form = $main::form; |
|
565 |
my $locale = $main::locale; |
|
526 | 566 |
|
527 | 567 |
# $locale->text('Add Pricegroup') |
528 | 568 |
# $locale->text('Edit Pricegroup') |
... | ... | |
562 | 602 |
</table> |
563 | 603 |
|; |
564 | 604 |
|
565 |
$lxdebug->leave_sub(); |
|
605 |
$main::lxdebug->leave_sub();
|
|
566 | 606 |
} |
567 | 607 |
###################### |
568 | 608 |
#build up pricegroup_footer |
569 | 609 |
# |
570 | 610 |
sub form_pricegroup_footer { |
571 |
$lxdebug->enter_sub(); |
|
611 |
$main::lxdebug->enter_sub(); |
|
612 |
|
|
613 |
$main::auth->assert('config'); |
|
572 | 614 |
|
573 |
$auth->assert('config'); |
|
615 |
my $form = $main::form; |
|
616 |
my $locale = $main::locale; |
|
574 | 617 |
|
575 | 618 |
print qq| |
576 | 619 |
|
... | ... | |
589 | 632 |
# button for saving history |
590 | 633 |
print qq| |
591 | 634 |
<input type=button onclick=set_history_window(| |
592 |
. $form->{id}
|
|
635 |
. $form->{id} |
|
593 | 636 |
. qq|); name=history id=history value=| |
594 |
. $locale->text('history')
|
|
637 |
. $locale->text('history') |
|
595 | 638 |
. qq|>|; |
596 | 639 |
# /button for saving history |
597 | 640 |
print qq| |
... | ... | |
601 | 644 |
</html> |
602 | 645 |
|; |
603 | 646 |
|
604 |
$lxdebug->leave_sub(); |
|
647 |
$main::lxdebug->leave_sub();
|
|
605 | 648 |
} |
Auch abrufbar als: Unified diff
pe strict