From bbb6cf94de88da46394d17a446c8906bac31af98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9rick?= Date: Fri, 21 Mar 2014 11:39:13 -0400 Subject: [PATCH] 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 Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/js/localcovers.js | 1 + .../prog/en/modules/catalogue/detail.tt | 34 ++++++++++++++++--- .../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 f044f62247..58e13cf2f4 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 ee5915e774..c3ea895480 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 7bd7ae254a..e9d2f9e941 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")) -- 2.39.5