@@ -, +, @@ For example in KTD biblionumer=126 For example in KTD $7 = Staff Collection For example in KTD '(Staff Collection)' --- opac/opac-reserve.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -460,9 +460,6 @@ foreach my $biblioNum (@biblionumbers) { } } - my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); - my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs }; - my $visible_items = { map { $_->itemnumber => $_ } $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list }; # Only keep the items that are visible in the opac (i.e. those in %visible_items) @@ -525,10 +522,16 @@ foreach my $biblioNum (@biblionumbers) { $itemLoopIter->{itemnotforloan} = $itemInfo->{itemnotforloan}; # Management of the notforloan document - if ( $itemLoopIter->{notforloan} || $itemLoopIter->{itemnotforloan}) { + if ( $itemLoopIter->{notforloan} || $itemLoopIter->{itemnotforloan} ) { $itemLoopIter->{backgroundcolor} = 'other'; - $itemLoopIter->{notforloanvalue} = - $notforloan_label_of->{ $itemLoopIter->{notforloan} }; + my $notforloan_av = Koha::AuthorisedValues->get_description_by_koha_field( + { + frameworkcode => $frameworkcode, + kohafield => 'items.notforloan', + authorised_value => $itemLoopIter->{notforloan} + } + ); + $itemLoopIter->{notforloanvalue} = $notforloan_av->{opac_description} // ''; } # Management of lost or long overdue items --