Bugfix: Resubmit bei save_and_print war buggy.
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 1 Sep 2009 08:56:24 +0000 (10:56 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 1 Sep 2009 08:56:24 +0000 (10:56 +0200)
bin/mozilla/do.pl

index 3884b68..a2eda3f 100644 (file)
@@ -121,7 +121,8 @@ sub edit {
   }
 
   if ($form->{print_and_save}) {
-    $form->{action}   = "print";
+    $form->{action}   = "dispatcher";
+    $form->{action_print} = "1";
     $form->{resubmit} = 1;
     $language_id      = $form->{language_id};
     $printer_id       = $form->{printer_id};
@@ -272,6 +273,8 @@ sub form_header {
     if ($form->{format} eq "html") {
       $form->{onload} = "window.open('about:blank','Beleg'); document.do.target = 'Beleg';";
     }
+    # emulate click for resubmitting actions
+    $form->{onload} .= "document.do.${_}.click(); " for grep { /^action_/ } keys %$form;
     $form->{onload} .= "document.do.submit();"
   }