Bugzilla – Attachment 117100 Details for
Bug 24194
Add system preference to disable the use of expiration dates for holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24194: (follow-up) Correct some missing instances
Bug-24194-follow-up-Correct-some-missing-instances.patch (text/plain), 15.88 KB, created by
David Nind
on 2021-02-19 22:00:21 UTC
(
hide
)
Description:
Bug 24194: (follow-up) Correct some missing instances
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-02-19 22:00:21 UTC
Size:
15.88 KB
patch
obsolete
>From f41b7baf3b9ceb09bba2ce400f9840cc430e0be2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <david@davidnind.com> > >https://bugs.koha-community.org/show_bug.cgi?id=24914 > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../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 @@ > <th>Patron</th> > <th>Notes</th> > <th>Date</th> >- <th>Expiration</th> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <th>Expiration</th> >+ [% END %] > <th>Pickup library</th> > <th>Details</th> > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >@@ -117,7 +119,9 @@ > [% hold.date | $KohaDates %] > [% END %] > </td> >- <td><input type="text" class="datepicker futuredate" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" /></td> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <td><input type="text" class="datepicker futuredate" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" /></td> >+ [% END %] > > <td> > [% 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 %]; > </script> > [% 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 @@ > <th class="title-string">Expiration date</th> > <th class="title-string">Waiting date</th> > <th class="title-string">Cancellation date</th> >- [% IF show_itemtype_column %] >- <th>Requested item type</th> >- [% END %] >+ <th>Requested item type</th> > <th>Status</th> > </tr> > </thead> >@@ -62,13 +60,13 @@ > <td>[% hold.item.barcode | html %]</td> > <td>[% Branches.GetName( hold.branchcode ) | html %]</td> > <td><span title="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</span></td> >- <td> >- [% IF hold.expirationdate %] >- <span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span> >- [% ELSE %] >- <span title="0000-00-00"></span> >- [% END %] >- </td> >+ <td> >+ [% IF hold.expirationdate %] >+ <span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span> >+ [% ELSE %] >+ <span title="0000-00-00"></span> >+ [% END %] >+ </td> > <td> > [% IF hold.waitingdate %] > <span title="[% hold.waitingdate | html %]">[% hold.waitingdate | $KohaDates %]</span> >@@ -83,7 +81,6 @@ > <span title="0000-00-00"></span> > [% END %] > </td> >- [% IF show_itemtype_column %] > <td> > [% IF hold.itemtype %] > [% ItemTypes.GetDescription( hold.itemtype ) | html %] >@@ -91,7 +88,6 @@ > <span>Any item type</span> > [% END %] > </td> >- [% END %] > <td> > [% IF hold.found == 'F' %] > Fulfilled >@@ -134,12 +130,23 @@ > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] > <script> >+ var ReserveExpiration = [% ( Koha.Preference('ReserveExpiration') ) ? 1 : 0 | html %]; >+ var show_itemtype_column = [% ( show_itemtype_column ) ? 1 : 0 | html %]; >+ var columns_settings = [% TablesSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %]; > $(document).ready(function() { >- var columns_settings = [% TablesSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %]; >- [% UNLESS show_itemtype_column %] >- //Remove item type column settings >- columns_settings = columns_settings.filter(function(c){return c['columnname'] != 'itemtype';}); >- [% END %] >+ columns_settings.forEach(function(thisCol) { >+ if( show_itemtype_column == 0 && thisCol.columnname == "itemtype" ){ >+ thisCol.cannot_be_modified = 1; >+ thisCol.cannot_be_toggled = 1; >+ thisCol.is_hidden = 1; >+ } >+ if( ReserveExpiration == 0 && thisCol.columnname == "expirationdate" ){ >+ thisCol.cannot_be_modified = 1; >+ thisCol.cannot_be_toggled = 1; >+ thisCol.is_hidden = 1; >+ } >+ }); >+ > var table = KohaTable("table_holdshistory", { > "sPaginationType": "full", > "aaSorting": [[4, 'desc']], >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >index 14cc3bd107..8f947d5316 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt >@@ -80,7 +80,9 @@ > <th>Title</th> > <th>Author</th> > <th>Placed on</th> >- <th>Expires on</th> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <th>Expires on</th> >+ [% END %] > <th>Pick up location</th> > </tr> > >@@ -89,7 +91,9 @@ > <td>[% reserve.title | html %]</td> > <td>[% reserve.author | html %]</td> > <td>[% reserve.reservedate | $KohaDates %]</td> >- <td>[% reserve.expirationdate | $KohaDates %]</td> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <td>[% reserve.expirationdate | $KohaDates %]</td> >+ [% END %] > <td>[% reserve.waiting_at | html %]</td> > </tr> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 7b7fd26e67..7a3b29c38e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -935,6 +935,7 @@ > relatives_borrowernumbers.push("[% b | html %]"); > [% END %] > var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %]; >+ var ReserveExpiration = [% ( Koha.Preference('ReserveExpiration') ) ? 1 : 0 | html %]; > </script> > [% 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 %] > <th class="psort title-string">Placed on</th> > [% END %] >- <th class="title-string">Expires on</th> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <th class="title-string">Expires on</th> >+ [% END %] > [% UNLESS( singleBranchMode) %] > <th>Pick up location</th> > [% END %] >@@ -68,23 +70,25 @@ > [% HOLD.reservedate | $KohaDates %] > </span> > </td> >- <td class="expirationdate"> >- [% IF ! HOLD.found %] >- [% IF ( HOLD.expirationdate ) %] >- <span title="[% HOLD.expirationdate | html %]"> >- <span class="tdlabel">Expiration:</span> >- [% HOLD.expirationdate | $KohaDates %] >- </span> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <td class="expirationdate"> >+ [% IF ! HOLD.found %] >+ [% IF ( HOLD.expirationdate ) %] >+ <span title="[% HOLD.expirationdate | html %]"> >+ <span class="tdlabel">Expiration:</span> >+ [% HOLD.expirationdate | $KohaDates %] >+ </span> >+ [% ELSE %] >+ <span title="0000-00-00"> >+ <span class="tdlabel">Expiration:</span> >+ Never expires >+ </span> >+ [% END %] > [% ELSE %] >- <span title="0000-00-00"> >- <span class="tdlabel">Expiration:</span> >- Never expires >- </span> >+ <span title="0000-00-00">-</span> > [% END %] >- [% ELSE %] >- <span title="0000-00-00">-</span> >- [% END %] >- </td> >+ </td> >+ [% END %] > [% UNLESS( singleBranchMode) %] > <td class="branch"> > <span class="tdlabel">Pick up location:</span> >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 @@ > <th>Barcode</th> > <th>Library</th> > <th class="title-string">Hold date</th> >- <th class="title-string">Expiration date</th> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <th class="title-string">Expiration date</th> >+ [% END %] > <th class="title-string">Waiting date</th> > <th class="title-string">Cancellation date</th> > [% IF show_itemtype_column %] >@@ -107,13 +109,15 @@ > <td>[% hold.item.barcode | html %]</td> > <td>[% Branches.GetName( hold.branchcode ) | html %]</td> > <td><span title="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</span></td> >- <td> >- [% IF hold.expirationdate %] >- <span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span> >- [% ELSE %] >- <span title="0000-00-00"></span> >- [% END %] >- </td> >+ [% IF Koha.Preference('ReserveExpiration') %] >+ <td> >+ [% IF hold.expirationdate %] >+ <span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span> >+ [% ELSE %] >+ <span title="0000-00-00"></span> >+ [% END %] >+ </td> >+ [% END %] > <td> > [% IF hold.waitingdate %] > <span title="[% hold.waitingdate | html %]">[% hold.waitingdate | $KohaDates %]</span> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24194
:
96120
|
96121
|
98048
|
98368
|
100927
|
110082
|
110127
|
111443
|
113284
|
113285
|
116626
|
116627
|
117016
|
117085
|
117089
|
117097
|
117098
|
117099
|
117100
|
117101
|
118258
|
118259
|
118260
|
118261
|
118262
|
118263
|
128301
|
128302
|
128303
|
128304
|
128305
|
128306
|
128307
|
128308
|
140646
|
140647
|
144076
|
147527
|
147528
|
150799
|
150800
|
159060
|
159061
|
167796
|
167797
|
169174
|
174650
|
174651
|
174652