Bug 603 - intnotes werden nicht übernommen wenn vom Kunden aus Auftraege/Buchungen...
[kivitendo-erp.git] / bin / mozilla / common.pl
index 2c44c09..ff5cc75 100644 (file)
@@ -9,6 +9,7 @@
 #
 ######################################################################
 
+use SL::Form;
 use YAML;
 
 use SL::Common;
@@ -16,9 +17,7 @@ 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;
@@ -37,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();
 }
@@ -528,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;