From d3f9cba90d754ab16cea9ad5f51a4c9c4a3e72a5 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). --- .../intranet-tmpl/prog/en/includes/holds_table.inc | 8 +++-- .../prog/en/modules/circ/circulation.tt | 1 + .../prog/en/modules/members/holdshistory.tt | 41 +++++++++++++--------- .../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 | 36 ++++++++++--------- .../bootstrap/en/modules/opac-holdshistory.tt | 20 ++++++----- 8 files changed, 74 insertions(+), 46 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 59f33cd2a0..7733578484 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -12,7 +12,9 @@ Patron Notes Date - Expiration + [% IF Koha.Preference('ReserveExpiration') %] + Expiration + [% END %] Pickup library Details [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] @@ -117,7 +119,9 @@ [% hold.date | $KohaDates %] [% END %] - + [% IF Koha.Preference('ReserveExpiration') %] + + [% END %] [% IF ( hold.found ) %] 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 a4f7369bb2..4ea5dce1ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1094,6 +1094,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 5efdf309d6..d1ebf063de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -48,9 +48,7 @@ Expiration date Waiting date Cancellation date - [% IF show_itemtype_column %] - Requested item type - [% END %] + Requested item type Status @@ -62,13 +60,13 @@ [% hold.item.barcode | html %] [% Branches.GetName( hold.branchcode ) | html %] [% hold.reservedate | $KohaDates %] - - [% IF hold.expirationdate %] - [% hold.expirationdate | $KohaDates %] - [% ELSE %] - - [% END %] - + + [% IF hold.expirationdate %] + [% hold.expirationdate | $KohaDates %] + [% ELSE %] + + [% END %] + [% IF hold.waitingdate %] [% hold.waitingdate | $KohaDates %] @@ -83,7 +81,6 @@ [% END %] - [% IF show_itemtype_column %] [% IF hold.itemtype %] [% ItemTypes.GetDescription( hold.itemtype ) | html %] @@ -91,7 +88,6 @@ Any item type [% END %] - [% END %] [% IF hold.found == 'F' %] Fulfilled @@ -134,12 +130,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 134194bbfd..8bea643e93 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -100,7 +100,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 78735ba4a0..3c4a433789 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 %] @@ -68,23 +70,25 @@ [% HOLD.reservedate | $KohaDates %] - - [% IF ! HOLD.found %] - [% IF ( HOLD.expirationdate ) %] - - Expiration: - [% HOLD.expirationdate | $KohaDates %] - + [% IF Koha.Preference('ReserveExpiration') %] + + [% IF ! HOLD.found %] + [% IF ( HOLD.expirationdate ) %] + + Expiration: + [% HOLD.expirationdate | $KohaDates %] + + [% ELSE %] + + Expiration: + Never expires + + [% END %] [% 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 a684a304e7..fae4ae244d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt @@ -90,7 +90,9 @@ Barcode Library Hold date - Expiration date + [% IF Koha.Preference('ReserveExpiration') %] + Expiration date + [% END %] Waiting date Cancellation date [% IF show_itemtype_column %] @@ -107,13 +109,15 @@ [% hold.item.barcode | html %] [% Branches.GetName( hold.branchcode ) | html %] [% hold.reservedate | $KohaDates %] - - [% IF hold.expirationdate %] - [% hold.expirationdate | $KohaDates %] - [% ELSE %] - - [% END %] - + [% IF Koha.Preference('ReserveExpiration') %] + + [% IF hold.expirationdate %] + [% hold.expirationdate | $KohaDates %] + [% ELSE %] + + [% END %] + + [% END %] [% IF hold.waitingdate %] [% hold.waitingdate | $KohaDates %] -- 2.11.0