Browse Source

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 <bgkriegel@gmail.com>
Nice box

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3.18.x
Julian Maurice 9 years ago
committed by Tomas Cohen Arazi
parent
commit
5a5682bd59
  1. 4
      catalogue/itemsearch.pl
  2. 11
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

4
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 = {

11
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

@ -22,7 +22,7 @@
[% empty_option || "All" %]
</option>
[% FOREACH option IN options %]
[% IF values.grep(option.value).size %]
[% IF values != '' && values.grep(option.value).size %]
<option value="[% option.value %]" selected="selected">[% option.label %]</option>
[% ELSE %]
<option value="[% option.value %]">[% option.label %]</option>
@ -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"
%]
</fieldset>
<fieldset>
[% INCLUDE form_field_select_text_block %]

Loading…
Cancel
Save