push @f, $columns[$i];
push @c, 'and';
- if ( grep { $_ eq $columns[$i] } qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) {
+ if ( grep { $_ eq $columns[$i] } qw( ccode homebranch holdingbranch location itype notforloan itemlost onloan ) ) {
push @q, "$word";
push @op, '=';
} else {
}
}
+ # null/is not null parameters
+ foreach my $p (qw( onloan )) {
+ my $v = $cgi->param($p) // '';
+ my $f = {
+ field => $p,
+ operator => "is",
+ };
+ if ( $v eq 'IS NOT NULL' ) {
+ $f->{query} = "not null";
+ } elsif ( $v eq 'IS NULL' ) {
+ $f->{query} = "null";
+ }
+ push @{ $filter->{filters} }, $f unless ( $v eq "" );
+ }
+
if (my $itemcallnumber_from = scalar $cgi->param('itemcallnumber_from')) {
push @{ $filter->{filters} }, {
field => 'itemcallnumber',
my $biblio = Koha::Biblios->find( $item->{biblionumber} );
$item->{biblio} = $biblio;
$item->{biblioitem} = $biblio->biblioitem->unblessed;
+ my $checkout = Koha::Checkouts->find({ itemnumber => $item->{itemnumber} });
+ $item->{checkout} = $checkout;
}
}
$template->param(
- filter => $filter,
+ filter => $filter,
search_params => $search_params,
- results => $results,
- total_rows => $total_rows,
+ results => $results,
+ total_rows => $total_rows,
+ user => Koha::Patrons->find( $borrowernumber ),
);
if ($format eq 'csv') {
# Display the search form
-my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } );
-my @itemtypes;
-foreach my $itemtype ( Koha::ItemTypes->search ) {
- push @itemtypes, {
- value => $itemtype->itemtype,
- label => $itemtype->translated_description,
- };
-}
+my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } )->as_list;
+my @itemtypes = map { value => $_->itemtype, label => $_->translated_description }, Koha::ItemTypes->search_with_localization->as_list;
my @ccodes = Koha::AuthorisedValues->get_descriptions_by_koha_field({ kohafield => 'items.ccode' });
foreach my $ccode (@ccodes) {