From e5b8db503627e15aa67b14456a79c45569650195 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 --- .../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 4992069..054bd2c 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 c2c3138..6482caf 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 6b1abc4..dc46709 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 91cb513..e938a05 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.7.4