@@ -, +, @@ in the MARC View in OPAC --- opac/opac-MARCdetail.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/opac/opac-MARCdetail.pl +++ a/opac/opac-MARCdetail.pl @@ -277,12 +277,14 @@ foreach my $field (@fields) { @items2hide) ); my @subf = $field->subfields; my $item; + my $hideitem=0; # loop through each subfield for my $i ( 0 .. $#subf ) { my $sf_def = $tagslib->{ $field->tag() }->{ $subf[$i][0] }; next if ( ($sf_def->{tab}||0) != 10 ); next if ( ($sf_def->{hidden}||0) > 0 ); + ( $hideitem=1) if (C4::Context->preference("hidelostitems") && ($sf_def->{kohafield} eq 'items.itemlost') && ($subf[$i][0] > 0) ); push @item_subfield_codes, $subf[$i][0]; $witness{ $subf[$i][0] } = $sf_def->{lib}; @@ -297,7 +299,7 @@ foreach my $field (@fields) { $subf[$i][1], '', $tagslib, '', 'opac' ); } } - push @item_loop, $item if $item; + push @item_loop, $item if ( $item && !$hideitem ); } my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $framework ); @@ -307,11 +309,13 @@ my ( $holdingbrtagf, $holdingbrtagsubf ) = @item_subfield_codes = uniq @item_subfield_codes; # fill item info my @item_header_loop; -for my $subfield_code ( @item_subfield_codes ) { - push @item_header_loop, $witness{$subfield_code}; - for my $item_data ( @item_loop ) { - $item_data->{$subfield_code} ||= " " - } +if (@item_value_loop > 0) { # prevent display of header if no items to display + for my $subfield_code ( @item_subfield_codes ) { + push @item_header_loop, $witness{$subfield_code}; + for my $item_data ( @item_loop ) { + $item_data->{$subfield_code} ||= " " + } + } } if ( C4::Context->preference("OPACISBD") ) { --