From 32bc23d0783921e112ae1b9264abb25fb7460980 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Thu, 18 Jul 2019 15:01:49 +0200 Subject: [PATCH] Bug 11999: Check for age restriction in CanBookBeReserved --- C4/Reserves.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 0ea808b828..dddda1b5a3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -283,6 +283,12 @@ sub CanBookBeReserved{ return { status => 'tooManyReserves' }; } + # Check for the age restriction + my $biblioData = C4::Biblio::GetBiblioData( $biblionumber ); + my $borrower = $patron->unblessed; + my ($ageRestriction, $daysToAgeRestriction) = C4::Circulation::GetAgeRestriction( $biblioData->{agerestriction}, $borrower ); + return { status => 'ageRestricted' } if $daysToAgeRestriction && $daysToAgeRestriction > 0; + my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber"); #get items linked via host records -- 2.11.0