my $dat = GetBiblioData($biblionumber);
- unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
- $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;
+ }
my $alreadypossession;
if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) {
my $alreadyreserved = 0;
foreach my $res (@$reserves) {
- if ( defined $res->{found} ) {
+ if ( defined $res->{found} ) { # found can be 'W' or 'T'
$count--;
}
&& IsAvailableForItemLevelRequest($itemnumber)
&& CanItemBeReserved(
$borrowerinfo->{borrowernumber}, $itemnumber
- )
+ ) eq 'OK'
)
{
$item->{available} = 1;