From 5706b68d1162f2afa94dc018b3cbd191fc7923e5 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 --- .../prog/en/modules/tools/access_files.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/tools/holidays.tt | 19 +++++++++++++------ .../intranet-tmpl/prog/en/modules/tools/inventory.tt | 15 +++++++-------- .../intranet-tmpl/prog/en/modules/tools/koha-news.tt | 11 +++++------ .../intranet-tmpl/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 c7c1d7c51e..037f60d523 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 @@ -28,7 +28,7 @@ Name Size (bytes) - Date last modified + Date last modified @@ -36,7 +36,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 8aefa2458f..753799a84e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -256,7 +256,11 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl [% 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 %] @@ -305,7 +309,9 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl [% 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 %] @@ -327,7 +333,11 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl [% 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 %] @@ -514,9 +524,6 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl })); $("#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 4faa432eda..1653b96cf4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -213,14 +213,14 @@ [% UNLESS uploadedbarcodesflag %]Seen[% END %] Barcode - Call number + Call number Library Title Not for loan Lost Damaged Withdrawn - Last seen + Last seen Problems @@ -235,8 +235,8 @@ [% result.barcode | html %] - - [% result.itemcallnumber | html %] + + [% result.itemcallnumber | html %] [% Branches.GetName( result.homebranch ) | html %] @@ -260,8 +260,8 @@ [% result.withdrawn | html %] - - [% result.datelastseen | $KohaDates%] + + [% result.datelastseen | $KohaDates%] [% FOREACH problem IN result.problems %] @@ -371,8 +371,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 d609997a40..b414052d7c 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 @@ -119,8 +119,8 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] Location Library Number - Publication date - Expiration date + Publication date + Expiration date Title Author News @@ -151,8 +151,8 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% 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 %] @@ -315,8 +315,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] "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 9bc75fc4ef..312494bec9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -144,7 +144,7 @@ Module Code Name - Last updated + Last updated Copy notice Actions @@ -179,7 +179,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 9147d522f9..7d9ea672c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -151,8 +151,8 @@ Primary email Phone Mobile - Registration date - Expiry date + Registration date + Expiry date Circulation note OPAC note Restriction expiration @@ -183,11 +183,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 bda67c2b47..14a67e81d3 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 @@ -65,7 +65,7 @@ Message Problem page Sent to - Created on + Created on Set by Status Actions @@ -86,7 +86,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.11.0