From 444601a4d11e5cdad890187317e60731c8b97ad9 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Sun, 19 Apr 2009 01:04:23 +0200 Subject: [PATCH] fix for #1731 The "place hold" button is hidden in detail.pl when there are no items or the items are not for loan. MARC detail should do the same. Signed-off-by: Galen Charlton --- catalogue/MARCdetail.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index db1c6f4b99..f569763f80 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -247,6 +247,7 @@ my @fields = $record->fields(); my %witness ; #---- stores the list of subfields used at least once, with the "meaning" of the code my @big_array; +my $norequests = 1; foreach my $field (@fields) { next if ( $field->tag() < 10 ); my @subf = $field->subfields; @@ -260,11 +261,13 @@ foreach my $field (@fields) { $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib}; $this_row{ $subf[$i][0] } = GetAuthorisedValueDesc( $field->tag(), $subf[$i][0], $subf[$i][1], '', $tagslib) || $subf[$i][1]; + $norequests = 0 if $subf[$i][1] ==0 and $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{kohafield} eq 'items.notforloan'; } if (%this_row) { push( @big_array, \%this_row ); } } + my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$frameworkcode); @big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array; @@ -306,6 +309,7 @@ if ($subscriptionscount) { } $template->param ( + norequests => $norequests, item_loop => \@item_value_loop, item_header_loop => \@header_value_loop, biblionumber => $biblionumber, -- 2.20.1