Bug 19540: Tell the patron why a hold cannot be placed on items

This patch adds an explanation when a hold cannot be placed, in some situation:
tooManyReserves
tooManyHoldsForThisRecord
tooManyReservesToday
itemAlreadyOnHold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0198560543)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2021-01-07 13:44:33 +01:00 committed by Lucas Gass
parent 396fc44e2c
commit e1caed6c63
2 changed files with 10 additions and 2 deletions

View File

@ -203,8 +203,16 @@
[% ELSIF ( bibitemloo.recall ) %]
<div class="alert alert-warning">You have already placed a recall on this title.</div>
[% ELSE %]
[% IF ( bibitemloo.already_patron_possession ) %]
[% IF bibitemloo.alreadypossession %]
<div class="alert alert-warning">This title cannot be requested because it's already in your possession.</div>
[% ELSIF bibitemloo.tooManyReserves %]
<div class="alert alert-warning">This title cannot be requested because you reached the maximum number of holds.</div>
[% ELSIF bibitemloo.tooManyHoldsForThisRecord %]
<div class="alert alert-warning">This title cannot be requested because you exceeded max holds per record.</div>
[% ELSIF bibitemloo.tooManyReservesToday %]
<div class="alert alert-warning">This title cannot be requested because you reached the daily hold limit.</div>
[% ELSIF bibitemloo.itemAlreadyOnHold %]
<div class="alert alert-warning">This title cannot be requested because you already have hold for this item.</div>
[% ELSE %]
[% UNLESS ( bibitemloo.bib_available ) %]
<div class="alert">There are no items that can be placed on hold.</div>

View File

@ -632,7 +632,7 @@ foreach my $biblioNum (@biblionumbers) {
my $status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status};
$biblioLoopIter{holdable} &&= $status eq 'OK';
$biblioLoopIter{already_patron_possession} = $status eq 'alreadypossession';
$biblioLoopIter{$status} = 1;
if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) {
# build the allowed item types loop