From 6dfc32d53cc5a49811feca76ec81a3f110c53301 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 20 Jul 2018 00:26:01 +0000 Subject: [PATCH] Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester Previously the confirm recall popup was only displayed the first time the recalled item was out through returns. However it is useful for the Confirm recall popup to appear if the item is put through the returns multiple times due to library staff being interrupted. This ensures library staff are informed that the item has been recalled. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and notice the 'Confirm recall' popup appears. Click confirm 5. Now check the item in again and notice the popup is not displayed this time. 6. Apply this patch 7. Restart memcached and plack 8. Using a new item repeat steps 2,3,4,5 and notice in step 5 the 'Confirm recall' popup is displayed this time. Click 'Confirm' 9. Check the item out to patron 2 10. Return the item and notice no popup is displayed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand --- C4/Circulation.pm | 7 +++++-- catalogue/detail.pl | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 4ce4166..c4dfa70 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2048,10 +2048,14 @@ sub AddReturn { my ($resfound, $resrec); # find recalls..... - my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, old => undef }); + my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'R' }); + my $waiting_recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'W' }); if (defined $recall){ $messages->{'RecallFound'} = 1; $messages->{'Recall'} = $recall; + } elsif (defined $waiting_recall){ + $messages->{'RecallFound'} = 1; + $messages->{'Recall'} = $waiting_recall; } else { # find reserves..... # if we don't have a reserve with the status W, we launch the Checkreserves routine @@ -2060,7 +2064,6 @@ sub AddReturn { if ($resfound) { $resrec->{'ResFound'} = $resfound; $messages->{'ResFound'} = $resrec; - } } # Record the fact that this book was returned. diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 05cbb25..5a268ec 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -46,6 +46,7 @@ use Koha::ItemTypes; use Koha::Patrons; use Koha::Virtualshelves; use Koha::Recalls; +use Data::Dumper; my $query = CGI->new(); @@ -336,6 +337,7 @@ foreach my $item (@items) { my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber} }); if (defined $recall && $recall->status ne 'F' && $recall->status ne 'C'){ + warn 'item has been recalled'; $item->{recalled} = 1; $item->{recall} = $recall; } -- 2.1.4