From 8905857a47fd52cc5e50694067dc6c9b1db017ff Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 3 Apr 2015 08:14:47 -0400 Subject: [PATCH] Bug 12210 - Baker & Taylor book jackets not disabled when BakerTaylorBookstoreURL is not populated The description of the BakerTaylorBookstoreURL syspref says "Baker and Taylor "My Library Bookstore" links should be accessed at https:// isbn (this should be filled in with something like ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=). Leave it blank to disable these links." Leaving this syspref blank does not disable the links. Instead, they are populated without the bookstore URL: the cover image for ISBN 1575725738 will cause koha to make a request to http://1575725738, which will, of course, time out. Leaving BakerTaylorBookstoreURL blank should disable any URL that depends on this syspref, as stated in the syspref description. Test Plan: 1) Apply this patch 2) Enable Baker & Taylor cover images, but *not* BakerTaylorBookstoreURL 3) Perform an OPAC search where you have B&T cover images in the results 4) Note the image links now direct you to the record details Signed-off-by: Sheila Kearns Signed-off-by: Katrin Fischer Only affects Baker & Taylor related parts of the code. Read the code carefully, but couldn't test in the OPAC. Signed-off-by: Tomas Cohen Arazi --- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 10 +++++++--- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) 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 ce188f551a..7cc929e57e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -87,10 +87,14 @@
[% END %] [% IF ( BakerTaylorEnabled && normalized_isbn ) %] - [% IF ( OPACurlOpenInNewWindow ) %] - See Baker & Taylor + [% IF BakerTaylorBookstoreURL %] + [% IF ( OPACurlOpenInNewWindow ) %] + See Baker & Taylor + [% ELSE %] + See Baker & Taylor + [% END %] [% ELSE %] - See Baker & Taylor + See Baker & Taylor [% END %] [% 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 948c069aee..44a1d5c251 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -273,11 +273,21 @@ No cover image available [% END %] [% END %] + + [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %] + [% IF ( SEARCH_RESULT.normalized_isbn ) %] + See Baker & Taylor + [% ELSE %] + No cover image available + [% END %] + [% END %] - [% IF ( BakerTaylorEnabled ) %] + [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %] [% IF ( SEARCH_RESULT.normalized_isbn ) %] - See Baker & Taylor + + See Baker & Taylor + [% ELSE %] No cover image available [% END %] -- 2.39.5