From 78d504eb06c326e14c8a2202bac198353b5f0568 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 22 Mar 2021 10:41:33 +0000 Subject: [PATCH] Bug 28007: Replace obsolete title-string sorting: Tools templates This patch modifies several tools 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: - Tools -> Access files - You must modify koha-conf.xml to uncomment and populate the access_dirs section with a path to a directory containing some files. - Tools -> Calendar - Test the date sorting in the "Exceptions," "Yearly - Repeating holidays," and "Unique holidays" tables. - Tools -> Inventory (I wasn't able to test this because of Bug 28015). - Tools -> News - Tools -> Notices - Tools -> Batch patron modification - Tools -> OPAC problem reports - You must enable the "OPACReportProblem" system preference and submit some problem reports from the OPAC. Signed-off-by: Amit Gupta Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/access_files.tt | 4 ++-- .../prog/en/modules/tools/holidays.tt | 19 +++++++++++++------ .../prog/en/modules/tools/inventory.tt | 15 +++++++-------- .../prog/en/modules/tools/koha-news.tt | 11 +++++------ .../prog/en/modules/tools/letter.tt | 4 ++-- .../prog/en/modules/tools/modborrowers.tt | 10 +++++----- .../prog/en/modules/tools/problem-reports.tt | 4 ++-- 7 files changed, 36 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt index 3d2d9fdc68..aad8de848f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt @@ -42,7 +42,7 @@ Name Size (bytes) - Date last modified + Date last modified @@ -50,7 +50,7 @@ [% file.name | html %] [% file.size | html %] - [% file.date | $KohaDates %] + [% file.date | $KohaDates %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index 37e0f8aa0f..ca8e20c808 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -252,7 +252,11 @@ [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] - [% EXCEPTION_HOLIDAYS_LOO.DATE | html %] + + + [% EXCEPTION_HOLIDAYS_LOO.DATE | html %] + + [% EXCEPTION_HOLIDAYS_LOO.TITLE | html %] [% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | html %] @@ -301,7 +305,9 @@ [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] - [% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] + + [% DAY_MONTH_HOLIDAYS_LOO.DATE | html %] + [% DAY_MONTH_HOLIDAYS_LOO.TITLE | html %] [% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | html %] @@ -323,7 +329,11 @@ [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] - [% HOLIDAYS_LOO.DATE | html %] + + + [% HOLIDAYS_LOO.DATE | html %] + + [% HOLIDAYS_LOO.TITLE | html %] [% HOLIDAYS_LOO.DESCRIPTION.replace('\\\r\\\n', '
') | html %] @@ -510,9 +520,6 @@ })); $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, { "sDom": 't', - "aoColumns": [ - { "sType": "title-string" },null,null - ], "bPaginate": false })); $("a.helptext").click(function(){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt index a2c3aed723..5be66392a4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -239,14 +239,14 @@ [% UNLESS uploadedbarcodesflag %]Seen[% END %] Barcode - Call number + Call number Library Title Not for loan Lost Damaged Withdrawn - Last seen + Last seen Problems @@ -261,8 +261,8 @@ [% result.barcode | html %] - - [% result.itemcallnumber | html %] + + [% result.itemcallnumber | html %] [% Branches.GetName( result.homebranch ) | html %] @@ -286,8 +286,8 @@ [% result.withdrawn | html %] - - [% result.datelastseen | $KohaDates%] + + [% result.datelastseen | $KohaDates%] [% FOREACH problem IN result.problems %] @@ -397,8 +397,7 @@ // first column contains checkboxes "aoColumnDefs": [ { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, - { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] }, - { "sType": "title-string", "aTargets" : [ "title-string" ] }, + { "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] } ], // 3rd column is callnumber "aaSorting": [[ 2, "asc" ]], diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 3f1bcd009d..b9dff09cc1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -148,8 +148,8 @@ Location Library Number - Publication date - Expiration date + Publication date + Expiration date Title Author News @@ -180,8 +180,8 @@ [% ELSE %][% opac_new.branchname | html %] [% END %] [% opac_new.number | html %] - [% opac_new.newdate | $KohaDates %] - [% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](expired)[% END %] + [% opac_new.newdate | $KohaDates %] + [% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](expired)[% END %] [% opac_new.title | html %] [% opac_new.author_title | html %] [% opac_new.author_firstname | html %] [% opac_new.author_surname | html %] @@ -344,8 +344,7 @@ "order": [[ 4, "desc" ]], "aoColumnDefs": [ { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] }, - { "type": "anti-the", "targets": [ "anti-the" ] }, - { "type": "title-string", "targets" : [ "title-string"] } + { "type": "anti-the", "targets": [ "anti-the" ] } ], "sPaginationType": "full_numbers" })); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index b8b7d15885..ba2a5f426a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -179,7 +179,7 @@ Module Code Name - Last updated + Last updated Copy notice Actions @@ -214,7 +214,7 @@ [% lette.code | html %] [% lette.name | html %] - [% lette.updated_on | $KohaDates with_hours = 1 %] + [% lette.updated_on | $KohaDates with_hours = 1 %] [% IF !independant_branch || !lette.branchcode %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt index 816d5d886f..b4bd6b1a8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -159,8 +159,8 @@ Primary email Phone Mobile - Registration date - Expiry date + Registration date + Expiry date Circulation note OPAC note Restriction expiration @@ -191,11 +191,11 @@ [% borrower.email | html %] [% borrower.phone | html %] [% borrower.mobile | html %] - [% borrower.dateenrolled | $KohaDates %] - [% borrower.dateexpiry | $KohaDates %] + [% borrower.dateenrolled | $KohaDates %] + [% borrower.dateexpiry | $KohaDates %] [% borrower.borrowernotes | html %] [% borrower.opacnote | html %] - [% borrower.debarred | $KohaDates %] + [% borrower.debarred | $KohaDates %] [% borrower.debarredcomment | html %] [% FOREACH pa IN borrower.patron_attributes %] [% IF ( pa.code ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt index 33cdcfa4ac..4779f35bd8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt @@ -76,7 +76,7 @@ Message Problem page Sent to - Created on + Created on Set by Status Actions @@ -97,7 +97,7 @@ [% CASE 'library' %]A librarian [% END %] - [% report.created_on | $KohaDates with_hours => 1 %] + [% report.created_on | $KohaDates with_hours => 1 %] [% INCLUDE 'patron-title.inc' patron => report.patron hide_patron_infos_if_needed=1 %] -- 2.39.5