From: Moritz Bunkus Date: Tue, 24 Apr 2012 09:52:38 +0000 (+0200) Subject: Kosmetik: Codevereinfachung X-Git-Tag: release-3.0.0beta1~343^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=954e1105ecff719baca11490b3f328a14fcea9a0;p=kivitendo-erp.git Kosmetik: Codevereinfachung --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c44b525a2..fa46e646b 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1506,14 +1506,7 @@ sub print_form { push @template_files, "$form->{formname}.$extension"; push @template_files, "default.$extension"; @template_files = uniq @template_files; - - $form->{IN} = undef; - for my $filename (@template_files) { - if (-f "$myconfig{templates}/$filename") { - $form->{IN} = $filename; - last; - } - } + $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));