From 611a3dd324e413b4653c850546e50a0a7336a8bc Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 18 Jul 2008 14:39:13 +0000 Subject: [PATCH] =?utf8?q?Beim=20Verschicken=20von=20Emails=20=C3=BCberpr?= =?utf8?q?=C3=BCfen,=20ob=20es=20im=20Vorlagenverzeichnis=20eine=20Vorlage?= =?utf8?q?=20gibt,=20deren=20Name=20"=5Femail"=20hinter=20dem=20Formularty?= =?utf8?q?p=20enth=C3=A4lt=20und=20diese=20verwenden,=20sofern=20sie=20exi?= =?utf8?q?stiert=20(z.B.=20"sales=5Fquotation=5Femail=5Fen.tex"=20f=C3=BCr?= =?utf8?q?=20eine=20LaTeX-Angebotsvorlage=20in=20Englisch).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/io.pl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index a15f2acb8..79b787ca1 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1464,22 +1464,24 @@ sub print_form { reformat_numbers($output_numberformat, $precision, @{ $field_list }); } - $form->{IN} = "$form->{formname}$form->{language}${printer_code}.html"; + my $extension = ''; if ($form->{format} eq 'postscript') { - $form->{postscript} = 1; - $form->{IN} =~ s/html$/tex/; + $form->{postscript} = 1; + $extension = 'tex'; + } elsif ($form->{"format"} =~ /pdf/) { - $form->{pdf} = 1; - if ($form->{"format"} =~ /opendocument/) { - $form->{IN} =~ s/html$/odt/; - } else { - $form->{IN} =~ s/html$/tex/; - } + $form->{pdf} = 1; + $extension = $form->{'format'} =~ m/opendocument/i ? 'odt' : 'tex'; + } elsif ($form->{"format"} =~ /opendocument/) { - $form->{"opendocument"} = 1; - $form->{"IN"} =~ s/html$/odt/; + $form->{opendocument} = 1; + $extension = 'odt'; } + my $email_extension = '_email' if (($form->{media} eq 'email') && (-f "$myconfig{templates}/$form->{formname}_email$form->{language}${printer_code}.${extension}")); + + $form->{IN} = "$form->{formname}${email_extension}$form->{language}${printer_code}.${extension}"; + delete $form->{OUT}; if ($form->{media} eq 'printer') { -- 2.20.1