From e22d87797642852eb7195e69348655f434c57a31 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 18 Jul 2012 10:10:59 -0400 Subject: [PATCH] Bug 8455 - Followup - perltidy renewscript.pl Signed-off-by: David Cook Signed-off-by: Paul Poulain --- reserve/renewscript.pl | 64 +++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl index 30d8256c8e..d13ced3cca 100755 --- a/reserve/renewscript.pl +++ b/reserve/renewscript.pl @@ -1,10 +1,8 @@ #!/usr/bin/perl - #written 18/1/2000 by chris@katipo.co.nz #script to renew items from the web - # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -51,7 +49,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # my @data; -if ($input->param('renew_all')) { +if ( $input->param('renew_all') ) { @data = $input->param('all_items[]'); } else { @@ -59,39 +57,43 @@ else { } my @barcodes; -if ($input->param('return_all')) { +if ( $input->param('return_all') ) { @barcodes = $input->param('all_barcodes[]'); -} else { +} +else { @barcodes = $input->param('barcodes[]'); } -my $branch=$input->param('branch'); +my $branch = $input->param('branch'); my $datedue; -if ($input->param('newduedate')){ - $datedue = dt_from_string($input->param('newduedate')); +if ( $input->param('newduedate') ) { + $datedue = dt_from_string( $input->param('newduedate') ); } # warn "barcodes : @barcodes"; # # renew items # -my $cardnumber = $input->param("cardnumber"); +my $cardnumber = $input->param("cardnumber"); my $borrowernumber = $input->param("borrowernumber"); -my $exemptfine = $input->param("exemptfine") || 0; +my $exemptfine = $input->param("exemptfine") || 0; my $override_limit = $input->param("override_limit") || 0; -my $failedrenews = q{}; +my $failedrenews = q{}; foreach my $itemno (@data) { + # check status before renewing issue - my ($renewokay,$error) = CanBookBeRenewed($borrowernumber,$itemno,$override_limit); - if ($renewokay){ - AddRenewal($borrowernumber,$itemno,$branch,$datedue); + my ( $renewokay, $error ) = + CanBookBeRenewed( $borrowernumber, $itemno, $override_limit ); + if ($renewokay) { + AddRenewal( $borrowernumber, $itemno, $branch, $datedue ); + } + else { + $failedrenews .= "&failedrenew=$itemno"; } - else { - $failedrenews.="&failedrenew=$itemno"; - } } my $failedreturn = q{}; foreach my $barcode (@barcodes) { + # check status before renewing issue #System Preference Handling During Check-in In Patron Module @@ -99,36 +101,40 @@ foreach my $barcode (@barcodes) { $itemnumber = GetItemnumberFromBarcode($barcode); if ($itemnumber) { if ( C4::Context->preference("InProcessingToShelvingCart") ) { - my $item = GetItem( $itemnumber ); + my $item = GetItem($itemnumber); if ( $item->{'location'} eq 'PROC' ) { $item->{'location'} = 'CART'; - ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); + ModItem( $item, $item->{'biblionumber'}, + $item->{'itemnumber'} ); } } if ( C4::Context->preference("ReturnToShelvingCart") ) { - my $item = GetItem( $itemnumber ); + my $item = GetItem($itemnumber); $item->{'location'} = 'CART'; ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} ); } } - my ( $returned, $messages, $issueinformation, $borrower ) = - AddReturn($barcode, $branch, $exemptfine); - $failedreturn.="&failedreturn=$barcode" unless ($returned); + my ( $returned, $messages, $issueinformation, $borrower ) = + AddReturn( $barcode, $branch, $exemptfine ); + $failedreturn .= "&failedreturn=$barcode" unless ($returned); } # # redirection to the referrer page # -if ($input->param('destination') eq "circ"){ +if ( $input->param('destination') eq "circ" ) { $cardnumber = uri_escape($cardnumber); - print $input->redirect( - '/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber.$failedrenews.$failedreturn - ); + print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?findborrower=' + . $cardnumber + . $failedrenews + . $failedreturn ); } else { print $input->redirect( - '/cgi-bin/koha/members/moremember.pl?borrowernumber='.$borrowernumber.$failedrenews.$failedreturn - ); + '/cgi-bin/koha/members/moremember.pl?borrowernumber=' + . $borrowernumber + . $failedrenews + . $failedreturn ); } -- 2.39.5