From 0936defa56bc4188f91ed01ee372d70e4203a642 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 21 Mar 2013 09:31:39 -0400 Subject: [PATCH] Bug 9882 - Use DataTables on batch modifications pages The batch modification pages (edit and delete) use the old tablesorter plugin. They should use DataTables instead. This patch makes the following changes: - Remove tablesorter plugin from batchMod.tt where it was unused. - Replace tablesorter assets with DataTables assets on batch edit and batch delete pages. - Replace tablesorter code with DataTables code in batchMod.js, which provides table sorting functionality for both batch templates. - Move position of batchMod.js script inclusion so that DataTables assets are loaded first. - Remove inline table sorting code from batch edit page since it is provided by batchMod.js To test, load barcodes on both the batch edit and batch delete pages. Test JavaScript-based functionality on each results page: - Check/Uncheck all - Hide/show columns - Table sorting on a variety of different kinds of data columns Batch operations should complete normally. There should be no JavaScript error on the batch operation "landing page" (batchMod.tt). Signed-off-by: Melia Meggs Signed-off-by: Katrin Fischer All tests and QA script pass. Checked both patches, no problems found. Signed-off-by: Jared Camins-Esakov --- koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js | 11 +++++++---- .../prog/en/modules/tools/batchMod-del.tt | 7 +++++-- .../prog/en/modules/tools/batchMod-edit.tt | 8 +++++--- .../intranet-tmpl/prog/en/modules/tools/batchMod.tt | 9 --------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js index ed0d92fb2b..73be545212 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js @@ -97,10 +97,13 @@ function hideAllColumns(){ $(document).ready(function() { hideColumns(); - $("#itemst").tablesorter({ - widgets : ['zebra'], - headers: {0:{sorter: false}} - }); + $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, { + "sDom": 't', + "aoColumnDefs": [ + { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false } + ], + "bPaginate": false + })); $("#selectallbutton").click(function(){ $("#itemst").checkCheckboxes(); return false; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt index e3f6b296bb..32aeb955c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt @@ -3,7 +3,11 @@ [% INCLUDE 'doc-head-close.inc' %] - + + + +[% INCLUDE 'datatables-strings.inc' %] + - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt index c65277aeff..d4b5e103e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -4,7 +4,11 @@ - + + + +[% INCLUDE 'datatables-strings.inc' %] + - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt index df6fa57c10..131991300d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt @@ -1,15 +1,6 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › [% IF ( del ) %]Batch item deletion[% ELSE %]Batch item modification[% END %] [% INCLUDE 'doc-head-close.inc' %] - - [% INCLUDE 'header.inc' %] -- 2.39.5