X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fio.pl;h=fa46e646bcb791ec7e073a72c32c0ab8e86298c9;hb=4c2604b36cd37edf2683420c09a117298fe300ea;hp=022f039ee5106dda5168e6c3bcda2cbbfed544a3;hpb=2c6997eca202daacb743c80d1d65c6faed61ad35;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 022f039ee..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; @@ -1504,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));