From: Moritz Bunkus Date: Fri, 27 Jun 2008 09:16:41 +0000 (+0000) Subject: Doppelter-Code-Vermeidung X-Git-Tag: release-2.6.0beta1~98 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d9131c17545a97f6b171ec4f8f5c5a5fb9a2cf9e;p=kivitendo-erp.git Doppelter-Code-Vermeidung --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 49448bd61..f21da48e3 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -95,20 +95,18 @@ sub search { $form->{lastsort} = ""; # memory for which table was sort at last time $form->{ndxs_counter} = 0; # counter for added entries to top100 - my $is_service = $form->{searchitems} eq 'service'; - my $is_assembly = $form->{searchitems} eq 'assembly'; + my %is_xyz = map { +"is_$_" => ($form->{searchitems} eq $_) } qw(part service assembly); $form->{title} = (ucfirst $form->{searchitems}) . "s"; $form->{title} = $locale->text($form->{title}); - $form->{title} = $locale->text('Assemblies') if $is_assembly; + $form->{title} = $locale->text('Assemblies') if ($is_xyz{assembly}); $form->{jsscript} = 1; $form->header; - print $form->parse_html_template('ic/search', { is_assembly => $is_assembly, - is_service => $is_service, - dateformat => $myconfig{dateformat}, }); + print $form->parse_html_template('ic/search', { %is_xyz, + dateformat => $myconfig{dateformat}, }); $lxdebug->leave_sub(); } #end search()