Revision 195883fd
Von Stephan Köhler vor etwa 19 Jahren hinzugefügt
bin/mozilla/pe.pl | ||
---|---|---|
65 | 65 |
if ($form->{type} eq 'partsgroup') { |
66 | 66 |
PE->get_partsgroup(\%myconfig, \%$form); |
67 | 67 |
} |
68 |
|
|
68 |
if ($form->{type} eq 'pricegroup') { |
|
69 |
PE->get_pricegroup(\%myconfig, \%$form); |
|
70 |
} |
|
69 | 71 |
&{"form_$form->{type}_header"}; |
70 | 72 |
&{"form_$form->{type}_footer"}; |
71 | 73 |
|
... | ... | |
106 | 108 |
|
107 | 109 |
} |
108 | 110 |
|
111 |
# for pricesgroups |
|
112 |
if ($form->{type} eq 'pricegroup') { |
|
113 |
$report = "pricegroup_report"; |
|
114 |
$sort = 'pricegroup'; |
|
115 |
$form->{title} = $locale->text('Pricegroup'); |
|
116 |
|
|
117 |
$number = qq| |
|
118 |
<tr> |
|
119 |
<th align=right width=1%>| . $locale->text('Pricegroup') . qq|</th> |
|
120 |
<td><input name=pricegroup size=20></td> |
|
121 |
</tr> |
|
122 |
|; |
|
123 |
|
|
124 |
} |
|
125 |
|
|
109 | 126 |
$form->header; |
110 | 127 |
|
111 | 128 |
print qq| |
... | ... | |
130 | 147 |
<td><input name=status class=radio type=radio value=all checked> | |
131 | 148 |
. $locale->text('All') . qq| |
132 | 149 |
<input name=status class=radio type=radio value=orphaned> | |
133 |
. $locale->text('Orphaned') |
|
134 |
. qq|</td> |
|
150 |
. $locale->text('Orphaned') . qq|</td> |
|
135 | 151 |
</tr> |
136 | 152 |
</table> |
137 | 153 |
</td> |
... | ... | |
397 | 413 |
$form->redirect($locale->text('Group saved!')); |
398 | 414 |
} |
399 | 415 |
|
416 |
# choice pricegroup and save |
|
417 |
if ($form->{type} eq 'pricegroup') { |
|
418 |
$form->isblank("pricegroup", $locale->text('Pricegroup missing!')); |
|
419 |
PE->save_pricegroup(\%myconfig, \%$form); |
|
420 |
$form->redirect($locale->text('Pricegroup saved!')); |
|
421 |
} |
|
422 |
|
|
400 | 423 |
$lxdebug->leave_sub(); |
401 | 424 |
} |
402 | 425 |
|
... | ... | |
411 | 434 |
if ($form->{type} eq 'partsgroup') { |
412 | 435 |
$form->redirect($locale->text('Group deleted!')); |
413 | 436 |
} |
437 |
if ($form->{type} eq 'pricegroup') { |
|
438 |
$form->redirect($locale->text('Pricegroup deleted!')); |
|
439 |
} |
|
414 | 440 |
|
415 | 441 |
$lxdebug->leave_sub(); |
416 | 442 |
} |
... | ... | |
534 | 560 |
sub form_partsgroup_header { |
535 | 561 |
$lxdebug->enter_sub(); |
536 | 562 |
|
537 |
$form->{title} = $locale->text("$form->{title} Group");
|
|
563 |
$form->{title} = $locale->text("$form->{title} Pricegroup");
|
|
538 | 564 |
|
539 | 565 |
# $locale->text('Add Group') |
540 | 566 |
# $locale->text('Edit Group') |
... | ... | |
560 | 586 |
<td> |
561 | 587 |
<table width=100%> |
562 | 588 |
<tr> |
563 |
<th align=right>| . $locale->text('Group') . qq|</th>
|
|
589 |
<th align=right>| . $locale->text('Pricegroup') . qq|</th>
|
|
564 | 590 |
|
565 | 591 |
<td><input name=partsgroup size=30 value="$form->{partsgroup}"></td> |
566 | 592 |
</tr> |
... | ... | |
611 | 637 |
|
612 | 638 |
$lxdebug->leave_sub(); |
613 | 639 |
} |
640 |
|
|
641 |
################################# |
|
642 |
# get pricesgroups and build up html-code |
|
643 |
# |
|
644 |
sub pricegroup_report { |
|
645 |
$lxdebug->enter_sub(); |
|
646 |
|
|
647 |
map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup); |
|
648 |
PE->pricegroups(\%myconfig, \%$form); |
|
649 |
|
|
650 |
$callback = |
|
651 |
"$form->{script}?action=pricegroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}"; |
|
652 |
|
|
653 |
if ($form->{status} eq 'all') { |
|
654 |
$option = $locale->text('All'); |
|
655 |
} |
|
656 |
if ($form->{status} eq 'orphaned') { |
|
657 |
$option .= $locale->text('Orphaned'); |
|
658 |
} |
|
659 |
if ($form->{pricegroup}) { |
|
660 |
$callback .= "&pricegroup=$form->{pricegroup}"; |
|
661 |
$option .= |
|
662 |
"\n<br>" . $locale->text('Pricegroup') . " : $form->{pricegroup}"; |
|
663 |
} |
|
664 |
|
|
665 |
@column_index = $form->sort_columns(qw(pricegroup)); |
|
666 |
|
|
667 |
$column_header{pricegroup} = |
|
668 |
qq|<th class=listheading width=90%>| |
|
669 |
. $locale->text('Pricegroup') |
|
670 |
. qq|</th>|; |
|
671 |
|
|
672 |
$form->{title} = $locale->text('Pricegroup'); |
|
673 |
|
|
674 |
$form->header; |
|
675 |
|
|
676 |
print qq| |
|
677 |
<body> |
|
678 |
|
|
679 |
<table width=100%> |
|
680 |
<tr> |
|
681 |
<th class=listtop>$form->{title}</th> |
|
682 |
</tr> |
|
683 |
<tr height="5"></tr> |
|
684 |
<tr> |
|
685 |
<td>$option</td> |
|
686 |
</tr> |
|
687 |
<tr> |
|
688 |
<td> |
|
689 |
<table width=100%> |
|
690 |
<tr class=listheading> |
|
691 |
|; |
|
692 |
|
|
693 |
map { print "$column_header{$_}\n" } @column_index; |
|
694 |
|
|
695 |
print qq| |
|
696 |
</tr> |
|
697 |
|; |
|
698 |
|
|
699 |
# escape callback |
|
700 |
$form->{callback} = $callback; |
|
701 |
|
|
702 |
# escape callback for href |
|
703 |
$callback = $form->escape($callback); |
|
704 |
|
|
705 |
foreach $ref (@{ $form->{item_list} }) { |
|
706 |
|
|
707 |
$i++; |
|
708 |
$i %= 2; |
|
709 |
|
|
710 |
print qq| |
|
711 |
<tr valign=top class=listrow$i> |
|
712 |
|; |
|
713 |
$column_data{pricegroup} = |
|
714 |
qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup}</td>|; |
|
715 |
|
|
716 |
map { print "$column_data{$_}\n" } @column_index; |
|
717 |
|
|
718 |
print " |
|
719 |
</tr> |
|
720 |
"; |
|
721 |
} |
|
722 |
|
|
723 |
print qq| |
|
724 |
</table> |
|
725 |
</td> |
|
726 |
</tr> |
|
727 |
<tr> |
|
728 |
<td><hr size=3 noshade></td> |
|
729 |
</tr> |
|
730 |
</table> |
|
731 |
|
|
732 |
<br> |
|
733 |
<form method=post action=$form->{script}> |
|
734 |
|
|
735 |
<input name=callback type=hidden value="$form->{callback}"> |
|
736 |
|
|
737 |
<input type=hidden name=type value=$form->{type}> |
|
738 |
|
|
739 |
<input type=hidden name=path value=$form->{path}> |
|
740 |
<input type=hidden name=login value=$form->{login}> |
|
741 |
<input type=hidden name=password value=$form->{password}> |
|
742 |
|
|
743 |
<input class=submit type=submit name=action value="| |
|
744 |
. $locale->text('Add') . qq|">|; |
|
745 |
|
|
746 |
if ($form->{menubar}) { |
|
747 |
require "$form->{path}/menu.pl"; |
|
748 |
&menubar; |
|
749 |
} |
|
750 |
|
|
751 |
print qq| |
|
752 |
</form> |
|
753 |
|
|
754 |
</body> |
|
755 |
</html> |
|
756 |
|; |
|
757 |
|
|
758 |
$lxdebug->leave_sub(); |
|
759 |
} |
|
760 |
|
|
761 |
####################### |
|
762 |
#build up pricegroup_header |
|
763 |
# |
|
764 |
sub form_pricegroup_header { |
|
765 |
$lxdebug->enter_sub(); |
|
766 |
|
|
767 |
$form->{title} = $locale->text("$form->{title} Group"); |
|
768 |
|
|
769 |
$form->{pricegroup} =~ s/\"/"/g; |
|
770 |
|
|
771 |
$form->header; |
|
772 |
|
|
773 |
print qq| |
|
774 |
<body> |
|
775 |
|
|
776 |
<form method=post action=$form->{script}> |
|
777 |
|
|
778 |
<input type=hidden name=id value=$form->{id}> |
|
779 |
<input type=hidden name=type value=$form->{type}> |
|
780 |
|
|
781 |
<table width=100%> |
|
782 |
<tr> |
|
783 |
<th class=listtop>$form->{title}</th> |
|
784 |
</tr> |
|
785 |
<tr height="5"></tr> |
|
786 |
<tr> |
|
787 |
<td> |
|
788 |
<table width=100%> |
|
789 |
<tr> |
|
790 |
<th align=right>| . $locale->text('Preisgruppe') . qq|</th> |
|
791 |
<td><input name=pricegroup size=30 value="$form->{pricegroup}"></td> |
|
792 |
</tr> |
|
793 |
</table> |
|
794 |
</td> |
|
795 |
</tr> |
|
796 |
<tr> |
|
797 |
<td colspan=2><hr size=3 noshade></td> |
|
798 |
</tr> |
|
799 |
</table> |
|
800 |
|; |
|
801 |
|
|
802 |
$lxdebug->leave_sub(); |
|
803 |
} |
|
804 |
###################### |
|
805 |
#build up pricegroup_footer |
|
806 |
# |
|
807 |
sub form_pricegroup_footer { |
|
808 |
$lxdebug->enter_sub(); |
|
809 |
|
|
810 |
print qq| |
|
811 |
|
|
812 |
<input name=callback type=hidden value="$form->{callback}"> |
|
813 |
|
|
814 |
<input type=hidden name=path value=$form->{path}> |
|
815 |
<input type=hidden name=login value=$form->{login}> |
|
816 |
<input type=hidden name=password value=$form->{password}> |
|
817 |
|
|
818 |
<br><input type=submit class=submit name=action value="| |
|
819 |
. $locale->text('Save') . qq|"> |
|
820 |
|; |
|
821 |
|
|
822 |
if ($form->{id} && $form->{orphaned}) { |
|
823 |
print qq| |
|
824 |
<input type=submit class=submit name=action value="| |
|
825 |
. $locale->text('Delete') . qq|">|; |
|
826 |
} |
|
827 |
|
|
828 |
if ($form->{menubar}) { |
|
829 |
require "$form->{path}/menu.pl"; |
|
830 |
&menubar; |
|
831 |
} |
|
832 |
|
|
833 |
print qq| |
|
834 |
</form> |
|
835 |
|
|
836 |
</body> |
|
837 |
</html> |
|
838 |
|; |
|
839 |
|
|
840 |
$lxdebug->leave_sub(); |
|
841 |
} |
Auch abrufbar als: Unified diff
Preisgruppenerweiterung auf Basis von Andres Patch - Thanks
Preisgruppenverwaltung
...-Preiseingabe der Preisgruppen in Masken Waren,etc.
-Auswahl der Preisgruppen in den Verkaufsmasken
Erweiterung Datenbankschema