From b79e3d2e365e2103affe47490bb30efef826beb3 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 Content-Type: text/plain; charset="utf-8" --- C4/Circulation.pm | 20 +++++++++------ circ/returns.pl | 6 +++- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 25 ++++++++++++++++--- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f3245c5..9ff4280 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1415,7 +1415,7 @@ sub GetBranchItemRule { =head2 AddReturn ($doreturn, $messages, $iteminformation, $borrower) = - &AddReturn($barcode, $branch, $exemptfine, $dropbox); + &AddReturn($barcode, $branch, $exemptfine, $dropbox, $ignore_reserves); Returns a book. @@ -1434,6 +1434,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: @@ -1487,7 +1490,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'}; @@ -1644,12 +1647,13 @@ sub AddReturn { } } - # find reserves..... - # if we don't have a reserve with the status W, we launch the Checkreserves routine - my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); - if ($resfound) { - $resrec->{'ResFound'} = $resfound; - $messages->{'ResFound'} = $resrec; + my ( $resfound, $resrec ); + unless ( $ignore_reserves ) { + ( $resfound, $resrec ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); + if ($resfound) { + $resrec->{'ResFound'} = $resfound; + $messages->{'ResFound'} = $resrec; + } } # update stats? diff --git a/circ/returns.pl b/circ/returns.pl index 9f01530..ea0a4bc 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'; @@ -400,7 +401,6 @@ if ( $messages->{'ResFound'}) { borcnum => $borr->{'cardnumber'}, debarred => $borr->{'debarred'}, gonenoaddress => $borr->{'gonenoaddress'}, - barcode => $barcode, destbranch => $reserve->{'branchcode'}, borrowernumber => $reserve->{'borrowernumber'}, itemnumber => $reserve->{'itemnumber'}, @@ -625,5 +625,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 7142cdc..4696e43 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -297,11 +297,12 @@ $(document).ready(function () { [% END %] - + [% FOREACH inputloo IN inputloop %] - - - [% END %] + + + + [% END %] @@ -309,6 +310,22 @@ $(document).ready(function () { + +
+ [% FOREACH inputloo IN inputloop %] + + + + [% END %] + + + + + + + + +
[% END %] [% ELSE %] -- 1.7.2.5