Bugzilla – Attachment 20892 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]
Bug 10584 - Hide OPAC biblio details if all items are hidden
Bug-10584---Hide-OPAC-biblio-details-if-all-items-.patch (text/plain), 2.35 KB, created by
Mark Tompsett
on 2013-09-09 00:44:57 UTC
(
hide
)
Description:
Bug 10584 - Hide OPAC biblio details if all items are hidden
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-09-09 00:44:57 UTC
Size:
2.35 KB
patch
obsolete
>From 076ea9818e73eee49f4c0d7ab41ebf13eb5e32a4 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 > >If there are items for a given biblio number, and they are >all hidden, then biblio needs to be hidden. If the biblio >needs to be hidden, it immediately redirects to a 404.pl page, >just as if the biblionumber does not exist. >--- > opac/opac-detail.pl | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index d1f5d91..e235435 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -70,9 +70,20 @@ 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 @itemsmatchingbiblionumber = GetItemsInfo($biblionumber); >+my @hiddenitems; >+if (scalar @itemsmatchingbiblionumber >= 1) { >+ push @hiddenitems, GetHiddenItemnumbers(@itemsmatchingbiblionumber); >+ >+ if (scalar @hiddenitems == scalar @itemsmatchingbiblionumber ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early >+ exit; >+ } >+} >+ > my $record = GetMarcBiblio($biblionumber); > if ( ! $record ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early >@@ -397,8 +408,10 @@ $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); > > $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); > $template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") ); >+# FIXME -- Perhaps this 2002 comment no longer applies? >+# Bug 10584 just changed the line following it. > # change back when ive fixed request.pl >-my @all_items = GetItemsInfo( $biblionumber ); >+my @all_items = @itemsmatchingbiblionumber; > > # adding items linked via host biblios > >@@ -421,9 +434,6 @@ foreach my $hostfield ( $record->field($analyticfield)) { > > my @items; > >-# Getting items to be hidden >-my @hiddenitems = GetHiddenItemnumbers(@all_items); >- > # Are there items to hide? > my $hideitems; > $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0; >-- >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