@@ -, +, @@ CanItemBeReserved --- C4/Reserves.pm | 6 ++++++ 1 file changed, 6 insertions(+) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -295,6 +295,7 @@ sub CanBookBeReserved{ if ($canReserve->{status} eq 'OK') { #We can reserve this Item! } @RETURNS { status => OK }, if the Item can be reserved. + { status => onShelfHoldsNotAllowed }, if onShelfHoldsAllowed parameter and item availability combination doesn't allow holds. { status => ageRestricted }, if the Item is age restricted for this borrower. { status => damaged }, if the Item is damaged. { status => cannotReserveFromOtherBranches }, if syspref 'canreservefromotherbranches' is OK. @@ -327,6 +328,11 @@ sub CanItemBeReserved { if ( $item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems') ); + # Check for item on shelves and OnShelfHoldsAllowed + my $on_shelf_holds = Koha::IssuingRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); + return { status => 'onShelfHoldsNotAllowed' } + unless ( $on_shelf_holds ); + # Check for the age restriction my ( $ageRestriction, $daysToAgeRestriction ) = C4::Circulation::GetAgeRestriction( $biblio->biblioitem->agerestriction, $borrower ); --