From c813958e91276b2348a56750a48c4a91b94d95a8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 19 Mar 2019 14:43:52 +0000 Subject: [PATCH] Bug 22537: Suspend all hold button appears even if the hold can no longer be suspended. This patch adds to the user summary page in the OPAC a check for waiting or in-transit holds. If all holds are waiting or in transit the "Suspend all" controls will be hidden. This patch also adds a missing $KohaDates filter to the "suspended until" date. To test, apply the patch and log in to the OPAC as a patron with holds. Test these conditions: - All holds are waiting and/or in transit - The "Suspend holds" controls at the bottom of the page should not appear. - Some holds are waiting and/or in transit - The "Suspend holds" controls should appear. Signed-off-by: Marjorie --- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 46 ++++++++++++---------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 7c55d8d..c3c95a8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -626,7 +626,11 @@ + [% SET all_holds_waiting = 1 %] [% FOREACH RESERVE IN RESERVES %] + [% UNLESS ( RESERVE.is_waiting || RESERVE.is_in_transit ) %] + [% SET all_holds_waiting = 0 %] + [% END %] [% IF ( RESERVE.is_waiting ) %] [% IF ( RESERVE.is_at_destination ) %] [% IF ( RESERVE.is_found ) %] @@ -710,7 +714,7 @@ Item in transit from [% Branches.GetName( transfer.frombranch ) | html %] since [% transfer.datesent | $KohaDates %] [% ELSIF ( RESERVE.suspend ) %] - Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until | html %] [% END %] + Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until | $KohaDates %] [% END %] [% ELSE %] [% IF RESERVE.itemtype %] Pending for next available item of item type '[% ItemTypes.GetDescription( RESERVE.itemtype ) | html %]' @@ -780,25 +784,27 @@ [% IF SuspendHoldsOpac %] -
-
- - - - [% IF AutoResumeSuspendedHolds %] - - - Clear date to suspend indefinitely - [% END %] -
-
-
-
-
- - -
-
+ [% UNLESS ( all_holds_waiting ) %] +
+
+ + + + [% IF AutoResumeSuspendedHolds %] + + + Clear date to suspend indefinitely + [% END %] +
+
+
+
+
+ + +
+
+ [% END %] [% END %] [% END # / #RESERVES.count %] -- 2.7.4