From: Moritz Bunkus Date: Thu, 19 Apr 2007 15:15:50 +0000 (+0000) Subject: Kleine Codevereinfachung. X-Git-Tag: release-2.4.3^2~487 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=34dc226c4ddd6aa05c602b5082fb06bc70719abd;p=kivitendo-erp.git Kleine Codevereinfachung. --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 7ecd3a24c..61a820b39 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -747,20 +747,9 @@ sub choice { sub list { $lxdebug->enter_sub(); - # get parts for - if (($form->{partnumber} eq "") and ($form->{description} eq "")) { - IC->get_parts(\%myconfig, \%$form, ""); - } else { - if ((!($form->{partnumber} eq "")) and ($form->{description} eq "")) { - IC->get_parts(\%myconfig, \%$form, "partnumber"); - } else { - if (($form->{partnumber} eq "") and (!($form->{description} eq ""))) { - IC->get_parts(\%myconfig, \%$form, "description"); - } else { - IC->get_parts(\%myconfig, \%$form, "all"); - } #fi - } #fi - } #fi + my @sortorders = ("", "partnumber", "description", "all"); + my $sortorder = $sortorders[($form->{description} ? 2 : 0) + ($form->{partnumber} ? 1 : 0)]; + IC->get_parts(\%myconfig, \%$form, $sortorder); $form->{title} = $locale->text('Top 100 hinzufuegen');