From a267a436273ee3a87801780311b3db79a3687111 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 16 Apr 2014 14:32:24 -0400 Subject: [PATCH] Bug 12089 - Remove use of dt_add_type_uk_date() - Budgets Content-Type: text/plain; charset="utf-8" This patch removes use of dt_add_type_uk_date() from the budgets administration page and updates the sorting configuration according to current guidelines. Date sorting is converted to the title-string method. Invalid "align" attribute is replaced with a class. Also corrected: Active tab selection based on class. To test, go to Administration -> Budgets and confirm that sorting works correctly on both the active and inactive budget tabs. Sorting by date should work correctly regardless of dateformat system preference. To test tab selection, append "?tab=2" to the page URL and confirm that the inactive budget tab is selected. --- .../prog/en/modules/admin/aqbudgetperiods.tt | 44 +++++++------------- 1 file changed, 16 insertions(+), 28 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 453da0e..060c450 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -72,31 +72,19 @@ } } - - - [% IF ( dateformat == 'metric' ) %] - dt_add_type_uk_date(); - [% END %] $(document).ready(function() { var tabs = $('#budgetsTabs').tabs(); [% IF ( tab ) %] - tabs.tabs('select', [% tab %]); + tabs.tabs("option", "active", [% tab %]); [% END %] $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { + "sDom": 't', + "aaSorting": [], "aoColumnDefs": [ - { - [% IF ( dateformat == 'metric' ) %] - "aTargets": [ 1, 2 ], "sType": "uk_date", - [% END %] - "bSortable": false, 'aTargets':['_all'], - }, + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, + { "sType": "title-string", "aTargets" : [ "title-string" ] } ], - "sPaginationType": "four_button", - "sDom": 't', - "bAutoWidth": false, - "bPaginate": false, - "bInfo": false, - "bFilter": false, + "bPaginate": false } ) ); }); @@ -329,8 +317,8 @@ Budget name - Start date - End date + Start date + End date Locked Total Actions @@ -340,14 +328,14 @@ [% FOREACH period_active IN period_active_loop %] [% period_active.budget_period_description %] - [% period_active.budget_period_startdate | $KohaDates %] - [% period_active.budget_period_enddate | $KohaDates %] + [% period_active.budget_period_startdate | $KohaDates %] + [% period_active.budget_period_enddate | $KohaDates %] [% IF ( period_active.budget_period_locked ) %] Locked  [% END %] - [% period_active.budget_period_total %] + [% period_active.budget_period_total %] Edit Delete @@ -368,8 +356,8 @@ Budget name - Start date - End date + Start date + End date Locked Total Actions @@ -383,10 +371,10 @@ [% END %] [% period_loo.budget_period_description %] - [% period_loo.budget_period_startdate | $KohaDates %] - [% period_loo.budget_period_enddate | $KohaDates %] + [% period_loo.budget_period_startdate | $KohaDates %] + [% period_loo.budget_period_enddate | $KohaDates %] [% IF ( period_loo.budget_period_locked ) %]Locked [% ELSE %][% END %] - [% period_loo.budget_period_total %] + [% period_loo.budget_period_total %] Edit Delete -- 1.7.9.5