Bug 11555: Make "All" one of the default options for datatables
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 14 Jan 2014 15:37:09 +0000 (10:37 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 10 Mar 2014 18:49:33 +0000 (18:49 +0000)
There are many instances where librarians would like to have the ability
to see all the rows in a datatable at one. It seems prudent to make this
a default option for datatables, rather than change it on a case by case
basis.

Test Plan:
1) View the circulation history for a patron
2) Note you can select to view 10, 25, 50, or 100 entries
3) Apply this patch
4) Reload the circulation history page for a patron
5) Note the new "All" option
6) Verify the "All" option shows all the rows at once

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I tested the translation for "All"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/includes/datatables-strings.inc
koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc
koha-tmpl/intranet-tmpl/prog/en/js/datatables.js

index 7e939fc..ead071b 100644 (file)
@@ -13,6 +13,7 @@
     var MSG_DT_PROCESSING = _("Processing...");
     var MSG_DT_SEARCH = _("Search:");
     var MSG_DT_ZERO_RECORDS = _("No matching records found");
+    var MSG_DT_ALL = _("All");
     var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the");
 //]]>
 </script>
index 703d1e3..44d8277 100644 (file)
@@ -14,7 +14,8 @@
     var MSG_DT_PROCESSING = _("Processing...");
     var MSG_DT_SEARCH = _("Search:");
     var MSG_DT_ZERO_RECORDS = _("No matching records found");
+    var MSG_DT_ALL = _("All");
     var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the");
 //]]>
 </script>
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
\ No newline at end of file
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
index c2a2cf8..cc809c1 100644 (file)
@@ -23,7 +23,8 @@ var dataTablesDefaults = {
         "sSearch"           : window.MSG_DT_SEARCH || "Search:",
         "sZeroRecords"      : window.MSG_DT_ZERO_RECORDS || "No matching records found"
     },
-    "sDom": '<"top pager"ilpf>t<"bottom pager"ip>'
+    "sDom": '<"top pager"ilpf>t<"bottom pager"ip>',
+    "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, window.MSG_DT_ALL || "All"]]
 };