From 14cb0fdb8a0d7adab841dc0cf094ebd4613f5b00 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 31 Aug 2016 15:27:44 +0200 Subject: [PATCH] Bug 17229: Check if patron is expired in CanItemBeReserved This way, calls to ILS-DI HoldTitle and HoldItem do this check too Signed-off-by: Brendan Gallagher --- C4/Reserves.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 73b86b6..35312e3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -290,6 +290,7 @@ sub CanBookBeReserved{ cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK. tooManyReserves, if the borrower has exceeded his maximum reserve amount. notReservable, if holds on this item are not allowed + expired, if patron is expired and expired patrons are not allowed to place holds =cut @@ -308,6 +309,10 @@ sub CanItemBeReserved { my $patron = Koha::Patrons->find( $borrowernumber ); my $borrower = $patron->unblessed; + if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired) { + return 'expired'; + } + # If an item is damaged and we don't allow holds on damaged items, we can stop right here return 'damaged' if ( $item->{damaged} -- 2.1.4