[Koha-patches] [PATCH] Bug 9483 - Use DataTables on batch patron modifications page

Owen Leonard oleonard at myacpl.org
Thu Jan 24 16:56:56 CET 2013


Replace the tablesorter plugin with the DataTables plugin on the
batch patron modifications page.

To test, submit multiple patron barcodes for batch modification
(Tools -> Batch patron modification). Confirm that table sorting
works correctly.
---
 .../prog/en/modules/tools/modborrowers.tt          |   21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
index 62d2eb3..3a04aa2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
@@ -3,19 +3,24 @@
 <title>Koha › Tools › Batch patron modification</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/JavaScript">
+<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
+<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
+<script type="text/javascript">
 //<![CDATA[
+    [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
         var patron_attributes_lib = new Array();
         var patron_attributes_values = new Array();
         $(document).ready(function() {
             [% IF borrowers %]
-                $("#borrowerst").tablesorter({
-                    headers: { 0: { sorter: false}},
-                    widgets : ['zebra'],
-                    sortList: [[1,0]]
-                });
-
+                $("#borrowerst").dataTable($.extend(true, {}, dataTablesDefaults, {
+                    "sDom": 't',
+                    "aoColumnDefs": [
+                        { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
+                    ],
+                    "bPaginate": false
+                }));
                 $("#selectallbutton").click(function() {
                     $("#borrowerst").find("input:checkbox").each(function() {
                         $(this).attr("checked", true);
-- 
1.7.10.4


More information about the Koha-patches mailing list