X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcommon.pl;h=1b054cf22ab4858d2ba94408da07566850d6b743;hb=5f3f953a9ccd519fbe329d65a49239271b1b520d;hp=64aac69ea209955e4e0b3e417cddb6a9849e4b7a;hpb=bc4337116357a3daf6232fb3d921574cd995da2a;p=kivitendo-erp.git diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 64aac69ea..1b054cf22 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -9,8 +9,8 @@ # ###################################################################### -use Carp; use SL::Common; +use SL::DB::Helper::Mappings; use SL::DBUtils; use SL::Form; use SL::MoreCommon; @@ -390,7 +390,33 @@ sub format_dates { } sub reformat_numbers { - return $::form->format_numbers(@_); + return $::form->reformat_numbers(@_); +} + +# ------------------------------------------------------------------------- + +sub show_history { + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + my $dbh = $form->dbconnect(\%myconfig); + my ($sort, $sortby) = split(/\-\-/, $form->{order}); + $sort =~ s/.*\.(.*)/$1/; + + $form->{title} = $locale->text("History"); + $form->header(); + print $form->parse_html_template( "common/show_history", { + "DATEN" => $form->get_history($dbh,$form->{input_name},"",$form->{order}), + "SUCCESS" => ($form->get_history($dbh,$form->{input_name}) ne "0"), + uc($sort) => 1, + uc($sort)."BY" => $sortby + } ); + + $dbh->disconnect(); + $main::lxdebug->leave_sub(); } # ------------------------------------------------------------------------- @@ -413,9 +439,6 @@ 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 }(@_); @@ -613,13 +636,8 @@ sub gl_transaction { $main::lxdebug->leave_sub(); } -if ($::use_rdbo) { - eval { - require SL::DB::Helper::Mappings; - sub db { - goto &SL::DB::Helper::Mappings::db; - } - } or die $@; +sub db { + goto &SL::DB::Helper::Mappings::db; } 1;