Bugzilla – Attachment 13684 Details for
Bug 8710
Do not show the images tab in the OPAC if the record has no local cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8710 - Don't show the images tab in the OPAC if the record has no local images
Bug-8710---Dont-show-the-images-tab-in-the-OPAC-if.patch (text/plain), 2.75 KB, created by
Jonathan Druart
on 2012-11-26 15:53:10 UTC
(
hide
)
Description:
Bug 8710 - Don't show the images tab in the OPAC if the record has no local images
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-11-26 15:53:10 UTC
Size:
2.75 KB
patch
obsolete
>From fa833f38ba032f9c0ba61c8a051fc263d4098bf1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 26 Oct 2012 09:14:15 -0400 >Subject: [PATCH] Bug 8710 - Don't show the images tab in the OPAC if the > record has no local images > >For unknown reasons, having ListImagesForBiblio return undef >when there are no images still results in a variable being passed >to the template which evaluates as true, with a size of 1. > >This patch alters ListImagesForBiblio to remove the "return undef" >condition, allowing the template to evaluate images as false >and show no tab. > >To test, turn on local cover images and view records in the OPAC >which do and do not have cover images attached. Images should >display as expected when present, and no images tab should appear >on records which have none. > >Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Images.pm | 12 +++--------- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 6 +++--- > 2 files changed, 6 insertions(+), 12 deletions(-) > >diff --git a/C4/Images.pm b/C4/Images.pm >index 8b17f1c..4bae00c 100644 >--- a/C4/Images.pm >+++ b/C4/Images.pm >@@ -131,16 +131,10 @@ sub ListImagesForBiblio { > my $query = 'SELECT imagenumber FROM biblioimages WHERE biblionumber = ?'; > my $sth = $dbh->prepare($query); > $sth->execute($biblionumber); >- warn "Database error!" if $sth->errstr; >- if ( !$sth->errstr && $sth->rows > 0 ) { >- while ( my $row = $sth->fetchrow_hashref ) { >- push @imagenumbers, $row->{'imagenumber'}; >- } >- return @imagenumbers; >- } >- else { >- return undef; >+ while ( my $row = $sth->fetchrow_hashref ) { >+ push @imagenumbers, $row->{'imagenumber'}; > } >+ return @imagenumbers; > } > > =head2 DelImage >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 3ed3144..17658b9 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -712,9 +712,9 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </li> > [% END %] > >-[% IF ( OPACLocalCoverImages ) %][% IF ( localimages ) %] >+[% IF ( OPACLocalCoverImages && localimages.size ) %] > <li id="tab_images"><a href="#images">Images</a></li> >-[% END %][% END %] >+[% END %] > </ul> > > [% IF ( serialcollection ) %] >@@ -1149,7 +1149,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </table> > </div>[% END %][% END %] > >-[% IF ( OPACLocalCoverImages ) %] >+[% IF ( OPACLocalCoverImages && localimages.size ) %] > <div id="images"> > <p>Click on an image to view it in the image viewer</p> > [% FOREACH image IN localimages %] >-- >1.7.10.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 8710
:
13072
|
13297
| 13684