From c6fdd4ba5d081fb24bbdf42c1a423400417a626b Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 6 Jan 2008 20:17:26 -0600 Subject: [PATCH] Fix to get notforloan status displaying correctly in opac-reserves.pl part 1 Signed-off-by: Joshua Ferraro --- opac/opac-reserve.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 281641ea70..6eb8b9519b 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -150,10 +150,12 @@ my %types; my %itemtypes; my @duedates; #die @items; +my %itemhash; foreach my $itm (@items) { push @duedates, { date_due => format_date( $itm->{'date_due'} ) } if defined $itm->{'date_due'}; $itm->{ $itm->{'publictype'} } = 1; + warn $itm->{'notforloan'}; my $fee = GetReserveFee( undef, $borrowernumber, $itm->{'biblionumber'}, 'a', ( $itm->{'biblioitemnumber'} ) ); $fee = sprintf "%.02f", $fee; @@ -172,6 +174,7 @@ foreach my $itm (@items) { push @{ $types{$pty}->{'items'} }, $itm; } } + $itemhash{$itm->{'itemnumber'}}=$itm; } $template->param( ITEMS => \@duedates ); @@ -322,7 +325,7 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) { - my $item = $iteminfos_of->{$itemnumber}; + my $item = $itemhash{$itemnumber}; $item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; @@ -360,7 +363,7 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { } # Management of the notforloan document - if ( $item->{notforloan} ) { + if ( $item->{notforloan} || $item->{itemnotforloan}) { $item->{backgroundcolor} = 'other'; $item->{notforloanvalue} = $notforloan_label_of->{ $item->{notforloan} }; -- 2.11.0