From e5b43bed8be233e417c14e6f1a605a30b3229e20 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 22 Mar 2021 16:55:13 +0000 Subject: [PATCH] Bug 28016: Replace obsolete title-string sorting: Assorted templates This patch modifies various templates to replace the use of the "title-string" DataTables sorting method with the newer "data-order" attribute. To test, apply the patch and view the following pages to confirm that columns containing dates sort correctly when using any setting of the "dateformat" system preference: - Cataloging -> Edit items - Easiest to test with an title with many items. You can follow the "Edit items" link from search results. - Tools -> Patron lists - View the contents of a patron list - Catalog -> Place hold - Locate a title with multiple items and check out each item with a different due date. - Start the process of placing a hold on that title for a patron. - On the "Place hold" screen, check the table of "specific" items and test sorting of the "Information" column by date due. - Tools -> Tags --- .../prog/en/modules/cataloguing/additem.tt | 8 ++----- .../prog/en/modules/patron_lists/list.tt | 4 ++-- .../prog/en/modules/reserve/request.tt | 28 ++++++++++------------ .../intranet-tmpl/prog/en/modules/tags/review.tt | 6 ++--- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index d4581936da..c6c83c0fab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -56,11 +56,7 @@   [% FOREACH item_header IN item_header_loop %] [% IF item_header.column_name %] - [% IF date_fields.grep(item_header.column_name).size %] - - [% ELSE %] - - [% END %] + [% ELSE %] [% END %] @@ -115,7 +111,7 @@ [% END %] [% FOREACH item_valu IN item_loo.item_value %] [% IF item_valu.datatype == 'date' %] - [% item_valu.field | $KohaDates %] + [% item_valu.field | $KohaDates %] [% ELSE %] [% item_valu.field | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt index 3a691aeb62..d2abaad8cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -126,7 +126,7 @@ Address Category Library - Expires on + Expires on Circ notes @@ -154,7 +154,7 @@ [% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %]) [% p.borrowernumber.branchcode.branchname | html %] - [% p.borrowernumber.dateexpiry | $KohaDates %] + [% p.borrowernumber.dateexpiry | $KohaDates %] [% p.borrowernumber.borrowernotes | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 5dfff18595..3e85c168f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -541,8 +541,8 @@ [% IF itemdata_enumchron %] Vol no. [% END %] - Information - Allowed pickup locations + Information + Allowed pickup locations @@ -627,17 +627,16 @@ [% itemloo.enumchron | html %] [% END %] - - [% IF ( itemloo.onloan ) %] - Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] - [% ELSE %] - - [% IF ( itemloo.transfertwhen ) %] - In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], - to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] - [% END %] - - [% END %] + [% IF ( itemloo.onloan ) %] + + Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] + [% ELSE %] + + [% IF ( itemloo.transfertwhen ) %] + In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], + to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] + [% END %] + [% END %] [% IF ( itemloo.reservedate ) %] [% IF ( itemloo.nocancel ) %] @@ -1074,9 +1073,6 @@ var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, { 'bPaginate': false, "sDom": '<"top pager"ilf>t', - "aoColumnDefs": [ - { "sType": "title-string", "aTargets" : [ "title-string" ] } - ] })); //Override fieldset styling for dataTables search box diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index 224cd0bb42..9820e8a5f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -82,7 +82,7 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Weight Actions [% UNLESS ( filter_approved_pending ) %]Reviewer[% END %] - Date + Date @@ -137,8 +137,8 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% UNLESS ( filter_approved_pending ) %] [% END %] [% END %] - - [% tagloo.date_approved | $KohaDates %] + + [% tagloo.date_approved | $KohaDates %] [% END %] -- 2.11.0