Revision d71bfc9b
Von Sven Schöling vor fast 16 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
533 | 533 |
return; |
534 | 534 |
} |
535 | 535 |
|
536 |
my ($stylesheet, $favicon); |
|
536 |
my ($stylesheet, $favicon, $pagelayout);
|
|
537 | 537 |
|
538 | 538 |
if ($ENV{HTTP_USER_AGENT}) { |
539 | 539 |
my $doctype; |
... | ... | |
591 | 591 |
? "$self->{title} - $self->{titlebar}" |
592 | 592 |
: $self->{titlebar}; |
593 | 593 |
my $ajax = ""; |
594 |
foreach $item (@ { $self->{AJAX} }) { |
|
594 |
foreach my $item (@ { $self->{AJAX} }) {
|
|
595 | 595 |
$ajax .= $item->show_javascript(); |
596 | 596 |
} |
597 | 597 |
|
... | ... | |
794 | 794 |
$add_params->{SHOW_BACK_BUTTON} = 1; |
795 | 795 |
} |
796 | 796 |
|
797 |
$self->{title} = $title if ($title);
|
|
797 |
$self->{title} = $params{title} if $params{title};
|
|
798 | 798 |
|
799 | 799 |
$self->header(); |
800 | 800 |
print $self->parse_html_template("generic/error", $add_params); |
... | ... | |
821 | 821 |
|
822 | 822 |
$main::lxdebug->leave_sub(); |
823 | 823 |
|
824 |
die("Information: $error\n");
|
|
824 |
die("Information: $text\n");
|
|
825 | 825 |
} |
826 | 826 |
|
827 | 827 |
# write Trigger JavaScript-Code ($qty = quantity of Triggers) |
... | ... | |
844 | 844 |
"yyyy-mm-dd" => "%Y-%m-%d", |
845 | 845 |
); |
846 | 846 |
|
847 |
my $ifFormat = defined($dateformats{$myconfig{"dateformat"}}) ? |
|
848 |
$dateformats{$myconfig{"dateformat"}} : "%d.%m.%Y"; |
|
847 |
my $ifFormat = defined($dateformats{$myconfig->{"dateformat"}}) ?
|
|
848 |
$dateformats{$myconfig->{"dateformat"}} : "%d.%m.%Y";
|
|
849 | 849 |
|
850 | 850 |
my @triggers; |
851 | 851 |
while ($#_ >= 2) { |
... | ... | |
878 | 878 |
|
879 | 879 |
if ($self->{callback}) { |
880 | 880 |
|
881 |
($script, $argv) = split(/\?/, $self->{callback}, 2); |
|
881 |
my ($script, $argv) = split(/\?/, $self->{callback}, 2);
|
|
882 | 882 |
$script =~ s|.*/||; |
883 | 883 |
$script =~ s|[^a-zA-Z0-9_\.]||g; |
884 | 884 |
exec("perl", "$script", $argv); |
... | ... | |
988 | 988 |
$amount *= $conv_unit->{factor}; |
989 | 989 |
|
990 | 990 |
my @values; |
991 |
my $num; |
|
991 | 992 |
|
992 | 993 |
foreach my $unit (@$conv_units) { |
993 | 994 |
my $last = $unit->{name} eq $part_unit->{name}; |
... | ... | |
1376 | 1377 |
$main::lxdebug->enter_sub(); |
1377 | 1378 |
|
1378 | 1379 |
my ($self, $date, $myconfig) = @_; |
1380 |
my ($yy, $mm, $dd); |
|
1379 | 1381 |
|
1380 | 1382 |
if ($date && $date =~ /\D/) { |
1381 | 1383 |
|
... | ... | |
1434 | 1436 |
my ($self, $myconfig) = @_; |
1435 | 1437 |
|
1436 | 1438 |
# connect to database |
1437 |
$dbh = |
|
1439 |
my $dbh =
|
|
1438 | 1440 |
DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, |
1439 | 1441 |
$myconfig->{dbpasswd}, { AutoCommit => 0 }) |
1440 | 1442 |
or $self->dberror; |
... | ... | |
2048 | 2050 |
$main::lxdebug->enter_sub(); |
2049 | 2051 |
|
2050 | 2052 |
my ($self, $dbh, $params) = @_; |
2053 |
my ($key); |
|
2051 | 2054 |
|
2052 | 2055 |
$key = $params->{key}; |
2053 | 2056 |
$key = "all_charts" unless ($key); |
... | ... | |
2181 | 2184 |
my ($self, $dbh, $key, $limit) = @_; |
2182 | 2185 |
|
2183 | 2186 |
$key = "all_customers" unless ($key); |
2184 |
$limit_clause = "LIMIT $limit" if $limit; |
|
2187 |
my $limit_clause = "LIMIT $limit" if $limit;
|
|
2185 | 2188 |
|
2186 | 2189 |
my $query = qq|SELECT * FROM customer WHERE NOT obsolete ORDER BY name $limit_clause|; |
2187 | 2190 |
|
... | ... | |
2271 | 2274 |
$main::lxdebug->leave_sub(); |
2272 | 2275 |
} |
2273 | 2276 |
|
2274 |
sub _get_groups { |
|
2275 |
$main::lxdebug->enter_sub(); |
|
2276 |
|
|
2277 |
my ($self, $dbh, $key) = @_; |
|
2278 |
|
|
2279 |
$key ||= "all_groups"; |
|
2280 |
|
|
2281 |
my $groups = $main::auth->read_groups(); |
|
2282 |
|
|
2283 |
$self->{$key} = selectall_hashref_query($self, $dbh, $query); |
|
2284 |
|
|
2285 |
$main::lxdebug->leave_sub(); |
|
2286 |
} |
|
2277 |
#sub _get_groups {
|
|
2278 |
# $main::lxdebug->enter_sub();
|
|
2279 |
# |
|
2280 |
# my ($self, $dbh, $key) = @_;
|
|
2281 |
# |
|
2282 |
# $key ||= "all_groups";
|
|
2283 |
# |
|
2284 |
# my $groups = $main::auth->read_groups();
|
|
2285 |
# |
|
2286 |
# $self->{$key} = selectall_hashref_query($self, $dbh, $query);
|
|
2287 |
# |
|
2288 |
# $main::lxdebug->leave_sub();
|
|
2289 |
#}
|
|
2287 | 2290 |
|
2288 | 2291 |
sub get_lists { |
2289 | 2292 |
$main::lxdebug->enter_sub(); |
... | ... | |
2383 | 2386 |
$self->_get_warehouses($dbh, $params{warehouses}); |
2384 | 2387 |
} |
2385 | 2388 |
|
2386 |
if ($params{groups}) { |
|
2387 |
$self->_get_groups($dbh, $params{groups}); |
|
2388 |
} |
|
2389 |
# if ($params{groups}) { |
|
2390 |
# $self->_get_groups($dbh, $params{groups}); |
|
2391 |
# } |
|
2392 |
|
|
2389 | 2393 |
if ($params{partsgroup}) { |
2390 | 2394 |
$self->get_partsgroup(\%main::myconfig, { all => 1, target => $params{partsgroup} }); |
2391 | 2395 |
} |
... | ... | |
2624 | 2628 |
do_statement($self, $sth, $query, '%' . $module . '%'); |
2625 | 2629 |
|
2626 | 2630 |
$self->{accounts} = ""; |
2627 |
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2631 |
while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2628 | 2632 |
|
2629 | 2633 |
foreach my $key (split(/:/, $ref->{link})) { |
2630 | 2634 |
if ($key =~ /\Q$module\E/) { |
... | ... | |
2671 | 2675 |
WHERE a.id = ?|; |
2672 | 2676 |
$ref = selectfirst_hashref_query($self, $dbh, $query, $self->{id}); |
2673 | 2677 |
|
2674 |
foreach $key (keys %$ref) { |
|
2678 |
foreach my $key (keys %$ref) {
|
|
2675 | 2679 |
$self->{$key} = $ref->{$key}; |
2676 | 2680 |
} |
2677 | 2681 |
|
... | ... | |
2693 | 2697 |
do_statement($self, $sth, $query, "%$module%"); |
2694 | 2698 |
|
2695 | 2699 |
$self->{accounts} = ""; |
2696 |
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2700 |
while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2697 | 2701 |
|
2698 | 2702 |
foreach my $key (split(/:/, $ref->{link})) { |
2699 | 2703 |
if ($key =~ /\Q$module\E/) { |
... | ... | |
2743 | 2747 |
my $index = 0; |
2744 | 2748 |
|
2745 | 2749 |
# store amounts in {acc_trans}{$key} for multiple accounts |
2746 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
2750 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
2747 | 2751 |
$ref->{exchangerate} = |
2748 | 2752 |
$self->get_exchangerate($dbh, $self->{currency}, $ref->{transdate}, $fld); |
2749 | 2753 |
if (!($xkeyref{ $ref->{accno} } =~ /tax/)) { |
... | ... | |
2909 | 2913 |
# fill rows |
2910 | 2914 |
foreach my $item (sort { $a->{num} <=> $b->{num} } @ndx) { |
2911 | 2915 |
$i++; |
2912 |
$j = $item->{ndx} - 1; |
|
2916 |
my $j = $item->{ndx} - 1;
|
|
2913 | 2917 |
map { $self->{"${_}_$i"} = $new->[$j]->{$_} } @{$flds}; |
2914 | 2918 |
} |
2915 | 2919 |
|
Auch abrufbar als: Unified diff
Form einmal durchgecheckt. Einige kaputte Sachen deaktiviert, und das ganze mit strict durchgecheckt.