From 2409735739fd290ad659b6d5aab83ff00dbcacef Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 10 Feb 2017 11:16:25 +0100 Subject: [PATCH] =?utf8?q?Belegvorlagen:=20Form-Parameter=20beim=20Laden?= =?utf8?q?=20=C3=BCber=20Request=20vorbelegen=20k=C3=B6nnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/ap.pl | 3 +++ bin/mozilla/ar.pl | 3 +++ bin/mozilla/gl.pl | 3 +++ 3 files changed, 9 insertions(+) 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( -- 2.20.1