From eb0ca4f1910d104ad6641d1ea7a1bbd6380a87cf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 18 Sep 2020 11:00:20 +0200 Subject: [PATCH] Bug 26485: Simplify itemnumber handling in returns.pl This is a follow-up for bug 25969. The way we handle itemnumber is too complicated and error prone. --- circ/returns.pl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index a7556c7b07..7f608c388d 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -136,8 +136,8 @@ if ($query->param('WT-itemNumber')){ updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From')); } +my $itemnumber = $query->param('itemnumber'); if ( $query->param('reserve_id') ) { - my $itemnumber = $query->param('itemnumber'); my $borrowernumber = $query->param('borrowernumber'); my $reserve_id = $query->param('reserve_id'); my $diffBranchReturned = $query->param('diffBranch'); @@ -165,7 +165,6 @@ if ( $query->param('reserve_id') ) { if ( $messages->{'transfert'} ) { $template->param( itemtitle => $biblio->title, - itemnumber => $item->itemnumber, itembiblionumber => $biblio->biblionumber, iteminfo => $biblio->author, name => $name, @@ -179,7 +178,6 @@ my $borrower; my $returned = 0; my $messages; my $issue; -my $itemnumber; my $barcode = $query->param('barcode'); my $exemptfine = $query->param('exemptfine'); if ( @@ -231,7 +229,6 @@ if ($dotransfer){ } if ($canceltransfer){ - $itemnumber=$query->param('itemnumber'); DeleteTransfer($itemnumber); if($dest eq "ttr"){ print $query->redirect("/cgi-bin/koha/circ/transferstoreceive.pl"); @@ -347,7 +344,6 @@ if ($barcode) { } $template->param( inputloop => \@inputloop ); - my $found = 0; my $waiting = 0; my $reserved = 0; @@ -359,7 +355,6 @@ if ( $messages->{'WasTransfered'} ) { $template->param( found => 1, transfer => 1, - itemnumber => $itemnumber, ); } @@ -368,7 +363,6 @@ if ( $messages->{'NeedsTransfer'} ){ found => 1, needstransfer => $messages->{'NeedsTransfer'}, trigger => $messages->{'TransferTrigger'}, - itemnumber => $itemnumber, ); } @@ -386,7 +380,6 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { WrongTransfer => 1, TransferWaitingAt => $messages->{'WrongTransfer'}, WrongTransferItem => $messages->{'WrongTransferItem'}, - itemnumber => $itemnumber, ); my $reserve = $messages->{'ResFound'}; @@ -422,7 +415,6 @@ if ( $messages->{'ResFound'}) { hold_auto_filled => 1, print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'), reserve_id => $nextreservinfo->{reserve_id}, - itemnumber => $itemnumber, ); if ( $messages->{'transfert'} ) { @@ -445,7 +437,6 @@ if ( $messages->{'ResFound'}) { transfertodo => $branchCheck ? undef : 1, reserve_id => $reserve->{reserve_id}, reserved => 1, - itemnumber => $itemnumber, ); } @@ -636,13 +627,14 @@ if ( $barcode ) { $template->param( collectionItemNeedsTransferred => 1, collectionBranch => $collectionBranch, - itemnumber => $itemnumber, ); } } } } +$template->param( itemnumber => $itemnumber ); + # Checking if there is a Fast Cataloging Framework $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); -- 2.20.1