|
Lines 63-69
if (defined $format and $format eq 'json') {
Link Here
|
| 63 |
push @f, $columns[$i]; |
63 |
push @f, $columns[$i]; |
| 64 |
push @c, 'and'; |
64 |
push @c, 'and'; |
| 65 |
|
65 |
|
| 66 |
if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan ) ) { |
66 |
if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) { |
| 67 |
push @q, "$word"; |
67 |
push @q, "$word"; |
| 68 |
push @op, '='; |
68 |
push @op, '='; |
| 69 |
} else { |
69 |
} else { |
|
Lines 103-108
my $notforloan_values = $mss->count ? GetAuthorisedValues($mss->next->authorised
Link Here
|
| 103 |
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); |
103 |
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.location', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); |
| 104 |
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; |
104 |
my $location_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; |
| 105 |
|
105 |
|
|
|
106 |
$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => '', kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); |
| 107 |
my $itemlost_values = $mss->count ? GetAuthorisedValues($mss->next->authorised_value) : []; |
| 108 |
|
| 106 |
if (scalar keys %params > 0) { |
109 |
if (scalar keys %params > 0) { |
| 107 |
# Parameters given, it's a search |
110 |
# Parameters given, it's a search |
| 108 |
|
111 |
|
|
Lines 111-117
if (scalar keys %params > 0) {
Link Here
|
| 111 |
filters => [], |
114 |
filters => [], |
| 112 |
}; |
115 |
}; |
| 113 |
|
116 |
|
| 114 |
foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan)) { |
117 |
foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost)) { |
| 115 |
if (my @q = $cgi->multi_param($p)) { |
118 |
if (my @q = $cgi->multi_param($p)) { |
| 116 |
if ($q[0] ne '') { |
119 |
if ($q[0] ne '') { |
| 117 |
my $f = { |
120 |
my $f = { |
|
Lines 164-170
if (scalar keys %params > 0) {
Link Here
|
| 164 |
push @{ $filter->{filters} }, $f; |
167 |
push @{ $filter->{filters} }, $f; |
| 165 |
|
168 |
|
| 166 |
# Yes/No parameters |
169 |
# Yes/No parameters |
| 167 |
foreach my $p (qw(damaged itemlost)) { |
170 |
foreach my $p (qw( damaged )) { |
| 168 |
my $v = $cgi->param($p) // ''; |
171 |
my $v = $cgi->param($p) // ''; |
| 169 |
my $f = { |
172 |
my $f = { |
| 170 |
field => $p, |
173 |
field => $p, |
|
Lines 232-237
if (scalar keys %params > 0) {
Link Here
|
| 232 |
$location_map->{$loc_value->{authorised_value}} = $loc_value->{lib}; |
235 |
$location_map->{$loc_value->{authorised_value}} = $loc_value->{lib}; |
| 233 |
} |
236 |
} |
| 234 |
|
237 |
|
|
|
238 |
# Get itemlost labels |
| 239 |
my $itemlost_map = {}; |
| 240 |
foreach my $il_value (@$itemlost_values) { |
| 241 |
$itemlost_map->{$il_value->{authorised_value}} = $il_value->{lib}; |
| 242 |
} |
| 243 |
|
| 235 |
foreach my $item (@$results) { |
244 |
foreach my $item (@$results) { |
| 236 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
245 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
| 237 |
$item->{biblio} = $biblio; |
246 |
$item->{biblio} = $biblio; |
|
Lines 304-309
foreach my $value (@$notforloan_values) {
Link Here
|
| 304 |
}; |
313 |
}; |
| 305 |
} |
314 |
} |
| 306 |
|
315 |
|
|
|
316 |
my @itemlosts; |
| 317 |
foreach my $value (@$itemlost_values) { |
| 318 |
push @itemlosts, { |
| 319 |
value => $value->{authorised_value}, |
| 320 |
label => $value->{lib}, |
| 321 |
}; |
| 322 |
} |
| 323 |
|
| 307 |
my @items_search_fields = GetItemSearchFields(); |
324 |
my @items_search_fields = GetItemSearchFields(); |
| 308 |
|
325 |
|
| 309 |
my $authorised_values = {}; |
326 |
my $authorised_values = {}; |
|
Lines 319-324
$template->param(
Link Here
|
| 319 |
itemtypes => \@itemtypes, |
336 |
itemtypes => \@itemtypes, |
| 320 |
ccodes => \@ccodes, |
337 |
ccodes => \@ccodes, |
| 321 |
notforloans => \@notforloans, |
338 |
notforloans => \@notforloans, |
|
|
339 |
itemlosts => \@itemlosts, |
| 322 |
items_search_fields => \@items_search_fields, |
340 |
items_search_fields => \@items_search_fields, |
| 323 |
authorised_values_json => to_json($authorised_values), |
341 |
authorised_values_json => to_json($authorised_values), |
| 324 |
); |
342 |
); |