From: Moritz Bunkus Date: Fri, 10 Feb 2017 10:16:25 +0000 (+0100) Subject: Belegvorlagen: Form-Parameter beim Laden über Request vorbelegen können X-Git-Tag: release-3.5.4~1516 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2409735739fd290ad659b6d5aab83ff00dbcacef;p=kivitendo-erp.git Belegvorlagen: Form-Parameter beim Laden über Request vorbelegen können --- diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 9018dd905..b45cb99c5 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -103,6 +103,7 @@ sub load_record_template { $template->substitute_variables; # Clean the current $::form before rebuilding it from the template. + my $form_defaults = delete $::form->{form_defaults}; delete @{ $::form }{ grep { !m{^(?:script|login)$}i } keys %{ $::form } }; # Fill $::form from the template. @@ -150,6 +151,8 @@ sub load_record_template { $::form->{"project_id_${row}"} = $item->project_id; } + $::form->{$_} = $form_defaults->{$_} for keys %{ $form_defaults // {} }; + flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name)); update( diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 1fd81c3d1..ecd357eeb 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -101,6 +101,7 @@ sub load_record_template { $template->substitute_variables; # Clean the current $::form before rebuilding it from the template. + my $form_defaults = delete $::form->{form_defaults}; delete @{ $::form }{ grep { !m{^(?:script|login)$}i } keys %{ $::form } }; # Fill $::form from the template. @@ -148,6 +149,8 @@ sub load_record_template { $::form->{"project_id_${row}"} = $item->project_id; } + $::form->{$_} = $form_defaults->{$_} for keys %{ $form_defaults // {} }; + flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name)); update( diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index c2a2f02d5..14a58b4a6 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -96,6 +96,7 @@ sub load_record_template { $template->substitute_variables; # Clean the current $::form before rebuilding it from the template. + my $form_defaults = delete $::form->{form_defaults}; delete @{ $::form }{ grep { !m{^(?:script|login)$}i } keys %{ $::form } }; my $dummy_form = {}; @@ -138,6 +139,8 @@ sub load_record_template { $::form->{"${_}_${row}"} = $item->$_ for qw(source memo project_id); } + $::form->{$_} = $form_defaults->{$_} for keys %{ $form_defaults // {} }; + flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name)); update(