From 18b026723388593cd858beb5e3fcaf29cc5ccd5f 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 --- .../en/includes/mana/mana-report-search-result.inc | 10 ++++------ .../prog/en/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 c2c3138d94..6482caf36b 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 @@ -228,9 +228,9 @@ Subgroup Notes Author - Creation date - Last edit - Last run + Creation date + Last edit + Last run Public JSON URL [% IF (usecache) %] @@ -285,14 +285,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) %] @@ -1605,8 +1605,6 @@ 'sPaginationType': 'full', 'aaSorting': [[ 1, "asc" ]], 'aoColumnDefs': [ - { 'bSearchable': false, 'aTargets': [3] }, - { "aTargets": [ 1, 2 ], "sType": "natural" }, { "visible": false, "aTargets" : [ "hidden" ] } ], 'oLanguage': { @@ -1931,7 +1929,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 6b1abc4436..dc46709a9e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt @@ -67,10 +67,10 @@ Title Author Lost status - Lost on + Lost on Barcode Call number - Date last seen + Date last seen Price Rep.price Library @@ -95,12 +95,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 91cb513b34..e938a055cc 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 @@ -28,7 +28,7 @@ Vendor - Title + Title Subscription ID Library Call number @@ -45,8 +45,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 @@ -145,11 +145,7 @@ -- 2.11.0