From 3d022dc20ea34ba5fb2d37f7399b6d07be3cdea8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 26 Apr 2019 13:55:31 +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 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../bootstrap/en/includes/holds-table.inc | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc index e96a73caa0..b3bb1cf729 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -32,7 +32,11 @@ + [% SET all_holds_waiting = 1 %] [% FOREACH HOLD IN HOLDS %] + [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit ) %] + [% SET all_holds_waiting = 0 %] + [% END %] [% IF ( HOLD.is_waiting ) %] [% IF ( HOLD.is_at_destination ) %] [% IF ( HOLD.is_found ) %] @@ -127,7 +131,7 @@ Item in transit from [% Branches.GetName( transfer.frombranch ) | html %] since [% transfer.datesent | $KohaDates %] [% ELSIF ( HOLD.suspend ) %] - Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | html %] [% END %] + Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %] [% ELSE %] [% IF HOLD.itemtype %] Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]' @@ -199,25 +203,27 @@ [% IF SuspendHoldsOpac and ! onlyinfo %] -
-
- - + [% UNLESS ( all_holds_waiting ) %] +
+ + + - [% IF AutoResumeSuspendedHolds %] - - - Clear date to suspend indefinitely - [% END %] - -
-
-
-
- - -
-
+ [% IF AutoResumeSuspendedHolds %] + + + Clear date to suspend indefinitely + [% END %] + +
+
+
+
+ + +
+
+ [% END %] [% END %] [% END # / #HOLDS.count %] -- 2.39.5