From 67a60c24a3e42980d62ba3272478f387ce5514a5 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 19 Mar 2021 11:38:54 +0000 Subject: [PATCH] Bug 27994: Replace obsolete title-string sorting: Reports templates This patch modifies several reports 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: - Guided reports -> Saved SQL reports - Guided reports -> Saved SQL reports -> New SQL from Mana -> Search results. - Reports -> Items lost - Reports -> Serials Signed-off-by: Amit Gupta Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../mana/mana-report-search-result.inc | 10 ++++----- .../modules/reports/guided_reports_start.tt | 21 ++++++++----------- .../prog/en/modules/reports/itemslost.tt | 8 +++---- .../prog/en/modules/reports/serials_stats.tt | 10 +++------ 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc index 49920699f4..054bd2c66b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana/mana-report-search-result.inc @@ -38,7 +38,7 @@ Notes Type # of users - Last import + Last import Comments [% UNLESS search_only %] Actions @@ -82,10 +82,8 @@ [% report.nbofusers | html %] [% END %] - - - [% report.lastimport | $KohaDates %] - + + [% report.lastimport | $KohaDates %] [% FOREACH comment IN report.comments %] @@ -124,4 +122,4 @@ -[% INCLUDE 'intranet-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 03c900ceb5..9d4bc2900d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -276,9 +276,9 @@ Subgroup Notes Author - Creation date - Last edit - Last run + Creation date + Last edit + Last run Public JSON URL [% IF (usecache) %] @@ -333,14 +333,14 @@ [% END %] ([% savedreport.borrowernumber | html %]) - - [% savedreport.date_created | $KohaDates %] + + [% savedreport.date_created | $KohaDates %] - - [% savedreport.last_modified | $KohaDates with_hours => 1 %] + + [% savedreport.last_modified | $KohaDates with_hours => 1 %] - - [% savedreport.last_run | $KohaDates with_hours => 1 %] + + [% savedreport.last_run | $KohaDates with_hours => 1 %] [% IF (savedreport.public) %] @@ -1653,8 +1653,6 @@ 'sPaginationType': 'full', 'aaSorting': [[ 1, "asc" ]], 'aoColumnDefs': [ - { 'bSearchable': false, 'aTargets': [3] }, - { "aTargets": [ 1, 2 ], "sType": "natural" }, { "visible": false, "aTargets" : [ "hidden" ] } ], 'oLanguage': { @@ -1979,7 +1977,6 @@ ], "aoColumnDefs": [ { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, - { "sType": "title-string", "aTargets" : [ "title-string" ] }, { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } ] })); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt index f6496fa904..fa803133bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt @@ -93,10 +93,10 @@ Title Author Lost status - Lost on + Lost on Barcode Call number - Date last seen + Date last seen Price Rep.price Library @@ -121,12 +121,12 @@ [% item.biblio.author | html %] [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) | html %] - [% item.itemlost_on | $KohaDates %] + [% item.itemlost_on | $KohaDates %] [% item.barcode | html %] [% item.itemcallnumber | html %] - [% item.datelastseen | $KohaDates %] + [% item.datelastseen | $KohaDates %] [% item.price | $Price %] [% item.replacementprice | $Price %] [% Branches.GetName(item.homebranch) | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt index 2bdb5278f8..675255549f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt @@ -42,7 +42,7 @@ Vendor - Title + Title Subscription ID Library Call number @@ -59,8 +59,8 @@ [% data.subscriptionid | html %] [% Branches.GetName( data.branchcode ) | html %] [% data.callnumber | html %] - [% data.startdate | $KohaDates %] - [% data.enddate | $KohaDates %] + [% data.startdate | $KohaDates %] + [% data.enddate | $KohaDates %] [% IF data.closed %] Closed @@ -159,11 +159,7 @@ -- 2.39.2