From 89db57924dde3eccfdb95c4959519ab912dc4fa6 Mon Sep 17 00:00:00 2001 From: Owen Leonard <oleonard@myacpl.org> Date: Wed, 17 Mar 2021 18:27:16 +0000 Subject: [PATCH] Bug 27975: Replace obsolete title-string sorting: Administration templates This patch modifies two administration 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: - Administration -> Currencies and exchange rates - Administration -> Budgets - Both the "Active budgets" and "Inactive budgets" tabs Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> --- .../prog/en/modules/admin/aqbudgetperiods.tt | 17 ++++++++--------- .../prog/en/modules/admin/currency.tt | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 092b14d439..0468751cd0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -426,8 +426,8 @@ <thead> <tr> <th>Budget name</th> - <th class="title-string">Start date</th> - <th class="title-string">End date</th> + <th>Start date</th> + <th>End date</th> <th>Locked</th> <th>Total</th> <th class="noExport">Actions</th> @@ -437,8 +437,8 @@ [% FOREACH period_active IN period_active_loop %] <tr> <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id | uri %]" title="View funds for [% period_active.budget_period_description | html %]">[% period_active.budget_period_description | html %]</a></td> - <td><span title="[% period_active.budget_period_startdate | html %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td> - <td><span title="[% period_active.budget_period_enddate | html %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td> + <td data-order="[% period_active.budget_period_startdate | html %]">[% period_active.budget_period_startdate | $KohaDates %]</td> + <td data-order="[% period_active.budget_period_enddate | html %]">[% period_active.budget_period_enddate | $KohaDates %]</td> <td> [% IF ( period_active.budget_period_locked ) %] <i class="fa fa-lock"></i> Locked</span> @@ -462,8 +462,8 @@ <thead> <tr> <th>Budget name</th> - <th class="title-string">Start date</th> - <th class="title-string">End date</th> + <th>Start date</th> + <th>End date</th> <th>Locked</th> <th>Total</th> <th class="noExport">Actions</th> @@ -473,8 +473,8 @@ [% FOREACH period_loo IN period_inactive_loop %] <tr> <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id | uri %]" title="View funds for [% period_loo.budget_period_description | html %]">[% period_loo.budget_period_description | html %]</a></td> - <td><span title="[% period_loo.budget_period_startdate | html %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td> - <td><span title="[% period_loo.budget_period_enddate | html %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td> + <td data-order="[% period_loo.budget_period_startdate | html %]">[% period_loo.budget_period_startdate | $KohaDates %]</td> + <td data-order="[% period_loo.budget_period_enddate | html %]">[% period_loo.budget_period_enddate | $KohaDates %]</td> <td>[% IF ( period_loo.budget_period_locked ) %]<i class="fa fa-lock"></i> Locked[% END %]</td> <td class="data">[% period_loo.budget_period_total | $Price %]</td> <td> @@ -517,7 +517,6 @@ $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, - { "sType": "title-string", "aTargets" : [ "title-string" ] } ], "sPaginationType": "full", 'bAutoWidth': false diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt index e427c76f7a..75ffae5d02 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt @@ -180,7 +180,7 @@ <th>Rate</th> <th>Symbol</th> <th>ISO code</th> - <th class="title-string">Last updated</th> + <th>Last updated</th> <th>Active</th> <th>Archived</th> <th class="NoSort noExport">Actions</th> @@ -193,7 +193,7 @@ <td>[% currency.rate | html %]</td> <td>[% currency.symbol | html %]</td> <td>[% currency.isocode | html %]</td> - <td><span title="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</span></td> + <td data-order="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</td> <td style="color:green;">[% IF currency.active %]✓[% END %]</td> <td>[% IF currency.archived %]Yes[% END %]</td> <td class="actions"> -- 2.20.1