From 0ba37ddeba81483664b807948a72410e1fc89df3 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Fri, 24 Jul 2015 14:33:56 -0600 Subject: [PATCH] Bug 14607: Baker & Taylor cover images should be accessible by UPC as well as ISBN Test plan (requires Baker and Taylor cover images to be set up and enabled): 1. Create a record with an ISBN that does not have a cover and a UPC that does. 141985934X/085391174929 is one set that works well. 2. Verify that the record shows up as "No image available" in the following OPAC locations: shelf browser, reviews, lists, search and reading record. This will require adding reviews/checkouts/etc. for the record in question. 3. Apply patch. 4. Check the locations again, and verify that the record now has a valid cover image. Signed-off-by: Alexis Rodegerdts Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../opac-tmpl/bootstrap/en/includes/shelfbrowser.inc | 5 +++-- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 9 +++++---- .../bootstrap/en/modules/opac-opensearch.tt | 3 ++- .../bootstrap/en/modules/opac-readingrecord.tt | 5 +++-- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 12 +++++++----- .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 5 +++-- .../bootstrap/en/modules/opac-showreviews-rss.tt | 3 ++- .../bootstrap/en/modules/opac-showreviews.tt | 5 +++-- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 5 +++-- opac/opac-readingrecord.pl | 1 + 10 files changed, 32 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc index 255fac18ae..b0b2970518 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc @@ -58,8 +58,9 @@
[% END %] [% IF ( BakerTaylorEnabled ) %] - [% IF ( item.browser_normalized_isbn ) %] - See Baker & Taylor + [% bt_id = ( item.browser_normalized_upc || item.browser_normalized_upc ) %] + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index e796c49431..1c36c06dfc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -88,15 +88,16 @@ [% IF OpenLibraryCovers %]
[% END %] - [% IF ( BakerTaylorEnabled && normalized_isbn ) %] + [% bt_id = ( normalized_upc || normalized_isbn ) %] + [% IF ( BakerTaylorEnabled && bt_id ) %] [% IF BakerTaylorBookstoreURL %] [% IF ( OPACurlOpenInNewWindow ) %] - See Baker & Taylor + See Baker & Taylor [% ELSE %] - See Baker & Taylor + See Baker & Taylor [% END %] [% ELSE %] - See Baker & Taylor + See Baker & Taylor [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt index 34cfcc5651..e1a9efe156 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -43,7 +43,8 @@ [% END %][% END %][% END %] -[% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]See Baker & Taylor[% END %][% END %] +[% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] +[% IF ( BakerTaylorEnabled ) %][% IF bt_id %]See Baker & Taylor[% END %][% END %]

[% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author |html %]. [% END %] [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place |html %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode |html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear |html %] [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate |html %][% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt index 30643e62df..05b3c84490 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -104,8 +104,9 @@ [% END %] [% IF BakerTaylorEnabled %] - [% IF issue.normalized_isbn %] - See Baker & Taylor + [% bt_id = ( issue.normalized_upc || issue.normalized_isbn ) %] + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index da1d62d3cc..60ecab1499 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -288,8 +288,9 @@ [% END %] [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %] - [% IF ( SEARCH_RESULT.normalized_isbn ) %] - See Baker & Taylor + [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] @@ -297,9 +298,10 @@ [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %] - [% IF ( SEARCH_RESULT.normalized_isbn ) %] - - See Baker & Taylor + [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] + [% IF ( bt_id ) %] + + See Baker & Taylor [% ELSE %] No cover image available diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 3478866a3e..1d72ba8fd8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -333,8 +333,9 @@ [% IF ( BakerTaylorEnabled ) %] - [% IF ( itemsloo.normalized_isbn ) %] - See Baker & Taylor + [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %] + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt index b35441985b..c6d858d590 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt @@ -18,7 +18,8 @@ [% END %][% END %][% END %][% END %] -[% IF ( BakerTaylorEnabled ) %][% IF ( review.normalized_isbn ) %]See Baker & Taylor[% END %][% END %] +[% bt_id = ( review.normalized_upc || review.normalized_isbn ) %] +[% IF ( BakerTaylorEnabled && bt_id ) %]See Baker & Taylor[% END %] [% IF ( review.author ) %]

By [% review.author |html %].

[% END %]

[% IF ( review.place ) %][% review.place |html %] [% END %][% IF ( review.publishercode ) %][% review.publishercode |html %][% END %][% IF ( review.publicationyear ) %] [% review.publicationyear |html %] [% ELSE %][% IF ( review.copyrightdate ) %] [% review.copyrightdate |html %][% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt index 6fca7ec92e..687a6717a1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt @@ -137,9 +137,10 @@ [% END %] [% END %] + [% bt_id = ( review.normalized_upc || review.normalized_isbn ) %] [% IF ( BakerTaylorEnabled ) %] - [% IF ( review.normalized_isbn ) %] - See Baker & Taylor + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 8689c3e4e3..5dfae6d0ad 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -173,8 +173,9 @@ [% END %] [% IF ( BakerTaylorEnabled ) %] - [% IF ( ISSUE.normalized_isbn ) %] - See Baker & Taylor + [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %] + [% IF ( bt_id ) %] + See Baker & Taylor [% ELSE %] No cover image available [% END %] diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index dc87c56dcd..d2fcd47c56 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -97,6 +97,7 @@ foreach my $issue ( @{$issues} ) { C4::Context->preference('marcflavour') ); $issue->{subtitle} = GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} ); + $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, $issue->{frameworkcode} ); } # My Summary HTML if ($opac_summary_html) { -- 2.39.5