@@ -, +, @@ --- C4/Reserves.pm | 6 +++--- opac/opac-reserve.pl | 13 +++++-------- reserve/request.pl | 27 ++++++++++++++------------- 3 files changed, 22 insertions(+), 24 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -465,9 +465,9 @@ sub CanBookBeReserved{ push (@$items,@hostitems); } - my $canReserve; - foreach my $item (@$items){ - $canReserve = CanItemBeReserved($borrowernumber, $item); + my $canReserve; + foreach my $item (@$items) { + $canReserve = CanItemBeReserved( $borrowernumber, $item ); return 'OK' if $canReserve eq 'OK'; } return $canReserve; --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -548,14 +548,11 @@ foreach my $biblioNum (@biblionumbers) { if ($biblioLoopIter{already_reserved}) { $biblioLoopIter{holdable} = undef; } - my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); - if ($canReserve eq 'OK') { - #All is OK! - } - else { - $biblioLoopIter{holdable} = undef; - $biblioLoopIter{ $canReserve } = 1; - } + my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); + unless ($canReserve eq 'OK') { + $biblioLoopIter{holdable} = undef; + $biblioLoopIter{ $canReserve } = 1; + } if(not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowernumber,$biblioNum)) { $biblioLoopIter{holdable} = undef; $biblioLoopIter{already_patron_possession} = 1; --- a/reserve/request.pl +++ a/reserve/request.pl @@ -191,20 +191,21 @@ foreach my $biblionumber (@biblionumbers) { my $dat = GetBiblioData($biblionumber); - my $canReserve = CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber); - if ($canReserve eq 'OK') { - #All is OK and we can continue - } - elsif ( $canReserve eq 'tooManyReserves' ) { - $maxreserves = 1; + my $canReserve = CanBookBeReserved( $borrowerinfo->{borrowernumber}, $biblionumber ); + if ( $canReserve eq 'OK' ) { + + #All is OK and we can continue + } + elsif ( $canReserve eq 'tooManyReserves' ) { + $maxreserves = 1; + } + elsif ( $canReserve eq 'ageRestricted' ) { + $template->param( $canReserve => 1 ); + $biblioloopiter{$canReserve} = 1; + } + else { + $biblioloopiter{$canReserve} = 1; } - elsif ( $canReserve eq 'ageRestricted' ) { - $template->param( $canReserve => 1 ); - $biblioloopiter{ $canReserve } = 1; - } - else { - $biblioloopiter{ $canReserve } = 1; - } my $alreadypossession; if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) { --