From 34759051fb5df1117491689fb1c14656c08296a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= Date: Fri, 21 Mar 2014 11:39:13 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 11982 - Show local cover image in the intranet biblio details page Content-Type: text/plain; charset="utf-8" Also, fix useless "No cover image" block when using Amazon and local cover images at the same time. http://bugs.koha-community.org/show_bug.cgi?id=11982 Signed-off-by: Owen Leonard --- .../prog/en/modules/catalogue/detail.tt | 34 +++++++++++++++++--- koha-tmpl/opac-tmpl/ccsr/en/js/localcovers.js | 1 + koha-tmpl/opac-tmpl/prog/en/js/localcovers.js | 1 + 3 files changed, 32 insertions(+), 4 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 e10d95f..e3ca17a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -175,6 +175,9 @@ function verify_images() { [% IF ( LocalCoverImages && ! localimages.0 ) %] showNoImageMessage(); [% END %] + [% IF LocalCoverImages %] + KOHA.LocalCover.GetCoverFromBibnumber(true); + [% END %] }); [% IF ( AmazonCoverImages ) %]$(window).load(function() { @@ -366,8 +369,18 @@ function verify_images() { MARC Preview: Show [% IF ( holdcount ) %]Holds: [% holdcount %][% ELSE %][% END %] - [% IF ( AmazonCoverImages ) %]
- [% END %] + [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] +
+ [% IF ( LocalCoverImages ) %]
[% END %] + [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %][% END %][% END %] + [% END %] [% ELSE %]

[% title |html %]

@@ -430,8 +443,21 @@ function verify_images() {
-[% IF ( AmazonCoverImages ) %]
-
[% END %] + [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] +
+ [% IF ( LocalCoverImages ) %]
[% END %] + [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %] + [% END %][% END %] +
+ [% END %]
    diff --git a/koha-tmpl/opac-tmpl/ccsr/en/js/localcovers.js b/koha-tmpl/opac-tmpl/ccsr/en/js/localcovers.js index f2808ef..93f2b3a 100644 --- a/koha-tmpl/opac-tmpl/ccsr/en/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/ccsr/en/js/localcovers.js @@ -23,6 +23,7 @@ KOHA.LocalCover = { var message = document.createElement("span"); $(message).attr("class","no-image"); $(message).html(NO_LOCAL_JACKET); + $(mydiv).parent().find('.no-image').remove(); $(mydiv).append(message); var img = $("").attr('src', '/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) diff --git a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js index 7bd7ae2..e9d2f9e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js @@ -23,6 +23,7 @@ KOHA.LocalCover = { var message = document.createElement("span"); $(message).attr("class","no-image"); $(message).html(NO_LOCAL_JACKET); + $(mydiv).parent().find('.no-image').remove(); $(mydiv).append(message); var img = $("").attr('src', '/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) -- 1.7.9.5