Bugzilla – Attachment 6764 Details for
Bug 1633
Add ability to take book cover images from local img db
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 1633: Don't show image tab when inappropriate
Bug-1633-Dont-show-image-tab-when-inappropriate.patch (text/plain), 4.27 KB, created by
Jared Camins-Esakov
on 2011-12-14 02:06:04 UTC
(
hide
)
Description:
Bug 1633: Don't show image tab when inappropriate
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2011-12-14 02:06:04 UTC
Size:
4.27 KB
patch
obsolete
>From a57436d14537faf21692de3df344aa54b8ecd7ab Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Tue, 13 Dec 2011 21:02:03 -0500 >Subject: [PATCH] Bug 1633: Don't show image tab when inappropriate >Content-Type: text/plain; charset="UTF-8" > >This patch corrects the bug spotted by Owen Leonard where the Images tab was >showing up even for records that didn't have local cover images attached to >them. The tab is now hidden on the OPAC for records that don't have any >images. In the Intranet, an Images tab will show for staff with permission >to upload images, suggesting that they do so. For staff without that >permission, the tab is not shown. >--- > .../prog/en/modules/catalogue/detail.tt | 8 +++++++- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- > opac/opac-imageviewer.pl | 2 +- > 3 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 9174d94..d8b5eae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -228,7 +228,7 @@ function verify_images() { > [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#subscriptions">Subscriptions</a></li>[% END %] > [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#editions">Editions</a></li>[% END %][% END %] > [% IF ( AmazonSimilarItems ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#related">Related Titles</a></li>[% END %] >-[% IF ( LocalCoverImages ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#images">Images</a></li>[% END %] >+[% IF ( LocalCoverImages ) %][% IF ( localimages.0 || CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]#images">Images</a></li>[% END %][% END %] > </ul> > > <div id="holdings"> >@@ -519,12 +519,18 @@ function verify_images() { > > [% IF ( LocalCoverImages ) %] > <div id="images"> >+[% IF ( localimages.0 ) %] > <div>Click on an image to view it in the image viewer</div> > [% FOREACH image IN localimages %] > [% IF image %] > <span class="localimage"><a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber %]&imagenumber=[% image %]"><img alt="img" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image %]" /></a></span> > [% END %] > [% END %] >+[% ELSE %] >+[% IF ( CAN_user_tools_upload_local_cover_images ) %] >+<p>No images have been uploaded for this bibliographic record yet. Please <a href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'>upload</a> one.</p> >+[% END %] >+[% END %] > </div> > [% END %] > >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 7f52117..95f4765 100755 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -548,7 +548,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#serialcollection">Serial Collection</a></li> > [% END %] > >- [% IF ( OPACLocalCoverImages ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#images">Images</a></li>[% END %] >+ [% IF ( OPACLocalCoverImages ) %][% IF ( localimages.0 ) %]<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]#images">Images</a></li>[% END %][% END %] > </ul> > > [% IF ( serialcollection ) %] >diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl >index 7bab178..31bfd28 100755 >--- a/opac/opac-imageviewer.pl >+++ b/opac/opac-imageviewer.pl >@@ -46,7 +46,7 @@ if (C4::Context->preference("OPACLocalCoverImages")) { > $template->{VARS}->{'OPACLocalCoverImages'} = 1; > $template->{VARS}->{'images'} = \@images; > $template->{VARS}->{'biblionumber'} = $biblionumber; >- $template->{VARS}->{'imagenumber'} = $images[0] || ''; >+ $template->{VARS}->{'imagenumber'} = $imagenumber || $images[0] || ''; > } > > $template->{VARS}->{'biblio'} = $biblio; >-- >1.7.2.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 1633
:
6242
|
6699
|
6706
|
6712
|
6745
|
6746
|
6747
|
6748
|
6749
|
6750
|
6755
|
6756
|
6758
|
6759
|
6764
|
6765
|
6766
|
6785
|
6786
|
6787
|
6788
|
6791
|
6823
|
6973
|
6974
|
6975
|
6976
|
6977
|
6978
|
6979
|
6980
|
6981
|
6982
|
6983
|
7146
|
7147
|
7148
|
7149
|
7150
|
7151
|
7152
|
7153
|
7156
|
7219
|
7267
|
7268
|
7270
|
7271
|
7272
|
7273
|
7274
|
7275
|
7312
|
7315
|
7320
|
7324
|
7325
|
7334