Bugzilla – Attachment 19614 Details for
Bug 10584
Hide OPAC biblio details if all items are hidden.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
If there is at least one item and every item is hidden, hide the biblio entry.
0001-Bug-10584-Hide-OPAC-biblio-details-if-all-items-are-.patch (text/plain), 2.32 KB, created by
Mark Tompsett
on 2013-07-13 00:36:29 UTC
(
hide
)
Description:
If there is at least one item and every item is hidden, hide the biblio entry.
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-07-13 00:36:29 UTC
Size:
2.32 KB
patch
obsolete
>From 8b493d6b86c849a6878657bd102022f87f9288d9 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 11 Jul 2013 23:13:42 -0400 >Subject: [PATCH] Bug 10584 - Hide OPAC biblio details if all items are hidden > >By counting the items associated with the biblionumber, >and comparing that against the number of items which would be >hidden, it is possible to determine if all items are hidden. If >there are items and they are all hidden, the biblio needs to >be hidden, the biblionumber is changed to 0, which triggers >the same output as if the biblionumber does not exist. >--- > opac/opac-detail.pl | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 9d0851f..4921072 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -70,9 +70,32 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >-my $biblionumber = $query->param('biblionumber') || $query->param('bib'); >+my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0; > $biblionumber = int($biblionumber); > >+my $dbh = C4::Context->dbh; >+my $sth = $dbh->prepare("SELECT * FROM items WHERE biblionumber=?;"); >+$sth->execute($biblionumber); >+ >+my @itemsmatchingbiblionumber; >+my $matchingitem = $sth->fetchrow_hashref; >+while ($matchingitem) { >+ push @itemsmatchingbiblionumber,$matchingitem; >+ $matchingitem = $sth->fetchrow_hashref; >+} >+ >+my @items2hide; >+if ($#itemsmatchingbiblionumber >= 0) { >+ @items2hide =GetHiddenItemnumbers(@itemsmatchingbiblionumber); >+} >+ >+# only hide if there are hidden items. $#items2hide=-1 for no items. >+if ($#items2hide==$#itemsmatchingbiblionumber && $#items2hide>=0) { >+ # biblionumber=0 effectively hides the biblio record >+ # since there is no such biblionumber. >+ $biblionumber = 0; >+} >+ > my $record = GetMarcBiblio($biblionumber); > if ( ! $record ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early >@@ -628,7 +651,6 @@ if (scalar(@itemloop) >= 50 && !$viewallitems) { > } > > ## get notes and subjects from MARC record >-my $dbh = C4::Context->dbh; > my $marcnotesarray = GetMarcNotes ($record,$marcflavour); > my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); > my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); >-- >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 10584
:
19614
|
19712
|
19720
|
19737
|
20824
|
20892
|
20893
|
21068
|
21073
|
21076