Lines 42-59
if (defined $format and $format eq 'json') {
Link Here
|
42 |
$content_type = 'json'; |
42 |
$content_type = 'json'; |
43 |
|
43 |
|
44 |
# Map DataTables parameters with 'regular' parameters |
44 |
# Map DataTables parameters with 'regular' parameters |
45 |
$cgi->param('rows', $cgi->param('iDisplayLength')); |
45 |
$cgi->param('rows', scalar $cgi->param('iDisplayLength')); |
46 |
$cgi->param('page', ($cgi->param('iDisplayStart') / $cgi->param('iDisplayLength')) + 1); |
46 |
$cgi->param('page', (scalar $cgi->param('iDisplayStart') / scalar $cgi->param('iDisplayLength')) + 1); |
47 |
my @columns = split /,/, scalar $cgi->param('sColumns'); |
47 |
my @columns = split /,/, scalar $cgi->param('sColumns'); |
48 |
$cgi->param('sortby', $columns[ $cgi->param('iSortCol_0') ]); |
48 |
$cgi->param('sortby', $columns[ scalar $cgi->param('iSortCol_0') ]); |
49 |
$cgi->param('sortorder', $cgi->param('sSortDir_0')); |
49 |
$cgi->param('sortorder', scalar $cgi->param('sSortDir_0')); |
50 |
|
50 |
|
51 |
my @f = $cgi->multi_param('f'); |
51 |
my @f = $cgi->multi_param('f'); |
52 |
my @q = $cgi->multi_param('q'); |
52 |
my @q = $cgi->multi_param('q'); |
53 |
push @q, '' if @q == 0; |
53 |
push @q, '' if @q == 0; |
54 |
my @op = $cgi->multi_param('op'); |
54 |
my @op = $cgi->multi_param('op'); |
55 |
my @c = $cgi->multi_param('c'); |
55 |
my @c = $cgi->multi_param('c'); |
56 |
foreach my $i (0 .. ($cgi->param('iColumns') - 1)) { |
56 |
my $iColumns = $cgi->param('iColumns'); |
|
|
57 |
foreach my $i (0 .. ($iColumns - 1)) { |
57 |
my $sSearch = $cgi->param("sSearch_$i"); |
58 |
my $sSearch = $cgi->param("sSearch_$i"); |
58 |
if (defined $sSearch and $sSearch ne '') { |
59 |
if (defined $sSearch and $sSearch ne '') { |
59 |
my @words = split /\s+/, $sSearch; |
60 |
my @words = split /\s+/, $sSearch; |
Lines 109-115
if (scalar keys %params > 0) {
Link Here
|
109 |
field => $p, |
110 |
field => $p, |
110 |
query => \@q, |
111 |
query => \@q, |
111 |
}; |
112 |
}; |
112 |
if (my $op = $cgi->param($p . '_op')) { |
113 |
if (my $op = scalar $cgi->param($p . '_op')) { |
113 |
$f->{operator} = $op; |
114 |
$f->{operator} = $op; |
114 |
} |
115 |
} |
115 |
push @{ $filter->{filters} }, $f; |
116 |
push @{ $filter->{filters} }, $f; |
Lines 170-183
if (scalar keys %params > 0) {
Link Here
|
170 |
} |
171 |
} |
171 |
} |
172 |
} |
172 |
|
173 |
|
173 |
if (my $itemcallnumber_from = $cgi->param('itemcallnumber_from')) { |
174 |
if (my $itemcallnumber_from = scalar $cgi->param('itemcallnumber_from')) { |
174 |
push @{ $filter->{filters} }, { |
175 |
push @{ $filter->{filters} }, { |
175 |
field => 'itemcallnumber', |
176 |
field => 'itemcallnumber', |
176 |
query => $itemcallnumber_from, |
177 |
query => $itemcallnumber_from, |
177 |
operator => '>=', |
178 |
operator => '>=', |
178 |
}; |
179 |
}; |
179 |
} |
180 |
} |
180 |
if (my $itemcallnumber_to = $cgi->param('itemcallnumber_to')) { |
181 |
if (my $itemcallnumber_to = scalar $cgi->param('itemcallnumber_to')) { |
181 |
push @{ $filter->{filters} }, { |
182 |
push @{ $filter->{filters} }, { |
182 |
field => 'itemcallnumber', |
183 |
field => 'itemcallnumber', |
183 |
query => $itemcallnumber_to, |
184 |
query => $itemcallnumber_to, |
184 |
- |
|
|