X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=fa46e646bcb791ec7e073a72c32c0ab8e86298c9;hb=4c2604b36cd37edf2683420c09a117298fe300ea;hp=5050e6aa2e5a35b979ca257ae173a0f00838850a;hpb=8b6f73fcb835b8d5d95755603f062a442312b813;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 5050e6aa2..fa46e646b 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -38,6 +38,7 @@ use Carp; use CGI; +use List::MoreUtils qw(uniq); use List::Util qw(min max first); use SL::CVar; @@ -962,6 +963,9 @@ sub edit_e_mail { $form->{"email"} = $form->{"cp_email"} if $form->{"cp_email"}; } + $form->{language} = $form->get_template_language(\%myconfig); + $form->{language} = "_" . $form->{language} if $form->{language}; + my $title = $locale->text('E-mail') . " " . $form->get_formname_translation(); $form->{oldmedia} = $form->{media}; @@ -1501,14 +1505,8 @@ sub print_form { push @template_files, "$form->{formname}$form->{language}$printer_code.$extension"; push @template_files, "$form->{formname}.$extension"; push @template_files, "default.$extension"; - - $form->{IN} = undef; - for my $filename (@template_files) { - if (-f "$myconfig{templates}/$filename") { - $form->{IN} = $filename; - last; - } - } + @template_files = uniq @template_files; + $form->{IN} = first { -f "$myconfig{templates}/$_" } @template_files; if (!defined $form->{IN}) { $::form->error($::locale->text('Cannot find matching template for this print request. Please contact your template maintainer. I tried these: #1.', join ', ', map { "'$_'"} @template_files));