From c94acd279b7f509528a71dda4d1ddc7b5c0a8f9b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 18 Feb 2021 13:52:59 +0000 Subject: [PATCH] Bug 24194: (follow-up) Correct some missing instances This patch fixes some instances where hold expiration dates are set or referenced. To test, apply the patch and test the following pages with the ReserveExpiration preference both on and off to confirm that expiration dates are shown or hidden correctly. Pages in the staff interface: - Check out to a patron and check the holds tab - View patron details and check the holds tab - Patron hold history - Patron details -> Print -> Print summary - Place a hold on a title which already has at least one hold on it, check the table of existing holds. Pages in the OPAC: - Log in to the OPAC as a patron with holds - Your summary -> Holds tab - Your holds history (OPACHoldsHistory must be enabled). Signed-off-by: David Nind https://bugs.koha-community.org/show_bug.cgi?id=24914 Signed-off-by: David Nind --- .../intranet-tmpl/prog/en/includes/holds_table.inc | 12 +++++--- .../prog/en/modules/circ/circulation.tt | 1 + .../prog/en/modules/members/holdshistory.tt | 27 +++++++++++------- .../prog/en/modules/members/moremember-print.tt | 8 ++++-- .../prog/en/modules/members/moremember.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/holds.js | 5 +++- .../bootstrap/en/includes/holds-table.inc | 32 ++++++++++++---------- .../bootstrap/en/modules/opac-holdshistory.tt | 16 +++++++---- 8 files changed, 65 insertions(+), 37 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index 99a6bef496..56f2d656f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -13,7 +13,9 @@ Patron Notes Date - Expiration + [% IF Koha.Preference('ReserveExpiration') %] + Expiration + [% END %] Pickup library Details [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] @@ -113,9 +115,11 @@ [% hold.date | $KohaDates %] [% END %] - - - + [% IF Koha.Preference('ReserveExpiration') %] + + + + [% END %] [%- IF ( hold.found ) -%] [%- IF ( hold.atdestination ) -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 1196a16425..5fdb678e62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -975,6 +975,7 @@ relatives_borrowernumbers.push("[% b | html %]"); [% END %] var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %]; + var ReserveExpiration = [% ( Koha.Preference('ReserveExpiration') ) ? 1 : 0 | html %]; [% Asset.js("js/pages/circulation.js") | $raw %] [% Asset.js("js/checkouts.js") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt index bd2aad334f..b94f9aeda6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -62,9 +62,7 @@ Expiration date Waiting date Cancellation date - [% IF show_itemtype_column %] - Requested item type - [% END %] + Requested item type Status @@ -85,7 +83,6 @@ [% hold.cancellationdate | $KohaDates %] - [% IF show_itemtype_column %] [% IF hold.itemtype %] [% ItemTypes.GetDescription( hold.itemtype ) | html %] @@ -93,7 +90,6 @@ Any item type [% END %] - [% END %] [% IF hold.found == 'F' %] Fulfilled @@ -136,12 +132,23 @@ [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] [% Asset.js("js/pages/circulation.js") | $raw %] [% Asset.js("js/checkouts.js") | $raw %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index a022482bce..cf3320e54a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -194,7 +194,10 @@ $(document).ready(function() { else { return oObj.branchcode.escapeHtml() || ""; } } }, - { "data": { _: "expirationdate_formatted", "sort": "expirationdate" } }, + { + "visible": ReserveExpiration, + "data": { _: "expirationdate_formatted", "sort": "expirationdate" } + }, { "mDataProp": function( oObj ) { if ( oObj.priority && parseInt( oObj.priority ) && parseInt( oObj.priority ) > 0 ) { 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 c50958346d..5cc2196d1f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -16,7 +16,9 @@ [% ELSE %] Placed on [% END %] - Expires on + [% IF Koha.Preference('ReserveExpiration') %] + Expires on + [% END %] [% UNLESS( singleBranchMode) %] Pick up location [% END %] @@ -67,20 +69,22 @@ [% HOLD.reservedate | $KohaDates %] - [% IF ! HOLD.found %] - - [% IF ( HOLD.expirationdate ) %] - Expiration: - [% HOLD.expirationdate | $KohaDates %] - [% ELSE %] - Expiration: - Never expires - [% END %] - [% ELSE %] - - - + [% IF Koha.Preference('ReserveExpiration') %] + [% IF ! HOLD.found %] + + [% IF ( HOLD.expirationdate ) %] + Expiration: + [% HOLD.expirationdate | $KohaDates %] + [% ELSE %] + Expiration: + Never expires + [% END %] + [% ELSE %] + + - + [% END %] + [% END %] - [% UNLESS( singleBranchMode) %] Pick up location: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt index e2600b451d..a14abca9d3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt @@ -106,7 +106,9 @@ Barcode Library Hold date - Expiration date + [% IF Koha.Preference('ReserveExpiration') %] + Expiration date + [% END %] Waiting date Cancellation date [% IF show_itemtype_column %] @@ -123,11 +125,13 @@ [% hold.item.barcode | html %] [% Branches.GetName( hold.branchcode ) | html %] [% hold.reservedate | $KohaDates %] - - [% IF hold.expirationdate %] - [% hold.expirationdate | $KohaDates %] - [% END %] - + [% IF Koha.Preference('ReserveExpiration') %] + + [% IF hold.expirationdate %] + [% hold.expirationdate | $KohaDates %] + [% END %] + + [% END %] [% IF hold.waitingdate %] [% hold.waitingdate | $KohaDates %] -- 2.11.0