[Koha-patches] [PATCH] Bug 8971 - Sort holds queue report using DataTables

Owen Leonard oleonard at myacpl.org
Thu Oct 25 18:53:34 CEST 2012


Replacing the old tablesorter plugin with DataTables on
this page will fix sorting bugs related to whitespace and
markup in table cells which tablesorter couldn't handle.

I have also taken the liberty of changing the default sort
from patron to call number, assuming that the librarian
uses this list to pull items from the shelf, and the shelf
is organized by call number.
---
 .../prog/en/modules/circ/view_holdsqueue.tt        |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
index d8d8536..aefd8d9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
@@ -6,13 +6,21 @@
 <body id="circ_view_holdsqueue" class="circ">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
-
-<script type="text/javascript" src="[% ( themelang ) %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<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() {
-        $("#holdst").tablesorter({
-                sortList: [[6,0]],
-        });
+    $("#holdst").dataTable({
+        "aaSorting": [[ 2, "asc" ]],
+        "bPaginate": false,
+        "bLengthChange": false,
+        "bFilter": false,
+        "bSort": true,
+        "bInfo": false,
+        "bAutoWidth": false
+    });
 });
 //]]>
 </script>
-- 
1.7.9.5


More information about the Koha-patches mailing list