From: Moritz Bunkus Date: Tue, 18 Feb 2014 10:55:28 +0000 (+0100) Subject: CreatePDF-Helfer: create_pdf: Extension muss bereits übergeben werden X-Git-Tag: release-3.2.0beta~491^2~10 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f4958a2b79ab78d5b04257f7340c786fef526de7;p=kivitendo-erp.git CreatePDF-Helfer: create_pdf: Extension muss bereits übergeben werden --- diff --git a/SL/Helper/CreatePDF.pm b/SL/Helper/CreatePDF.pm index 6cffc2925..10618b214 100644 --- a/SL/Helper/CreatePDF.pm +++ b/SL/Helper/CreatePDF.pm @@ -33,8 +33,9 @@ sub create_pdf { $form->{format} = 'pdf'; $form->{cwd} = getcwd(); $form->{templates} = $::instance_conf->get_templates; - $form->{IN} = $params{template} . '.tex'; + $form->{IN} = $params{template}; $form->{tmpdir} = $form->{cwd} . '/' . $userspath; + my ($suffix) = $params{template} =~ m{\.(.+)}; my $vars = $params{variables} || {}; $form->{$_} = $vars->{$_} for keys %{ $vars }; @@ -42,7 +43,7 @@ sub create_pdf { my $temp_fh; ($temp_fh, $form->{tmpfile}) = File::Temp::tempfile( 'kivitendo-printXXXXXX', - SUFFIX => '.tex', + SUFFIX => ".${suffix}", DIR => $userspath, UNLINK => ($::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files})? 0 : 1, );