diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index 6f59ae9baa..7f58423602 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -119,14 +119,21 @@ if ( defined $format ) { filters => [], }; - foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) { - if (my @q = $cgi->multi_param($p)) { - if ($q[0] ne '') { + foreach + my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) + { + my @q; + @q = $cgi->multi_param( $p . "[]" ); + if ( scalar @q == 0 ) { + @q = $cgi->multi_param($p); + } + if (@q) { + if ( $q[0] ne '' ) { my $f = { field => $p, query => \@q, }; - if (my $op = scalar $cgi->param($p . '_op')) { + if ( my $op = scalar $cgi->param( $p . '_op' ) ) { $f->{operator} = $op; } push @{ $filter->{filters} }, $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 89006963d5..862fbf5a72 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -461,10 +461,11 @@ type: 'POST', data: function ( d ) { for (i in params) { - if (! d.hasOwnProperty(params[i].name) ) { - d[params[i].name] = []; + if(d[params[i].name]){ + d[params[i].name] = [].concat(d[params[i].name], params[i].value); + }else{ + d[params[i].name] = params[i].value; } - d[params[i].name].push(params[i].value); } d.format = 'json'; d.columns = JSON.stringify( d.columns );