X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=80faa1b063c6e473ae54639511e6dd7734801854;hb=4aa816112a8b9f2d2959c92cfaa2f2954bdeceb2;hp=5b1bc51d03ac17853b1e61127971f2bdbef73fea;hpb=de0f9532013c861dae78aa01b9633284d1ceee7c;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 5b1bc51d0..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,11 +389,19 @@ 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}; $TMPL_VAR{numberformat} = $myconfig{numberformat}; @@ -417,7 +426,7 @@ sub form_header { title creditlimit creditremaining tradediscount business max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax - shiptodepartment_1 shiptodepartment_2 shiptoemail + shiptodepartment_1 shiptodepartment_2 shiptoemail shiptocp_gender message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus), @custom_hiddens, map { $_.'_rate', $_.'_description' } split / /, $form->{taxaccounts} ]; # deleted: discount @@ -522,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; @@ -550,10 +557,13 @@ sub update { &check_form; } else { + my $mode; if ($form->{type} =~ /^sales/) { IS->retrieve_item(\%myconfig, \%$form); + $mode = 'IS'; } else { IR->retrieve_item(\%myconfig, \%$form); + $mode = 'IR'; } my $rows = scalar @{ $form->{item_list} }; @@ -571,7 +581,7 @@ sub update { if ($rows > 1) { - &select_item; + select_item(mode => $mode); ::end_of_request(); } else { @@ -2022,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; }