@@ -, +, @@ Koha::AuthorisedValues - Create 2 authorised value categories for not for loan (NFL1 and NFL2) - Define link 952$7 to NFL1 for the default framework and to NFL2 for - Create 2 bibliographic records (B1 using NFL1 and B2 using NFL2) with - Go to the "Place a hold" view for this record. - In the item list, you should see the not for loan value - Recreate the issues without this patchset - Apply this patchset - Recreate the steps to recreate the issues --- opac/opac-reserve.pl | 8 ++++++-- reserve/request.pl | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -32,6 +32,7 @@ use C4::Context; use C4::Members; use C4::Overdues; use C4::Debug; +use Koha::AuthorisedValues; use Koha::DateUtils; use Koha::Libraries; use Koha::Patrons; @@ -367,7 +368,6 @@ unless ($noreserves) { # and items for each biblionumber. # # -my $notforloan_label_of = get_notforloan_label_of(); my $biblioLoop = []; my $numBibsAvailable = 0; @@ -389,9 +389,10 @@ foreach my $biblioNum (@biblionumbers) { &get_out($query, $cookie, $template->output); } + my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} ); $biblioLoopIter{biblionumber} = $biblioData->{biblionumber}; $biblioLoopIter{title} = $biblioData->{title}; - $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($biblioData->{biblionumber})); + $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode); $biblioLoopIter{author} = $biblioData->{author}; $biblioLoopIter{rank} = $biblioData->{rank}; $biblioLoopIter{reservecount} = $biblioData->{reservecount}; @@ -414,6 +415,9 @@ 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 }; + $biblioLoopIter{itemLoop} = []; my $numCopiesAvailable = 0; my $numCopiesOPACAvailable = 0; --- a/reserve/request.pl +++ a/reserve/request.pl @@ -321,11 +321,13 @@ foreach my $biblionumber (@biblionumbers) { ## Should be same as biblionumber my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; - my $notforloan_label_of = get_notforloan_label_of(); - ## Hash of biblioitemnumber to 'biblioitem' table records my $biblioiteminfos_of = GetBiblioItemInfosOf(@biblioitemnumbers); + my $frameworkcode = GetFrameworkCode( $biblionumber ); + my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); + my $notforloan_label_of = { map { $_->authorised_value => $_->lib } @notforloan_avs }; + my @bibitemloop; my @available_itemtypes; --