From dfa8266c76f93d137f68232a0c9d92783b75316e Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Wed, 8 Aug 2018 17:41:57 +1200 Subject: [PATCH] Bug 19532: Stopping recalled items (recall status='R') from being renewed Test plan: 1. Check out an item to a borrower and note the due date 2. Recall the item and note the updated due date 3. Try renewing the item and notice you can't. A message appears telling you the item has been recalled and cannot be renewed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand --- C4/Circulation.pm | 8 ++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 60ec838..4e3e71a 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2709,6 +2709,14 @@ sub CanBookBeRenewed { } return ( 0, "on_reserve" ) if $resfound; # '' when no hold was found + # check if item has been recalled. do a transfer if the recall branch is different to the item holding branch, otherwise don't do a transfer + my $recall = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'R' }); + my $recallfound; + if (defined $recall){ + $recallfound = 1; + } + return ( 0, "recalled" ) if $recallfound; + return ( 1, undef ) if $override_limit; my $branchcode = _GetCircControlBranch( $item, $patron->unblessed ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt index 39c6b70..68c3439 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt @@ -113,6 +113,8 @@ + [% ELSIF error == "recalled" %] +

This item has been recalled.

[% ELSIF error == "patron_restricted" %]

[% borrower.firstname | html %] [% borrower.surname | html %] ( [% borrower.cardnumber | html %] ) is currently restricted.

-- 2.1.4