[Koha-patches] [PATCH] Bug 9461 - Use DataTables on holds awaiting pickup report page

Owen Leonard oleonard at myacpl.org
Wed Jan 23 17:45:08 CET 2013


Replace the tablesorter plugin with the DataTables plugin on the
holds awaiting pickup report page.

To test, open the holds awaiting pickup report (Circulation
-> Holds awaiting pickup). Confirm that table sorting works correctly on
all tables.
---
 .../prog/en/modules/circ/waitingreserves.tt        |   30 +++++++++++---------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
index cb18a4a..19eabb8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
@@ -1,24 +1,26 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha › Circulation › Holds awaiting pickup</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() {
          $('#resultlist').tabs();
          $("th a").hide();
-         $.tablesorter.defaults.widgets = ['zebra'];
-         $("#holdst,#holdso").tablesorter({[% IF ( dateformat == 'metric' ) %]
-            dateFormat: 'uk',[% END %]
-            sortList: [[3,0]],
-            headers: { 1:{sorter:'articles'},3: { sorter: 'articles' },4:{sorter:false}}
-        }); 
+        $("#holdst,#holdso").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "aoColumnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+            ],
+            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
+            "iDisplayLength": 20,
+            "sPaginationType": "four_button"
+        }));
       });
 //]]>
 </script>
-- 
1.7.9.5


More information about the Koha-patches mailing list