From d2e805cac9546036c5fe186b74ccecf3151b1e8b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 18 Apr 2007 13:03:01 +0000 Subject: [PATCH] =?utf8?q?Beim=20Verschicken=20von=20Sammelrechnungen=20pe?= =?utf8?q?r=20Email=20einen=20besseren=20Namen=20f=C3=BCr=20den=20Dateianh?= =?utf8?q?ang=20w=C3=A4hlen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/rp.pl | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 8156df08d..152db9572 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -2003,21 +2003,33 @@ sub print { sub print_form { $lxdebug->enter_sub(); + my %replacements = + ( + "ä" => "ae", "ö" => "oe", "ü" => "ue", + "Ä" => "Ae", "Ö" => "Oe", "Ü" => "Ue", + "ß" => "ss", + " " => "_" + ); + $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1); $form->{templates} = "$myconfig{templates}"; - $form->{IN} = "$form->{type}.html"; - + my $suffix = "html"; + my $attachment_suffix = "html"; if ($form->{format} eq 'postscript') { $form->{postscript} = 1; - $form->{IN} =~ s/html$/tex/; - } - if ($form->{format} eq 'pdf') { + $suffix = "tex"; + $attachment_suffix = "ps"; + } elsif ($form->{format} eq 'pdf') { $form->{pdf} = 1; - $form->{IN} =~ s/html$/tex/; + $suffix = "tex"; + $attachment_suffix = "pdf"; } + $form->{IN} = "$form->{type}.$suffix"; + + # Save $form->{email} because it will be overwritten. $form->{EMAIL_RECIPIENT} = $form->{email}; @@ -2077,6 +2089,9 @@ sub print_form { $form->format_amount(\%myconfig, $form->{"${_}total"}, 2) } (c0, c30, c60, c90, ""); + $form->{attachment_filename} = $locale->text("Statement") . "_$form->{todate}.$attachment_suffix"; + map({ $form->{attachment_filename} =~ s/$_/$replacements{$_}/g; } keys(%replacements)); + $form->parse_template(\%myconfig, $userspath); } -- 2.20.1