From 95c3ed60c90ecc5be9a604d06d7a1d7ab39b9643 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Jan 2021 13:44:33 +0100 Subject: [PATCH] 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 Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 01985605434b7b78cb8f234f8ea66e0a16b3f8c5) Signed-off-by: Lucas Gass (cherry picked from commit e1caed6c63d9a831e332ccee32123a591ae2b7e1) Signed-off-by: Arthur Suzuki --- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 10 +++++++++- opac/opac-reserve.pl | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 930c2bf75b..79b68f7a36 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -202,8 +202,16 @@ [% IF ( bibitemloo.already_reserved ) %]
You have already requested this title.
[% ELSE %] - [% IF ( bibitemloo.already_patron_possession ) %] + [% IF bibitemloo.alreadypossession %]
This title cannot be requested because it's already in your possession.
+ [% ELSIF bibitemloo.tooManyReserves %] +
This title cannot be requested because you reached the maximum number of holds.
+ [% ELSIF bibitemloo.tooManyHoldsForThisRecord %] +
This title cannot be requested because you exceeded max holds per record.
+ [% ELSIF bibitemloo.tooManyReservesToday %] +
This title cannot be requested because you reached the daily hold limit.
+ [% ELSIF bibitemloo.itemAlreadyOnHold %] +
This title cannot be requested because you already have hold for this item.
[% ELSE %] [% UNLESS ( bibitemloo.bib_available ) %]
There are no items that can be placed on hold.
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index d6ba57fc9d..48b661e5f3 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -634,7 +634,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 -- 2.39.5