From a0fcd8140cd4153bb54c729a7351aadbbf86a743 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 21 Mar 2013 09:31:39 -0400 Subject: [PATCH] [Signed off] 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 --- .../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 +++++--- .../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 ed0d92f..73be545 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 e3f6b29..32aeb95 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 c65277a..d4b5e10 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 df6fa57..1319913 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' %] -- 1.7.2.5