From e16b960b10f2a55557c50e5f9b7782614a501300 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 22 Jul 2024 18:53:59 +0000 Subject: [PATCH] Bug 35100: Additional Tidy for QA tools --- circ/returns.pl | 98 ++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 62 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index c84fd048696..465133e6084 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -540,11 +540,11 @@ my $recalled = 0; if ( $messages->{'WasTransfered'} ) { $template->param( - found => 1, - transfer => $messages->{'WasTransfered'}, - transferto => $messages->{'TransferTo'}, - trigger => $messages->{'TransferTrigger'}, - itemnumber => $itemnumber, + found => 1, + transfer => $messages->{'WasTransfered'}, + transferto => $messages->{'TransferTo'}, + trigger => $messages->{'TransferTrigger'}, + itemnumber => $itemnumber, ); } @@ -689,86 +689,60 @@ foreach my $code ( keys %$messages ) { if ( $code eq 'BadBarcode' ) { $err{badbarcode} = 1; $err{msg} = $messages->{'BadBarcode'}; - } - elsif ( $code eq 'NotIssued' ) { + } elsif ( $code eq 'NotIssued' ) { $err{notissued} = 1; - $err{msg} = ''; - } - elsif ( $code eq 'LocalUse' ) { + $err{msg} = ''; + } elsif ( $code eq 'LocalUse' ) { $err{localuse} = 1; - } - elsif ( $code eq 'WasLost' ) { + } elsif ( $code eq 'WasLost' ) { $err{waslost} = 1; - } - elsif ( $code eq 'LostItemFeeRefunded' ) { + } elsif ( $code eq 'LostItemFeeRefunded' ) { $template->param( LostItemFeeRefunded => 1 ); - } - elsif ( $code eq 'LostItemFeeCharged' ) { + } elsif ( $code eq 'LostItemFeeCharged' ) { $template->param( LostItemFeeCharged => 1 ); - } - elsif ( $code eq 'LostItemFeeRestored' ) { + } elsif ( $code eq 'LostItemFeeRestored' ) { $template->param( LostItemFeeRestored => 1 ); - } - elsif ( $code eq 'ProcessingFeeRefunded' ) { + } elsif ( $code eq 'ProcessingFeeRefunded' ) { $template->param( ProcessingFeeRefunded => 1 ); - } - elsif ( $code eq 'ResFound' ) { + } elsif ( $code eq 'ResFound' ) { ; # FIXME... anything to do here? - } - elsif ( $code eq 'WasReturned' ) { + } elsif ( $code eq 'WasReturned' ) { ; # FIXME... anything to do here? - } - elsif ( $code eq 'WasTransfered' ) { + } elsif ( $code eq 'WasTransfered' ) { ; # FIXME... anything to do here? - } - elsif ( $code eq 'TransferTo' ) { + } elsif ( $code eq 'TransferTo' ) { ; # Handled above, along with WasTransfered - } - elsif ( $code eq 'withdrawn' ) { + } elsif ( $code eq 'withdrawn' ) { $err{withdrawn} = 1; - } - elsif ( $code eq 'WrongTransfer' ) { + } elsif ( $code eq 'WrongTransfer' ) { ; # FIXME... anything to do here? - } - elsif ( $code eq 'WrongTransferItem' ) { + } elsif ( $code eq 'WrongTransferItem' ) { ; # FIXME... anything to do here? - } - elsif ( $code eq 'NeedsTransfer' ) { - } - elsif ( $code eq 'TransferTrigger' ) { + } elsif ( $code eq 'NeedsTransfer' ) { + } elsif ( $code eq 'TransferTrigger' ) { ; # Handled alongside NeedsTransfer - } - elsif ( $code eq 'TransferArrived' ) { + } elsif ( $code eq 'TransferArrived' ) { $err{transferred} = $messages->{'TransferArrived'}; - } - elsif ( $code eq 'Wrongbranch' ) { - } - elsif ( $code eq 'Debarred' ) { + } elsif ( $code eq 'Wrongbranch' ) { + } elsif ( $code eq 'Debarred' ) { $err{debarred} = $messages->{'Debarred'}; $err{debarcardnumber} = $borrower->{cardnumber}; $err{debarborrowernumber} = $borrower->{borrowernumber}; $err{debarname} = "$borrower->{firstname} $borrower->{surname}"; - } - elsif ( $code eq 'PrevDebarred' ) { - $err{prevdebarred} = $messages->{'PrevDebarred'}; - } - elsif ( $code eq 'ForeverDebarred' ) { - $err{foreverdebarred} = $messages->{'ForeverDebarred'}; - } - elsif ( $code eq 'ItemLocationUpdated' ) { + } elsif ( $code eq 'PrevDebarred' ) { + $err{prevdebarred} = $messages->{'PrevDebarred'}; + } elsif ( $code eq 'ForeverDebarred' ) { + $err{foreverdebarred} = $messages->{'ForeverDebarred'}; + } elsif ( $code eq 'ItemLocationUpdated' ) { $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated}; - } - elsif ( $code eq 'NotForLoanStatusUpdated' ) { + } elsif ( $code eq 'NotForLoanStatusUpdated' ) { $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated}; - } - elsif ( $code eq 'DataCorrupted' ) { + } elsif ( $code eq 'DataCorrupted' ) { $err{data_corrupted} = 1; - } - elsif ( $code eq 'ReturnClaims' ) { + } elsif ( $code eq 'ReturnClaims' ) { $template->param( ReturnClaims => $messages->{ReturnClaims} ); - } - elsif ( $code eq 'ClaimAutoResolved' ) { - $template->param( ClaimAutoResolved => $messages->{ClaimAutoResolved} ); + } elsif ( $code eq 'ClaimAutoResolved' ) { + $template->param( ClaimAutoResolved => $messages->{ClaimAutoResolved} ); } elsif ( $code eq 'RecallFound' ) { ; } elsif ( $code eq 'RecallNeedsTransfer' ) { @@ -779,7 +753,7 @@ foreach my $code ( keys %$messages ) { $template->param( InBundle => $messages->{InBundle} ); } else { die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. - # This forces the issue of staying in sync w/ Circulation.pm + # This forces the issue of staying in sync w/ Circulation.pm } if (%err) { push( @errmsgloop, \%err ); -- 2.39.2