@@ -, +, @@ --- Koha/Items.pm | 15 ++++++++++++++- .../prog/en/includes/cat-toolbar.inc | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) --- a/Koha/Items.pm +++ a/Koha/Items.pm @@ -47,7 +47,20 @@ Return the items of the set that are loanable sub filter_by_for_loan { my ($self) = @_; - return $self->search( { notforloan => [ 0, undef ] } ); + return $self->search( { notforloan => 0 } ); +} + +=head3 filter_by_for_hold + + my $filtered_items = $items->filter_by_for_hold; + +Return the items of the set that are holdable + +=cut + +sub filter_by_for_hold { + my ($self) = @_; + return $self->search( { notforloan => { '<' => 1 } } ); # items with negative or zero notforloan value are holdable } =head3 filter_by_visible_in_opac --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -168,7 +168,7 @@ CAN_user_serials_create_subscription ) %] [% IF ( CAN_user_reserveforothers ) %] [%# biblio.items.filter_by_for_loan.count %] [% SET items = biblio.items %] - [% IF Context.Scalar(Context.Scalar(items, "filter_by_for_loan"), "count") %] + [% IF Context.Scalar(Context.Scalar(items, "filter_by_for_hold"), "count") %] [% IF ( holdfor ) %]