Bugzilla – Attachment 25963 Details for
Bug 2946
Lost items (that are hidden in Normal View) still show up in the MARC View in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2946 - Lost items (hidden in Normal View) still show up in the MARC View in OPAC
0001-Bug-2946-Lost-items-hidden-in-Normal-View-still-show.patch (text/plain), 2.29 KB, created by
wajasu
on 2014-03-08 04:15:18 UTC
(
hide
)
Description:
Bug 2946 - Lost items (hidden in Normal View) still show up in the MARC View in OPAC
Filename:
MIME Type:
Creator:
wajasu
Created:
2014-03-08 04:15:18 UTC
Size:
2.29 KB
patch
obsolete
>From fe975cfaa0e2dfcf32dfcfa47a8f20562140832d Mon Sep 17 00:00:00 2001 >From: wajasu <matted-34813@mypacks.net> >Date: Fri, 7 Mar 2014 21:44:39 -0600 >Subject: [PATCH] Bug 2946 - Lost items (hidden in Normal View) still show up > in the MARC View in OPAC > >Hides the Holdings that are "Lost" and the entire Holdings table if all items >are lost, when the hidelostitems syspref is "Don't Show". >Should work in plain text view as well. >For the OPAC MARC view of a biblio details. >--- > opac/opac-MARCdetail.pl | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index aaa565d..7cb4c4f 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -255,12 +255,15 @@ foreach my $field (@fields) { > @items2hide) ); > my @subf = $field->subfields; > my %this_row; >+ my $hideitem=0; > > # loop through each subfield > for my $i ( 0 .. $#subf ) { > my $sf_def = $tagslib->{ $field->tag() }->{ $subf[$i][0] }; >+ #warn "subf:$i $sf_def->{kohafield} $sf_def->{lib} $subf[$i][0]"; # see errlog to learn the mappings > 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) ); > $witness{ $subf[$i][0] } = $sf_def->{lib}; > > if ( $sf_def->{isurl} ) { >@@ -274,7 +277,7 @@ foreach my $field (@fields) { > $subf[$i][1], '', $tagslib, '', 'opac' ); > } > } >- if (%this_row) { >+ if (%this_row && !$hideitem) { > push( @big_array, \%this_row ); > } > } >@@ -304,10 +307,13 @@ for ( my $i = 0 ; $i <= $#big_array ; $i++ ) { > push( @item_value_loop, \%row_data ); > } > >-foreach my $subfield_code ( keys(%witness) ) { >- my %header_value; >- $header_value{header_value} = $witness{$subfield_code}; >- push( @header_value_loop, \%header_value ); >+ >+if (@item_value_loop > 0) { # prevent display of header if no items to display >+ foreach my $subfield_code ( keys(%witness) ) { >+ my %header_value; >+ $header_value{header_value} = $witness{$subfield_code}; >+ push( @header_value_loop, \%header_value ); >+ } > } > > if(C4::Context->preference("ISBD")) { >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2946
:
25963
|
66211
|
66212
|
66213
|
66214
|
66215
|
66216
|
66284