Bug 9460 - Use DataTables on transfers to receive report page
authorOwen Leonard <oleonard@myacpl.org>
Wed, 23 Jan 2013 16:18:09 +0000 (11:18 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 15 Feb 2013 13:47:43 +0000 (08:47 -0500)
Replace the tablesorter plugin with the DataTables plugin on the
transfers to receive report page.

To test, open the transfers to receive report page (Circulation ->
Transfers to receive). Confirm that table sorting works correctly on
each of the tables. In this configuration there is no filtering or
pagination.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt

index 6542ac3..9059f94 100644 (file)
@@ -1,23 +1,24 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Transfers to your library</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/javascript" language="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[
-$.tablesorter.addParser({
-    id: 'articles',
-    is: function(s) {return false;  },
-    format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
-    type: 'text'
-});
+[% IF (dateformat == 'metric') %]
+dt_add_type_uk_date();
+[% END %]
 $(document).ready(function() {
     [% FOREACH branchesloo IN branchesloop %]
-    $.tablesorter.defaults.widgets = ['zebra'];
-    $("#transferst[% branchesloo.branchcode %]").tablesorter({[% IF ( dateformat_metric ) %]
-        dateFormat: 'uk',[% END %]
-        sortList: [[0,0]],
-        headers: { 1: { sorter: 'articles' }}
-    });
+    $("#transferst[% branchesloo.branchcode %]").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sDom": 't',
+        "bPaginate": false
+    }));
     [% END %]
 });
 //]]>