From 7bdc69387d241ac71740edd1aa728fe4845a8fe2 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Wed, 18 Dec 2013 18:04:25 +0100 Subject: [PATCH] Bug 11056 : Delete dead code in basketgroup.pl Content-Type: text/plain; charset="utf-8" In basketgroup.pl, some code is supposed to be executed if $op = "validate". But this value is no more assigned to $op variable since 2009. This patch suppressed dead code. No functional changes expected Regression test : check basketgroup are shown as before the patch, and can be closed and reopen. Check you can create a basketgroup when you close a basket. --- acqui/basketgroup.pl | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 36c4462..aaf4454 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -297,7 +297,6 @@ my $op = $input->param('op') || 'display'; # possible values of $op : # - add : adds a new basketgroup, or edit an open basketgroup, or display a closed basketgroup # - mod_basket : modify an individual basket of the basketgroup -# - validate : FIXME dead code # - closeandprint : close and print an closed basketgroup in pdf. called by clicking on "Close and print" button in closed basketgroups list # - print : print a closed basketgroup. called by clicking on "Print" button in closed basketgroups list # - export : export in CSV a closed basketgroup. called by clicking on "Export" button in closed basketgroups list @@ -387,47 +386,6 @@ if ( $op eq "add" ) { ModBasket( { basketno => $basketno, basketgroupid => $basketgroupid } ); print $input->redirect("basket.pl?basketno=" . $basketno); -} elsif ($op eq 'validate') { -# -# FIXME dead code -# - if(! $booksellerid){ - $template->param( booksellererror => 1); - } else { - $template->param( booksellerid => $booksellerid ); - } - my $baskets = parseinputbaskets($booksellerid); - my ($basketgroups, $newbasketgroups) = parseinputbasketgroups($booksellerid, $baskets); - foreach my $nbgid (keys %$newbasketgroups){ -#javascript just picks an ID that's higher than anything else, the ID might not be correct..change it and change all the basket's basketgroupid as well - my $bgid = NewBasketgroup($newbasketgroups->{$nbgid}); - ${$newbasketgroups->{$nbgid}}->{'id'} = $bgid; - ${$newbasketgroups->{$nbgid}}->{'oldid'} = $nbgid; - } - foreach my $basket (@$baskets){ -#if the basket was added to a new basketgroup, first change the groupid to the groupid of the basket in mysql, because it contains the id from javascript otherwise. - if ( $basket->{'basketgroupid'} && $newbasketgroups->{$basket->{'basketgroupid'}} ){ - $basket->{'basketgroupid'} = ${$newbasketgroups->{$basket->{'basketgroupid'}}}->{'id'}; - } - ModBasket($basket); - } - foreach my $basketgroup (@$basketgroups){ - if(! $basketgroup->{'id'}){ - foreach my $basket (@{$basketgroup->{'baskets'}}){ - if($input->param('basket'.$basket->{'basketno'}.'changed')){ - ModBasket($basket); - } - } - } elsif ($input->param('basketgroup-'.$basketgroup->{'id'}.'-changed')){ - ModBasketgroup($basketgroup); - } - } - $basketgroups = &GetBasketgroups($booksellerid); - my $bookseller = &GetBookSellerFromId($booksellerid); - $baskets = &GetBasketsByBookseller($booksellerid); - # keep ungroupedbaskets - - displaybasketgroups($basketgroups, $bookseller, $baskets); } elsif ( $op eq 'closeandprint') { # # close an open basketgroup and generates a pdf -- 1.7.9.5