X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b65a230d60e86d2c18a3ab7222379905aea5ecd7..0e079eba45bcb834792660358b2e86dcb70e494e:/bin/mozilla/common.pl?ds=inline diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 17dac992e..c8ab34033 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -9,6 +9,7 @@ # ###################################################################### +use Carp; use SL::Common; use SL::DBUtils; use SL::Form; @@ -76,6 +77,11 @@ sub select_part { $has_charge = 1; map { $_->{has_charge} = 1; } @parts; } + my $has_bestbefore = 0; + if (defined($parts[0]->{bestbefore})) { + $has_bestbefore = 1; + map { $_->{has_bestbefore} = 1; } @parts; + } my $has_ean = 0; if (defined($parts[0]->{ean})) { $has_ean = 1; @@ -92,6 +98,7 @@ sub select_part { "nextsub" => "select_part_internal", "callback_sub" => $callback_sub, "has_charge" => $has_charge, + "has_bestbefore" => $has_bestbefore, "has_ean" => $has_ean, "remap_parts_id" => $remap_parts_id, "remap_partnumber" => $remap_partnumber }); @@ -502,6 +509,8 @@ sub show_history { # ------------------------------------------------------------------------- +my %_called_subs = (); + sub call_sub { $main::lxdebug->enter_sub(); @@ -520,6 +529,9 @@ sub call_sub { $form->error(sprintf($locale->text("Attempt to call an undefined sub named '%s'"), $name)); } + $_called_subs{$name}++; + confess "RECURSION DETECTION: call_sub($name) called " . $_called_subs{$name} . " time(s)" if $_called_subs{$name} > 10; + { no strict "refs"; &{ $name }(@_);