From 34dc226c4ddd6aa05c602b5082fb06bc70719abd Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 19 Apr 2007 15:15:50 +0000 Subject: [PATCH] Kleine Codevereinfachung. --- bin/mozilla/ic.pl | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) 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'); -- 2.20.1