Revision 12ce5ee7
Von Moritz Bunkus vor fast 17 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
88 | 88 |
use SL::PE; |
89 | 89 |
use SL::AM; |
90 | 90 |
use Data::Dumper; |
91 |
|
|
92 |
sub _check_io_auth { |
|
93 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
94 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' . |
|
95 |
'purchase_delivery_order_edit | sales_delivery_order_edit'); |
|
96 |
} |
|
97 |
|
|
91 | 98 |
######################################## |
92 | 99 |
# Eintrag fuer Version 2.2.0 geaendert # |
93 | 100 |
# neue Optik im Rechnungsformular # |
... | ... | |
95 | 102 |
sub display_row { |
96 | 103 |
$lxdebug->enter_sub(); |
97 | 104 |
|
98 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
99 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' . |
|
100 |
'sales_delivery_order_edit | purchase_delivery_order_edit'); |
|
105 |
_check_io_auth(); |
|
101 | 106 |
|
102 | 107 |
my $numrows = shift; |
103 | 108 |
|
... | ... | |
366 | 371 |
sub set_pricegroup { |
367 | 372 |
$lxdebug->enter_sub(); |
368 | 373 |
|
369 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
370 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
374 |
_check_io_auth(); |
|
371 | 375 |
|
372 | 376 |
my $rowcount = shift; |
373 | 377 |
for $j (1 .. $rowcount) { |
... | ... | |
390 | 394 |
sub select_item { |
391 | 395 |
$lxdebug->enter_sub(); |
392 | 396 |
|
393 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
394 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
397 |
_check_io_auth(); |
|
395 | 398 |
|
396 | 399 |
@column_index = qw(ndx partnumber description onhand unit sellprice); |
397 | 400 |
|
... | ... | |
521 | 524 |
sub item_selected { |
522 | 525 |
$lxdebug->enter_sub(); |
523 | 526 |
|
524 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
525 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
527 |
_check_io_auth(); |
|
526 | 528 |
|
527 | 529 |
# replace the last row with the checked row |
528 | 530 |
$i = $form->{rowcount}; |
... | ... | |
622 | 624 |
sub new_item { |
623 | 625 |
$lxdebug->enter_sub(); |
624 | 626 |
|
625 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
626 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
627 |
_check_io_auth(); |
|
627 | 628 |
|
628 | 629 |
# change callback |
629 | 630 |
$form->{old_callback} = $form->escape($form->{callback}, 1); |
... | ... | |
646 | 647 |
sub check_form { |
647 | 648 |
$lxdebug->enter_sub(); |
648 | 649 |
|
649 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
650 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
650 |
_check_io_auth(); |
|
651 | 651 |
|
652 | 652 |
my @a = (); |
653 | 653 |
my $count = 0; |
... | ... | |
754 | 754 |
sub invoicetotal { |
755 | 755 |
$lxdebug->enter_sub(); |
756 | 756 |
|
757 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
758 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
757 |
_check_io_auth(); |
|
759 | 758 |
|
760 | 759 |
$form->{oldinvtotal} = 0; |
761 | 760 |
|
... | ... | |
795 | 794 |
sub validate_items { |
796 | 795 |
$lxdebug->enter_sub(); |
797 | 796 |
|
798 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
799 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
797 |
_check_io_auth(); |
|
800 | 798 |
|
801 | 799 |
# check if items are valid |
802 | 800 |
if ($form->{rowcount} == 1) { |
... | ... | |
815 | 813 |
sub order { |
816 | 814 |
$lxdebug->enter_sub(); |
817 | 815 |
|
818 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
819 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
816 |
_check_io_auth(); |
|
820 | 817 |
|
821 | 818 |
if ($form->{second_run}) { |
822 | 819 |
$form->{print_and_post} = 0; |
... | ... | |
886 | 883 |
sub quotation { |
887 | 884 |
$lxdebug->enter_sub(); |
888 | 885 |
|
889 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
890 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
886 |
_check_io_auth(); |
|
891 | 887 |
|
892 | 888 |
if ($form->{second_run}) { |
893 | 889 |
$form->{print_and_post} = 0; |
... | ... | |
954 | 950 |
sub edit_e_mail { |
955 | 951 |
$lxdebug->enter_sub(); |
956 | 952 |
|
957 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
958 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
953 |
_check_io_auth(); |
|
959 | 954 |
|
960 | 955 |
if ($form->{second_run}) { |
961 | 956 |
$form->{print_and_post} = 0; |
... | ... | |
997 | 992 |
sub send_email { |
998 | 993 |
$lxdebug->enter_sub(); |
999 | 994 |
|
1000 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1001 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
995 |
_check_io_auth(); |
|
1002 | 996 |
|
1003 | 997 |
my $callback = $form->{script} . "?action=edit"; |
1004 | 998 |
map({ $callback .= "\&${_}=" . E($form->{$_}); } qw(type id)); |
... | ... | |
1025 | 1019 |
sub print_options { |
1026 | 1020 |
$lxdebug->enter_sub(); |
1027 | 1021 |
|
1028 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1029 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | dunning_edit |' . |
|
1030 |
'sales_delivery_order_edit | purchase_delivery_order_edit'); |
|
1022 |
_check_io_auth(); |
|
1031 | 1023 |
|
1032 | 1024 |
my %options = @_; |
1033 | 1025 |
|
... | ... | |
1141 | 1133 |
sub print { |
1142 | 1134 |
$lxdebug->enter_sub(); |
1143 | 1135 |
|
1144 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1145 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' . |
|
1146 |
'purchase_delivery_order_edit | sales_delivery_order_edit'); |
|
1136 |
_check_io_auth(); |
|
1147 | 1137 |
|
1148 | 1138 |
if ($form->{print_nextsub}) { |
1149 | 1139 |
call_sub($form->{print_nextsub}); |
... | ... | |
1180 | 1170 |
sub print_form { |
1181 | 1171 |
$lxdebug->enter_sub(); |
1182 | 1172 |
|
1183 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1184 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit |' . |
|
1185 |
'sales_delivery_order_edit | purchase_delivery_order_edit'); |
|
1173 |
_check_io_auth(); |
|
1186 | 1174 |
|
1187 | 1175 |
my ($old_form) = @_; |
1188 | 1176 |
|
... | ... | |
1618 | 1606 |
|
1619 | 1607 |
sub customer_details { |
1620 | 1608 |
$lxdebug->enter_sub(); |
1609 |
|
|
1621 | 1610 |
IS->customer_details(\%myconfig, \%$form, @_); |
1611 |
|
|
1622 | 1612 |
$lxdebug->leave_sub(); |
1623 | 1613 |
} |
1624 | 1614 |
|
... | ... | |
1633 | 1623 |
sub post_as_new { |
1634 | 1624 |
$lxdebug->enter_sub(); |
1635 | 1625 |
|
1636 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1637 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
1626 |
_check_io_auth(); |
|
1638 | 1627 |
|
1639 | 1628 |
$form->{postasnew} = 1; |
1640 | 1629 |
map { delete $form->{$_} } qw(printed emailed queued); |
... | ... | |
1647 | 1636 |
sub ship_to { |
1648 | 1637 |
$lxdebug->enter_sub(); |
1649 | 1638 |
|
1650 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1651 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
1639 |
_check_io_auth(); |
|
1652 | 1640 |
|
1653 | 1641 |
if ($form->{second_run}) { |
1654 | 1642 |
$form->{print_and_post} = 0; |
... | ... | |
1802 | 1790 |
sub new_license { |
1803 | 1791 |
$lxdebug->enter_sub(); |
1804 | 1792 |
|
1805 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1806 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
1793 |
_check_io_auth(); |
|
1807 | 1794 |
|
1808 | 1795 |
my $row = shift; |
1809 | 1796 |
|
... | ... | |
1844 | 1831 |
sub relink_accounts { |
1845 | 1832 |
$lxdebug->enter_sub(); |
1846 | 1833 |
|
1847 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1848 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
1834 |
_check_io_auth(); |
|
1849 | 1835 |
|
1850 | 1836 |
$form->{"taxaccounts"} =~ s/\s*$//; |
1851 | 1837 |
$form->{"taxaccounts"} =~ s/^\s*//; |
... | ... | |
1866 | 1852 |
sub set_duedate { |
1867 | 1853 |
$lxdebug->enter_sub(); |
1868 | 1854 |
|
1869 |
$auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
1870 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit'); |
|
1855 |
_check_io_auth(); |
|
1871 | 1856 |
|
1872 | 1857 |
$form->get_duedate(\%myconfig); |
1873 | 1858 |
|
... | ... | |
1875 | 1860 |
$result = "$form->{duedate}"; |
1876 | 1861 |
print $q->header(); |
1877 | 1862 |
print $result; |
1878 |
$lxdebug->leave_sub(); |
|
1879 | 1863 |
|
1864 |
$lxdebug->leave_sub(); |
|
1880 | 1865 |
} |
1881 | 1866 |
|
Auch abrufbar als: Unified diff
Benutzerrechteüberprüfung für die io.pl in eine eigene Funktion ausgelagert.