Bugzilla – Attachment 66215 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
Bug-2946---Lost-items-hidden-in-Normal-View-still-.patch (text/plain), 2.37 KB, created by
Mark Tompsett
on 2017-08-19 03:46:42 UTC
(
hide
)
Description:
Bug 2946 - Lost items (hidden in Normal View) still show up in the MARC View in OPAC
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-08-19 03:46:42 UTC
Size:
2.37 KB
patch
obsolete
>From d244f21d31f934b7fada6650b5345d20b7973249 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, 10 insertions(+), 6 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index a899e92..6970f82 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/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_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") ) { >-- >2.1.4
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