@@ -, +, @@ --- .../prog/en/modules/serials/subscription-detail.tt | 21 +++++++++++++++++++-- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 6 +++++- 2 files changed, 24 insertions(+), 3 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -334,6 +334,12 @@

Acquisition details

+ + @@ -367,7 +373,7 @@ [% END %] - +
+ + Hide already received orders + | Show all orders +
Invoice [% order.ordernumber %] [% order.basket.creationdate | $KohaDates%][% order.datereceived | $KohaDates%][% IF order.datereceived %][% order.datereceived | $KohaDates %][% END %] [% SWITCH order.orderstatus %] [% CASE 'new' %]New @@ -424,7 +430,7 @@ return false; }) - $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { + var table = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { 'bPaginate': false, 'bAutoWidth': false, "aaSorting": [[ 4, "desc" ]], @@ -433,6 +439,17 @@ ] })); + $("#hide_received_orders").click(function(e){ + e.preventDefault(); + table.fnFilter( '.', 4, true ); // Not empty "Receive date" columns + }); + $("#show_all_orders").click(function(e){ + e.preventDefault(); + table.fnFilter( '', 4 ); // Not filter, display all columns + }); + $("#show_all_orders").click(); + + }); [% END %] --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ a/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -371,7 +371,11 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "title-string-pre": function ( a ) { - return a.match(/title="(.*?)"/)[1].toLowerCase(); + var m = a.match(/title="(.*?)"/); + if ( null !== m && m.length ) { + return m[1].toLowerCase(); + } + return ""; }, "title-string-asc": function ( a, b ) { --