Bugzilla – Attachment 20985 Details for
Bug 10876
Fix opac-MARCdetail.pl partial hides
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10876 - MARC view displays what should be hidden
Bug-10876---MARC-view-displays-what-should-be-hidd.patch (text/plain), 2.67 KB, created by
Mark Tompsett
on 2013-09-11 13:03:45 UTC
(
hide
)
Description:
Bug 10876 - MARC view displays what should be hidden
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-09-11 13:03:45 UTC
Size:
2.67 KB
patch
obsolete
>From 00976595fcb26ac84f33ff1d5f686e6dff7f69b5 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 10 Sep 2013 16:16:47 -0400 >Subject: [PATCH] Bug 10876 - MARC view displays what should be hidden > >The opac/opac-MARCdetail.pl file is what is viewed when "MARC >view" is clicked while viewing a specific search result. Items >hidden on opac/opac-detail.pl based on OpacHiddenItems are >shown! This should not happen. I believe this bug goes back >several versions, not just master. > >While coding this, a lack of use or require in C4::Items was >discovered. See bug 10872. > >By adding calls to GetItemsInfo and GetHiddenItems, a filter >on the items is placed. As this is processing MARC data, >GetMarcFromKohaField was used to properly determine what the >item number (952$9) is. >--- > opac/opac-MARCdetail.pl | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 2a69244..c967f00 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -52,14 +52,33 @@ use MARC::Record; > use C4::Biblio; > use C4::Acquisition; > use C4::Koha; >+use C4::Items; >+use List::MoreUtils qw/any/; > > my $query = new CGI; > > my $dbh = C4::Context->dbh; > > my $biblionumber = $query->param('biblionumber'); >+if ( ! $biblionumber ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); >+ exit; >+} >+ >+my @all_items = GetItemsInfo($biblionumber); >+my @items2hide; >+if (scalar @all_items >= 1) { >+ push @items2hide, GetHiddenItemnumbers(@all_items); >+ >+ if (scalar @items2hide == scalar @all_items ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); >+ exit; >+ } >+} >+ > my $itemtype = &GetFrameworkCode($biblionumber); > my $tagslib = &GetMarcStructure( 0, $itemtype ); >+my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$itemtype); > my $biblio = GetBiblioData($biblionumber); > $biblionumber = $biblio->{biblionumber}; > my $record = GetMarcBiblio($biblionumber, 1); >@@ -209,7 +228,6 @@ for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { > $template->param( "tab" . $tabloop . "XX" => \@loop_data ); > } > >- > # now, build item tab ! > # the main difference is that datas are in lines and not in columns : thus, we build the <th> first, then the values... > # loop through each tag >@@ -223,6 +241,9 @@ foreach my $field (@fields) { > next if ( $field->tag() < 10 ); > my @subf = $field->subfields; > my %this_row; >+ next if ( ($field->tag() eq $tag_itemnumber) && >+ (any { $field->subfield($subtag_itemnumber) eq $_ } >+ @items2hide) ); > > # loop through each subfield > for my $i ( 0 .. $#subf ) { >-- >1.7.9.5
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 10876
:
20985
|
21079
|
21082
|
21122
|
21135