@@ -, +, @@ and is missing data message should end "...cannot place holds on some of these titles' items" --- C4/Reserves.pm | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 7 ++++++- reserve/request.pl | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -421,6 +421,9 @@ sub CanItemBeReserved { } # we check if it's ok or not + if( $allowedreserves == 0 ){ + return 'noReservesAllowed'; + } if ( $reservecount >= $allowedreserves ) { return { status => 'tooManyReserves', limit => $allowedreserves }; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -108,7 +108,9 @@ [% UNLESS ( multi_hold ) %]

Cannot place hold

[% ELSE %]

Cannot place hold on some items

+ [% IF ( no_reserves_allowed) %] +
  • No holds allowed: [% borrowerfirstname %] [% borrowersurname %] cannot place holds on some of these title's items.
  • + [% END %] [% IF ( exceeded_maxreserves ) %]
  • Too many holds: [% patron.firstname | html %] [% patron.surname | html %] can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.
  • [% ELSIF ( exceeded_holds_per_record ) %] --- a/reserve/request.pl +++ a/reserve/request.pl @@ -162,6 +162,8 @@ if ($borrowernumber_hold && !$action) { my $new_reserves_count = scalar( @biblionumbers ); my $maxreserves = C4::Context->preference('maxreserves'); + $template->param( maxreserves => $maxreserves ); + if ( $maxreserves && ( $reserves_count + $new_reserves_count > $maxreserves ) ) { @@ -217,6 +219,7 @@ if ($patron) { my $itemdata_enumchron = 0; my $itemdata_ccode = 0; my @biblioloop = (); +my $no_reserves_allowed = 0; foreach my $biblionumber (@biblionumbers) { next unless $biblionumber =~ m|^\d+$|; @@ -232,7 +235,10 @@ foreach my $biblionumber (@biblionumbers) { #All is OK and we can continue } - elsif ( $canReserve->{status} eq 'tooManyReserves' ) { + elsif ( $canReserve eq 'noReservesAllowed') { + $no_reserves_allowed = 1; + } + elsif ( $canReserve eq 'tooManyReserves' ) { $exceeded_maxreserves = 1; $template->param( maxreserves => $canReserve->{limit} ); } @@ -662,6 +668,7 @@ foreach my $biblionumber (@biblionumbers) { $template->param( biblioloop => \@biblioloop ); $template->param( biblionumbers => $biblionumbers ); +$template->param( no_reserves_allowed => $no_reserves_allowed ); $template->param( exceeded_maxreserves => $exceeded_maxreserves ); $template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); $template->param( subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber)); --