Bugzilla – Attachment 32747 Details for
Bug 11982
Show local cover images in the biblio details page in the intranet.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11982 - Fixed the amazon no image icon.
PASSED-QA-Bug-11982---Fixed-the-amazon-no-image-ic.patch (text/plain), 6.65 KB, created by
Katrin Fischer
on 2014-10-25 20:35:05 UTC
(
hide
)
Description:
[PASSED QA] Bug 11982 - Fixed the amazon no image icon.
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-10-25 20:35:05 UTC
Size:
6.65 KB
patch
obsolete
>From 7cf8e34c0647b99ac2ef62845ec29ec371b21517 Mon Sep 17 00:00:00 2001 >From: mbeaulieu <mbeaulieu@inlibro.com> >Date: Fri, 8 Aug 2014 08:38:20 -0400 >Subject: [PATCH] [PASSED QA] Bug 11982 - Fixed the amazon no image icon. > >A no image icon will only be displayed if both the amazon and local images are missing. >Added hyperlink to details on the local image in the search result page. > modified: koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js > modified: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt > modified: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js | 39 +++++++++++++++++++++- > .../prog/en/modules/catalogue/detail.tt | 4 +-- > .../prog/en/modules/catalogue/results.tt | 15 ++++++--- > 3 files changed, 51 insertions(+), 7 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..8688cc9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >@@ -45,7 +45,44 @@ KOHA.LocalCover = { > } > $(mydiv).children('.no-image').remove(); > } >- }) >+ }); >+ }); >+ }, >+ LoadResultsCovers: function(){ >+ $("div [id^=local-thumbnail]").each(function(i) { >+ var mydiv = this; >+ var message = document.createElement("span"); >+ $(message).attr("class","no-image thumbnail"); >+ $(message).html(NO_LOCAL_JACKET); >+ $(mydiv).append(message); >+ var img = $("<img />"); >+ img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")); >+ img.load(function () { >+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) { >+ //IE HACK >+ try { >+ var otherCovers = $(mydiv).closest('td').find('img'); >+ var nbCovers = otherCovers.length; >+ if(nbCovers > 0){ >+ var badCovers = 0; >+ otherCovers.each(function(){ >+ if(this.naturalWidth <= 1){ >+ $(this).parent().remove(); >+ badCovers++; >+ } >+ }); >+ if(badCovers < nbCovers){ >+ $(mydiv).parent().remove(); >+ } >+ } >+ } >+ catch(err){ >+ } >+ } else { >+ $(mydiv).append(img); >+ $(mydiv).children('.no-image').remove(); >+ } >+ }); > }); > } > }; >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 e3ca17a..35edc85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -175,9 +175,9 @@ function verify_images() { > [% IF ( LocalCoverImages && ! localimages.0 ) %] > showNoImageMessage(); > [% END %] >- [% IF LocalCoverImages %] >+ [% IF LocalCoverImages %] > KOHA.LocalCover.GetCoverFromBibnumber(true); >- [% END %] >+ [% END %] > }); > > [% IF ( AmazonCoverImages ) %]$(window).load(function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 9462fa1..2f9ecc2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -151,7 +151,7 @@ $('#sort_by').change(function() { > [% END %] > [% END %] > >-[% IF LocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] >+[% IF LocalCoverImages %]KOHA.LocalCover.LoadResultsCovers();[% END %] > > }); > >@@ -446,12 +446,19 @@ var holdForPatron = function () { > [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %] > [% IF ( AmazonCoverImages || LocalCoverImages ) %] > <td> >- [% IF ( LocalCoverImages ) %] >+ [% IF ( LocalCoverImages) %] >+ <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]"> > <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span> >+ </a> > [% END %] > [% IF ( AmazonCoverImages ) %] >- <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]"> >- <img src="[% IF ( SEARCH_RESULT.normalized_isbn ) %]https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg[% ELSE %]https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif[% END %]" alt="" class="thumbnail" /> >+ [% IF ( SEARCH_RESULT.normalized_isbn ) %] >+ <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]"> >+ <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" /> >+ [% ELSIF ( !LocalCoverImages ) %] >+ <a class="p1 no-amazon-cover" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]"> >+ <img src="https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" /> >+ [% END %] > </a> > [% END %] > </td> >-- >1.9.1
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 11982
:
26514
|
26515
|
30625
|
30626
|
30627
|
30689
|
30690
|
32636
|
32637
|
32638
|
32746
|
32747
|
32748
|
34813
|
34815
|
34816
|
36626
|
36627
|
36852
|
36853
|
36854
|
114729