From 040c460bc23544a1777785b238a9e44e3d38830b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 12 Jun 2014 15:21:34 +0200 Subject: [PATCH] =?utf8?q?SL::Helper::CreatePDF:=20gewisse=20Variablen=20n?= =?utf8?q?icht=20mit=20Variablen=20=C3=BCberschreiben=20lassen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Helper/CreatePDF.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SL/Helper/CreatePDF.pm b/SL/Helper/CreatePDF.pm index 8d36eb749..555e75d73 100644 --- a/SL/Helper/CreatePDF.pm +++ b/SL/Helper/CreatePDF.pm @@ -29,7 +29,9 @@ sub create_pdf { my ($class, %params) = @_; my $userspath = $::lx_office_conf{paths}->{userspath}; + my $vars = $params{variables} || {}; my $form = Form->new(''); + $form->{$_} = $vars->{$_} for keys %{ $vars }; $form->{format} = 'pdf'; $form->{cwd} = getcwd(); $form->{templates} = $::instance_conf->get_templates; @@ -37,9 +39,6 @@ sub create_pdf { $form->{tmpdir} = $form->{cwd} . '/' . $userspath; my ($suffix) = $params{template} =~ m{\.(.+)}; - my $vars = $params{variables} || {}; - $form->{$_} = $vars->{$_} for keys %{ $vars }; - my $temp_fh; ($temp_fh, $form->{tmpfile}) = File::Temp::tempfile( 'kivitendo-printXXXXXX', -- 2.20.1