From 282db25024dc567b799a8836cba8eb23a55fe55f 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] [PASSED QA] Bug 11982 - Show local cover image in the intranet biblio details page 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 Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js | 1 + .../prog/en/modules/catalogue/detail.tt | 34 +++++++++++++++++-- koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js | 1 + 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js index f044f62..58e13cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js +++ b/koha-tmpl/intranet-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/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) 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 ee5915e..c3ea895 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -184,6 +184,9 @@ function verify_images() { $("#marcPreview").on("hidden", function(){ $("#marcPreview .modal-body").html("
\"\" "+_("Loading")+"
"); }); + [% IF LocalCoverImages %] + KOHA.LocalCover.GetCoverFromBibnumber(true); + [% END %] }); [% IF ( AmazonCoverImages ) %]$(window).load(function() { @@ -373,8 +376,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 %]

@@ -437,8 +450,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/bootstrap/js/localcovers.js b/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js index 7bd7ae2..e9d2f9e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/bootstrap/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.2.5