Beim Verschicken von Einkaufs- und Verkaufsbelegen per Email nur dann speichern,...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 4 Apr 2007 14:07:43 +0000 (14:07 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 4 Apr 2007 14:07:43 +0000 (14:07 +0000)
bin/mozilla/io.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl

index e91c47b..1912776 100644 (file)
@@ -1430,12 +1430,14 @@ sub edit_e_mail {
 sub send_email {
   $lxdebug->enter_sub();
 
-  $old_form = new Form;
+  my $callback = $form->{script} . "?action=edit";
+  map({ $callback .= "\&${_}=" . E($form->{$_}); }
+      qw(login password path type id));
 
-  map { $old_form->{$_} = $form->{$_} } keys %$form;
-  $old_form->{media} = $form->{oldmedia};
+  print_form("return");
 
-  &print_form($old_form);
+  $form->{callback} = $callback;
+  $form->redirect();
 
   $lxdebug->leave_sub();
 }
@@ -1944,6 +1946,8 @@ sub print_form {
     $form->update_status(\%myconfig)
       if ($form->{media} eq 'queue' && $form->{id});
 
+    return $lxdebug->leave_sub() if ($old_form eq "return");
+
     if ($old_form) {
 
       $old_form->{"${inv}number"} = $form->{"${inv}number"};
index ce9e760..627a51d 100644 (file)
@@ -1621,11 +1621,20 @@ sub yes {
 sub e_mail {
   $lxdebug->enter_sub();
 
-  $print_post = 1;
+  if (!$form->{id}) {
+    $print_post = 1;
 
-  &post;
+    my $saved_form = save_form();
 
-  &edit_e_mail;
+    post();
+
+    my %saved_vars;
+    map({ $saved_vars{$_} = $form->{$_}; } qw(id invnumber));
+    restore_form($saved_form);
+    map({ $form->{$_} = $saved_vars{$_}; } qw(id invnumber));
+  }
+
+  edit_e_mail();
 
   $lxdebug->leave_sub();
 }
index a89c06a..bab0734 100644 (file)
@@ -2545,9 +2545,20 @@ sub e_mail {
 
   $form->{print_and_save} = 1;
 
-  &save;
+  if (!$form->{id}) {
+    $print_post = 1;
+
+    my $saved_form = save_form();
+
+    save();
+
+    my %saved_vars;
+    map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber));
+    restore_form($saved_form);
+    map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber));
+  }
 
-  &edit_e_mail;
+  edit_e_mail();
 
   $lxdebug->leave_sub();
 }