X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcommon.pl;h=ff5cc7537e740f9ccd25adad6586469311579c85;hb=98662ad2b031a81c88ce6da0babf6f9d0b37059a;hp=6793a1ddc6a3452fc8d972ed24b67a4fc2ac5e10;hpb=f6e5b55ae22f3fda6863e8a14e07bc8ca6664564;p=kivitendo-erp.git diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 6793a1ddc..ff5cc7537 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -9,6 +9,7 @@ # ###################################################################### +use SL::Form; use YAML; use SL::Common; @@ -16,13 +17,10 @@ use SL::Common; sub save_form { $lxdebug->enter_sub(); - my $yaml = new YAML; - $yaml->Indent(1); - my $old_form = $yaml->dump($form); + my $old_form = YAML::Dump($form); $old_form =~ s|!|!!|g; $old_form =~ s|\n|!n|g; $old_form =~ s|\r|!r|g; - $lxdebug->message(0, "yeah!???\n\n$old_form\n\n\n"); $lxdebug->leave_sub(); @@ -38,7 +36,8 @@ sub restore_form { $old_form =~ s|!r|\r|g; $old_form =~ s|!n|\n|g; $old_form =~ s|!!|!|g; - $form = YAML::Load($old_form); + my $new_form = YAML::Load($old_form); + map({ $form->{$_} = $new_form->{$_}; } keys(%{$new_form})); $lxdebug->leave_sub(); } @@ -452,6 +451,13 @@ sub E { return $form->escape($_[0]); } +sub NTI { + my ($element) = @_; + + $element =~ s/tabindex\s*=\s*"\d+"//; + return $element; +} + sub format_dates { $lxdebug->enter_sub(); @@ -522,4 +528,19 @@ sub reformat_numbers { $lxdebug->leave_sub(); } +sub show_history { + $lxdebug->enter_sub(); + my $dbh = $form->dbconnect(\%myconfig); + + $form->{title} = $locale->text("History"); + $form->header(); + print $form->parse_html_template( "common/show_history", { + "DATEN" => $form->get_history($dbh,$form->{input_name}), + "SUCCESS" => ($form->get_history($dbh,$form->{input_name}) ne "0") + } ); + + $dbh->disconnect(); + $lxdebug->leave_sub(); +} + 1;