@@ -, +, @@ --- Koha/Items.pm | 10 +++++----- koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 3 +-- t/db_dependent/Koha/Items.t | 12 +++++++----- 3 files changed, 13 insertions(+), 12 deletions(-) --- a/Koha/Items.pm +++ a/Koha/Items.pm @@ -37,17 +37,17 @@ Koha::Items - Koha Item object set class =cut -=head3 filter_by_for_loan +=head3 filter_by_for_hold - my $filtered_items = $items->filter_by_for_loan; + my $filtered_items = $items->filter_by_for_hold; -Return the items of the set that are loanable +Return the items of the set that are holdable =cut -sub filter_by_for_loan { +sub filter_by_for_hold { my ($self) = @_; - return $self->search( { notforloan => [ 0, undef ] } ); + 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 @@ -166,9 +166,8 @@ CAN_user_serials_create_subscription ) %]
Print
[% 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 ) %]