Revision 8c7e4493
Von Moritz Bunkus vor fast 17 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
59 | 59 |
# $locale->text('Workflow request_quotation'); |
60 | 60 |
# $locale->text('Workflow sales_quotation'); |
61 | 61 |
|
62 |
my $oe_access_map = { |
|
63 |
'sales_order' => 'sales_order_edit', |
|
64 |
'purchase_order' => 'purchase_order_edit', |
|
65 |
'request_quotation' => 'request_quotation_edit', |
|
66 |
'sales_quotation' => 'sales_quotation_edit', |
|
67 |
}; |
|
68 |
|
|
69 |
sub check_oe_access { |
|
70 |
my $right = $oe_access_map->{$form->{type}}; |
|
71 |
$right ||= 'DOES_NOT_EXIST'; |
|
72 |
|
|
73 |
$auth->assert($right); |
|
74 |
} |
|
75 |
|
|
62 | 76 |
sub set_headings { |
63 | 77 |
$lxdebug->enter_sub(); |
64 | 78 |
|
79 |
check_oe_access(); |
|
80 |
|
|
65 | 81 |
my ($action) = @_; |
66 | 82 |
|
67 | 83 |
if ($form->{type} eq 'purchase_order') { |
... | ... | |
99 | 115 |
sub add { |
100 | 116 |
$lxdebug->enter_sub(); |
101 | 117 |
|
118 |
check_oe_access(); |
|
119 |
|
|
102 | 120 |
set_headings("add"); |
103 | 121 |
|
104 | 122 |
$form->{callback} = |
105 |
"$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}"
|
|
123 |
"$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}" |
|
106 | 124 |
unless $form->{callback}; |
107 | 125 |
|
108 | 126 |
&order_links; |
... | ... | |
114 | 132 |
|
115 | 133 |
sub edit { |
116 | 134 |
$lxdebug->enter_sub(); |
135 |
|
|
136 |
check_oe_access(); |
|
137 |
|
|
117 | 138 |
# show history button |
118 | 139 |
$form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|; |
119 | 140 |
#/show hhistory button |
... | ... | |
161 | 182 |
|
162 | 183 |
sub order_links { |
163 | 184 |
$lxdebug->enter_sub(); |
185 |
|
|
186 |
check_oe_access(); |
|
187 |
|
|
164 | 188 |
# get customer/vendor |
165 | 189 |
$form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); |
166 | 190 |
|
... | ... | |
279 | 303 |
|
280 | 304 |
sub prepare_order { |
281 | 305 |
$lxdebug->enter_sub(); |
306 |
|
|
307 |
check_oe_access(); |
|
308 |
|
|
282 | 309 |
$form->{formname} = $form->{type} unless $form->{formname}; |
283 | 310 |
|
284 | 311 |
my $i = 0; |
... | ... | |
301 | 328 |
$lxdebug->enter_sub(); |
302 | 329 |
my @custom_hiddens; |
303 | 330 |
|
331 |
check_oe_access(); |
|
332 |
|
|
304 | 333 |
# Container for template variables. Unfortunately this has to be visible in form_footer too, so not my. |
305 | 334 |
our %TMPL_VAR = (); |
306 | 335 |
|
... | ... | |
445 | 474 |
sub form_footer { |
446 | 475 |
$lxdebug->enter_sub(); |
447 | 476 |
|
477 |
check_oe_access(); |
|
478 |
|
|
448 | 479 |
$form->{invtotal} = $form->{invsubtotal}; |
449 | 480 |
|
450 | 481 |
$rows = max 2, $form->numtextrows($form->{notes}, 25, 8); |
... | ... | |
510 | 541 |
|
511 | 542 |
my ($recursive_call) = shift; |
512 | 543 |
|
544 |
check_oe_access(); |
|
545 |
|
|
513 | 546 |
set_headings($form->{"id"} ? "edit" : "add"); |
514 | 547 |
|
515 | 548 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining) unless $recursive_call; |
... | ... | |
623 | 656 |
sub search { |
624 | 657 |
$lxdebug->enter_sub(); |
625 | 658 |
|
659 |
check_oe_access(); |
|
660 |
|
|
626 | 661 |
if ($form->{type} eq 'purchase_order') { |
627 | 662 |
$form->{title} = $locale->text('Purchase Orders'); |
628 | 663 |
$form->{vc} = 'vendor'; |
... | ... | |
825 | 860 |
<tr> |
826 | 861 |
<td><input name="l_id" class=checkbox type=checkbox value=Y> | . $locale->text('ID') . qq|</td> |
827 | 862 |
<td><input name="l_$ordnumber" class=checkbox type=checkbox value=Y checked> $ordlabel</td> |
863 |
</tr> |
|
864 |
<tr> |
|
828 | 865 |
<td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> | . $locale->text('Date') . qq|</td> |
829 | 866 |
<td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> | . $locale->text('Required by') . qq|</td> |
830 | 867 |
</tr> |
... | ... | |
864 | 901 |
|
865 | 902 |
<br> |
866 | 903 |
<input type=hidden name=nextsub value=orders> |
867 |
<input type=hidden name=login value=$form->{login}> |
|
868 |
<input type=hidden name=password value=$form->{password}> |
|
869 | 904 |
<input type=hidden name=vc value=$form->{vc}> |
870 | 905 |
<input type=hidden name=type value=$form->{type}> |
871 | 906 |
|
... | ... | |
901 | 936 |
sub orders { |
902 | 937 |
$lxdebug->enter_sub(); |
903 | 938 |
|
939 |
check_oe_access(); |
|
940 |
|
|
904 | 941 |
$ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber"; |
905 | 942 |
|
906 | 943 |
($form->{ $form->{vc} }, $form->{"${form->{vc}}_id"}) = split(/--/, $form->{ $form->{vc} }); |
... | ... | |
1121 | 1158 |
sub check_delivered_flag { |
1122 | 1159 |
$lxdebug->enter_sub(); |
1123 | 1160 |
|
1161 |
check_oe_access(); |
|
1162 |
|
|
1124 | 1163 |
if (($form->{type} ne 'sales_order') && ($form->{type} ne 'purchase_order')) { |
1125 | 1164 |
return $lxdebug->leave_sub(); |
1126 | 1165 |
} |
... | ... | |
1147 | 1186 |
sub save_and_close { |
1148 | 1187 |
$lxdebug->enter_sub(); |
1149 | 1188 |
|
1189 |
check_oe_access(); |
|
1190 |
|
|
1150 | 1191 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
1151 | 1192 |
|
1152 | 1193 |
if ($form->{type} =~ /_order$/) { |
... | ... | |
1246 | 1287 |
sub save { |
1247 | 1288 |
$lxdebug->enter_sub(); |
1248 | 1289 |
|
1290 |
check_oe_access(); |
|
1291 |
|
|
1249 | 1292 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
1250 | 1293 |
|
1251 | 1294 |
|
... | ... | |
1347 | 1390 |
sub delete { |
1348 | 1391 |
$lxdebug->enter_sub(); |
1349 | 1392 |
|
1393 |
check_oe_access(); |
|
1394 |
|
|
1350 | 1395 |
$form->header; |
1351 | 1396 |
|
1352 | 1397 |
if ($form->{type} =~ /_order$/) { |
... | ... | |
1367 | 1412 |
map { delete $form->{$_} } qw(action header); |
1368 | 1413 |
|
1369 | 1414 |
foreach $key (keys %$form) { |
1415 |
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); |
|
1370 | 1416 |
$form->{$key} =~ s/\"/"/g; |
1371 | 1417 |
print qq|<input type=hidden name=$key value="$form->{$key}">\n|; |
1372 | 1418 |
} |
... | ... | |
1393 | 1439 |
sub delete_order_quotation { |
1394 | 1440 |
$lxdebug->enter_sub(); |
1395 | 1441 |
|
1442 |
check_oe_access(); |
|
1443 |
|
|
1396 | 1444 |
if ($form->{type} =~ /_order$/) { |
1397 | 1445 |
$msg = $locale->text('Order deleted!'); |
1398 | 1446 |
$err = $locale->text('Cannot delete order!'); |
... | ... | |
1419 | 1467 |
sub invoice { |
1420 | 1468 |
$lxdebug->enter_sub(); |
1421 | 1469 |
|
1470 |
check_oe_access(); |
|
1471 |
$auth->assert($form->{type} eq 'purchase_order' || $form->{type} eq 'request_quotation' ? 'vendor_invoice_edit' : 'invoice_edit'); |
|
1472 |
|
|
1422 | 1473 |
$form->{old_employee_id} = $form->{employee_id}; |
1423 | 1474 |
$form->{old_salesman_id} = $form->{salesman_id}; |
1424 | 1475 |
|
... | ... | |
1583 | 1634 |
|
1584 | 1635 |
sub backorder_exchangerate { |
1585 | 1636 |
$lxdebug->enter_sub(); |
1637 |
|
|
1638 |
check_oe_access(); |
|
1639 |
|
|
1586 | 1640 |
my ($orddate, $buysell) = @_; |
1587 | 1641 |
|
1588 | 1642 |
$form->header; |
... | ... | |
1597 | 1651 |
map { delete $form->{$_} } qw(action header exchangerate); |
1598 | 1652 |
|
1599 | 1653 |
foreach $key (keys %$form) { |
1654 |
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); |
|
1600 | 1655 |
$form->{$key} =~ s/\"/"/g; |
1601 | 1656 |
print qq|<input type=hidden name=$key value="$form->{$key}">\n|; |
1602 | 1657 |
} |
... | ... | |
1605 | 1660 |
|
1606 | 1661 |
print qq| |
1607 | 1662 |
|
1608 |
<input type=hidden name=login value=$form->{login}> |
|
1609 |
<input type=hidden name=password value=$form->{password}> |
|
1610 |
|
|
1611 | 1663 |
<input type=hidden name=exchangeratedate value=$orddate> |
1612 | 1664 |
<input type=hidden name=buysell value=$buysell> |
1613 | 1665 |
|
... | ... | |
1733 | 1785 |
sub save_as_new { |
1734 | 1786 |
$lxdebug->enter_sub(); |
1735 | 1787 |
|
1788 |
check_oe_access(); |
|
1789 |
|
|
1736 | 1790 |
$form->{saveasnew} = 1; |
1737 | 1791 |
$form->{closed} = 0; |
1738 | 1792 |
map { delete $form->{$_} } qw(printed emailed queued); |
... | ... | |
1755 | 1809 |
sub check_for_direct_delivery_yes { |
1756 | 1810 |
$lxdebug->enter_sub(); |
1757 | 1811 |
|
1812 |
check_oe_access(); |
|
1813 |
|
|
1758 | 1814 |
$form->{direct_delivery_checked} = 1; |
1759 | 1815 |
delete @{$form}{grep /^shipto/, keys %{ $form }}; |
1760 | 1816 |
map { s/^CFDD_//; $form->{$_} = $form->{"CFDD_${_}"} } grep /^CFDD_/, keys %{ $form }; |
... | ... | |
1766 | 1822 |
sub check_for_direct_delivery_no { |
1767 | 1823 |
$lxdebug->enter_sub(); |
1768 | 1824 |
|
1825 |
check_oe_access(); |
|
1826 |
|
|
1769 | 1827 |
$form->{direct_delivery_checked} = 1; |
1770 | 1828 |
delete @{$form}{grep /^shipto/, keys %{ $form }}; |
1771 | 1829 |
purchase_order(); |
... | ... | |
1776 | 1834 |
sub check_for_direct_delivery { |
1777 | 1835 |
$lxdebug->enter_sub(); |
1778 | 1836 |
|
1837 |
check_oe_access(); |
|
1838 |
|
|
1779 | 1839 |
if ($form->{direct_delivery_checked} |
1780 | 1840 |
|| (!$form->{shiptoname} && !$form->{shiptostreet} && !$form->{shipto_id})) { |
1781 | 1841 |
$lxdebug->leave_sub(); |
... | ... | |
1790 | 1850 |
} |
1791 | 1851 |
|
1792 | 1852 |
delete $form->{action}; |
1793 |
$form->{VARIABLES} = [ map { { "key" => $_, "value" => $form->{$_} } } grep { ref $_ eq "" } keys %{ $form } ];
|
|
1853 |
$form->{VARIABLES} = [ map { { "key" => $_, "value" => $form->{$_} } } grep { ($_ ne 'login') && ($_ ne 'password') && (ref $_ eq "") } keys %{ $form } ];
|
|
1794 | 1854 |
|
1795 | 1855 |
$form->header(); |
1796 | 1856 |
print $form->parse_html_template("oe/check_for_direct_delivery"); |
... | ... | |
1803 | 1863 |
sub purchase_order { |
1804 | 1864 |
$lxdebug->enter_sub(); |
1805 | 1865 |
|
1866 |
check_oe_access(); |
|
1867 |
$auth->assert('purchase_order_edit'); |
|
1868 |
|
|
1806 | 1869 |
if ($form->{type} eq 'sales_order') { |
1807 | 1870 |
check_for_direct_delivery(); |
1808 | 1871 |
} |
... | ... | |
1830 | 1893 |
sub sales_order { |
1831 | 1894 |
$lxdebug->enter_sub(); |
1832 | 1895 |
|
1896 |
check_oe_access(); |
|
1897 |
$auth->assert('sales_order_edit'); |
|
1898 |
|
|
1833 | 1899 |
if ( $form->{type} eq 'sales_quotation' |
1834 | 1900 |
|| $form->{type} eq 'request_quotation') { |
1835 | 1901 |
OE->close_order(\%myconfig, $form); |
... | ... | |
1853 | 1919 |
sub poso { |
1854 | 1920 |
$lxdebug->enter_sub(); |
1855 | 1921 |
|
1922 |
check_oe_access(); |
|
1923 |
$auth->assert('purchase_order_edit | sales_order_edit'); |
|
1924 |
|
|
1856 | 1925 |
$form->{transdate} = $form->current_date(\%myconfig); |
1857 | 1926 |
delete $form->{duedate}; |
1858 | 1927 |
|
... | ... | |
1893 | 1962 |
sub e_mail { |
1894 | 1963 |
$lxdebug->enter_sub(); |
1895 | 1964 |
|
1965 |
check_oe_access(); |
|
1966 |
|
|
1896 | 1967 |
$form->{print_and_save} = 1; |
1897 | 1968 |
|
1898 | 1969 |
$print_post = 1; |
... | ... | |
1901 | 1972 |
|
1902 | 1973 |
save(); |
1903 | 1974 |
|
1904 |
my %saved_vars; |
|
1905 |
map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber)); |
|
1906 |
restore_form($saved_form); |
|
1907 |
map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber)); |
|
1975 |
restore_form($saved_form, 0, qw(id ordnumber quonumber)); |
|
1908 | 1976 |
|
1909 | 1977 |
edit_e_mail(); |
1910 | 1978 |
|
... | ... | |
1925 | 1993 |
sub display_form { |
1926 | 1994 |
$lxdebug->enter_sub(); |
1927 | 1995 |
|
1996 |
check_oe_access(); |
|
1997 |
|
|
1928 | 1998 |
$form->{"taxaccounts"} =~ s/\s*$//; |
1929 | 1999 |
$form->{"taxaccounts"} =~ s/^\s*//; |
1930 | 2000 |
foreach my $accno (split(/\s*/, $form->{"taxaccounts"})) { |
Auch abrufbar als: Unified diff
Umstellung der Benutzerverwaltung von Dateien im Verzeichnis "users" auf die Verwendung einer Authentifizierungsdatenbank.
Es ist erforderlich, die Dateien doc/UPGRADE und doc/INSTALL/index.html zu lesen und die angesprochenen Punkte auszuführen, um nach einem Upgrade weiter arbeiten zu können.