From 80a933ce34a50fca9b2317fea93a110e9be6d188 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 25 Mar 2014 11:26:26 +0100 Subject: [PATCH] [PASSED QA] Bug 11425: Add filter on items.notforloan column and display the 'Processing ...' box when datatables is loading new data. Signed-off-by: Bernardo Gonzalez Kriegel Nice box Signed-off-by: Kyle M Hall --- catalogue/itemsearch.pl | 4 ++-- .../prog/en/modules/catalogue/itemsearch.tt | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index cb025a5..280f35a 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -54,7 +54,7 @@ if (defined $format and $format eq 'json') { my @c = $cgi->param('c'); foreach my $i (0 .. ($cgi->param('iColumns') - 1)) { my $sSearch = $cgi->param("sSearch_$i"); - if ($sSearch) { + if (defined $sSearch and $sSearch ne '') { my @words = split /\s+/, $sSearch; foreach my $word (@words) { push @f, $columns[$i]; @@ -98,7 +98,7 @@ if (scalar keys %params > 0) { filters => [], }; - foreach my $p (qw(homebranch location itype ccode issues datelastborrowed)) { + foreach my $p (qw(homebranch location itype ccode issues datelastborrowed notforloan)) { if (my @q = $cgi->param($p)) { if ($q[0] ne '') { my $f = { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index d967b36..877673a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -22,7 +22,7 @@ [% empty_option || "All" %] [% FOREACH option IN options %] - [% IF values.grep(option.value).size %] + [% IF values != '' && values.grep(option.value).size %] [% ELSE %] @@ -210,6 +210,7 @@ $('#results').dataTable($.extend(true, {}, dataTablesDefaults, { 'bDestroy': true, 'bServerSide': true, + 'bProcessing': true, 'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl', 'fnServerParams': function(aoData) { aoData.push( { 'name': 'format', 'value': 'json' } ); @@ -217,7 +218,7 @@ aoData.push(params[i]); } }, - 'sDom': '<"top pager"ilp>t<"bottom pager"ip>', + 'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', 'aoColumns': [ { 'sName': 'title' }, { 'sName': 'publicationyear' }, @@ -345,6 +346,12 @@ options = ccodes empty_option = "All collection codes" %] + [% INCLUDE form_field_select + name="notforloan" + label="Status" + options = notforloans + empty_option = "All statuses" + %]
[% INCLUDE form_field_select_text_block %] -- 1.7.2.5