From: Moritz Bunkus Date: Tue, 21 Jan 2014 15:50:21 +0000 (+0100) Subject: Refactoring: SL::Template: Parameterübergabe als Hash, nicht positionsabhängig (Teil 2) X-Git-Tag: release-3.2.0beta~467^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0b7d4ff9ae2dacb468b30db59d048301fcd8e3ff;p=kivitendo-erp.git Refactoring: SL::Template: Parameterübergabe als Hash, nicht positionsabhängig (Teil 2) --- diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 23e2ed0ae..6eb331d60 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -589,7 +589,7 @@ sub parse_and_create_pdf { my $error; eval { - my $template = SL::Template::LaTeX->new($template_file_name, $local_form, \%::myconfig, $::lx_office_conf{paths}->{userspath}); + my $template = SL::Template::LaTeX->new(file_name => $template_file_name, form => $local_form); my $result = $template->parse($tex_fh) && $template->convert_to_pdf; die $template->{error} unless $result; diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index a4b98ca71..c525dabe4 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -32,6 +32,9 @@ sub new { sub _init { my ($self, %params) = @_; + $params{myconfig} ||= \%::myconfig; + $params{userspath} ||= $::lx_office_conf{paths}->{userspath}; + $self->{$_} = $params{$_} for keys %params; $self->{variable_content_types} ||= {};