Bug 9467 - Use DataTables on catalog by item type report page
authorOwen Leonard <oleonard@myacpl.org>
Wed, 23 Jan 2013 19:21:49 +0000 (14:21 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 15 Feb 2013 13:36:10 +0000 (08:36 -0500)
Replace the tablesorter plugin with the DataTables plugin on the
catalog by item type report page.

To test, run the catalog by item type report (Reports -> Catalog by
item type). Confirm that table sorting works correctly.

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/reports/itemtypes.tt

index 6a30dc9..e18ad3e 100644 (file)
@@ -1,14 +1,22 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Reports &rsaquo; Catalog by item types</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+[% IF ( do_it ) %]
+<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[
-$(document).ready(function() {
-       $("#itemtypest").tablesorter();
+$(document).ready(function(){
+    $("#itemtypest").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sDom": 't',
+        "bPaginate": false
+    }));
 });
 //]]>
 </script>
+[% END %]
 </head>
 <body id="rep_itemtypes" class="rep">
 [% INCLUDE 'header.inc' %]