From 4cc231e3445dc409b361e1267bee4de7ec3287a8 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 10 Oct 2012 10:27:47 -0400 Subject: [PATCH] Bug 8292 - clicking ignore on hold cancels transfer --- C4/Circulation.pm | 19 +++++++++------ circ/returns.pl | 6 +++-- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 25 ++++++++++++++++---- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 71fe20f..592b915 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1609,7 +1609,7 @@ sub GetBranchItemRule { =head2 AddReturn ($doreturn, $messages, $iteminformation, $borrower) = - &AddReturn($barcode, $branch, $exemptfine, $dropbox); + &AddReturn($barcode, $branch, $exemptfine, $dropbox, $ignore_reserves); Returns a book. @@ -1628,6 +1628,9 @@ overdue charges are applied and C<$dropbox> is true, the last charge will be removed. This assumes that the fines accrual script has run for _today_. +=item C<$ignore_reserves> indicates that the check-in should not +attempt to find reserves to full using this item. + =back C<&AddReturn> returns a list of four items: @@ -1681,7 +1684,7 @@ patron who last borrowed the book. =cut sub AddReturn { - my ( $barcode, $branch, $exemptfine, $dropbox ) = @_; + my ( $barcode, $branch, $exemptfine, $dropbox, $ignore_reserves ) = @_; if ($branch and not GetBranchDetail($branch)) { warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'}; @@ -1840,11 +1843,13 @@ sub AddReturn { # find reserves..... # if we don't have a reserve with the status W, we launch the Checkreserves routine - my ($resfound, $resrec); - ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} ); - if ($resfound) { - $resrec->{'ResFound'} = $resfound; - $messages->{'ResFound'} = $resrec; + my ( $resfound, $resrec ); + unless ( $ignore_reserves ) { + ( $resfound, $resrec ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} ); + if ($resfound) { + $resrec->{'ResFound'} = $resfound; + $messages->{'ResFound'} = $resrec; + } } # update stats? diff --git a/circ/returns.pl b/circ/returns.pl index 9472797..b2d0260 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -171,6 +171,7 @@ my $messages; my $issueinformation; my $itemnumber; my $barcode = $query->param('barcode'); +my $ignore_reserves = $query->param('ignore_reserves'); my $exemptfine = $query->param('exemptfine'); my $dropboxmode = $query->param('dropboxmode'); my $dotransfer = $query->param('dotransfer'); @@ -216,7 +217,7 @@ if ($barcode) { # save the return # ( $returned, $messages, $issueinformation, $borrower ) = - AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode); # do the return + AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $ignore_reserves ); # do the return my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn'); $homeorholdingbranchreturn ||= 'homebranch'; @@ -390,7 +391,6 @@ if ( $messages->{'ResFound'}) { borcnum => $borr->{'cardnumber'}, debarred => $borr->{'debarred'}, gonenoaddress => $borr->{'gonenoaddress'}, - barcode => $barcode, destbranch => $reserve->{'branchcode'}, borrowernumber => $reserve->{'borrowernumber'}, itemnumber => $reserve->{'itemnumber'}, @@ -556,5 +556,7 @@ $template->param( # } #} +$template->param( barcode => $barcode ); + # actually print the page! output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 7fd8d1d..9a4ff22 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -299,11 +299,12 @@ $(document).ready(function () { [% END %] - + [% FOREACH inputloo IN inputloop %] - - - [% END %] + + + + [% END %] @@ -311,6 +312,22 @@ $(document).ready(function () { + +
+ [% FOREACH inputloo IN inputloop %] + + + + [% END %] + + + + + + + + +
[% END %] [% ELSE %] -- 1.7.10.4