From 5d8dbe98677296f277230024db5af5307861ab22 Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Thu, 1 Sep 2011 13:23:22 +0200 Subject: [PATCH] =?utf8?q?Fix=20f=C3=BCr=20Bug=201673?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit bei "Erneuern" und "Als neu speichern" nicht mehr immer drucken. --- bin/mozilla/oe.pl | 21 +++++++++++++-------- templates/webpages/oe/form_header.html | 4 ---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 3c2b32814..80faa1b06 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -181,7 +181,8 @@ sub edit { my ($language_id, $printer_id); 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}; @@ -388,10 +389,17 @@ sub form_header { } } - my $onload = ($form->{resubmit} && ($form->{format} eq "html")) ? "window.open('about:blank','Beleg'); document.oe.target = 'Beleg';document.oe.submit()" - : ($form->{resubmit}) ? "document.oe.submit()" - : ($creditwarning) ? "alert('$credittext')" - : ""; + my $onload = ""; + if ($form->{resubmit} && ($form->{format} eq "html")) { + $onload = "window.open('about:blank','Beleg'); document.oe.target = 'Beleg';"; + $onload .= "document.do.submit();"; + } elsif ($form->{resubmit}) { + # emulate click for resubmitting actions + $onload = "document.oe.${_}.click(); " for grep { /^action_/ } keys %$form; + $onload .= "document.oe.submit();"; + } elsif ($creditwarning) { + $onload = "alert('$credittext')"; + } $TMPL_VAR{onload} = $onload; $TMPL_VAR{dateformat} = $myconfig{dateformat}; @@ -523,8 +531,6 @@ sub update { check_oe_access(); -# $main::lxdebug->message(0, Dumper($form)); - set_headings($form->{"id"} ? "edit" : "add"); map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate) unless $recursive_call; @@ -2026,7 +2032,6 @@ sub dispatcher { foreach my $action (qw(delete delivery_order e_mail invoice print purchase_order purchase_order quotation request_for_quotation sales_order sales_order save save_and_close save_as_new ship_to update)) { if ($::form->{"action_${action}"}) { - $::form->{dispatched_action} = $action; call_sub($action); return; } diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index 59781d37a..20c25ce89 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -26,10 +26,6 @@ -[%- IF resubmit %] -[%# in case of resubmits, restore enough information for dispatcher to work %] - [% L.hidden_tag('action_' _ dispatched_action, 1) %] -[%- END %]
[% title %]
-- 2.20.1