From 2c1a39d13923472c7c96babb72debcdb4cb63b67 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 21 Aug 2019 02:24:11 +0000 Subject: [PATCH] Bug 23482: [19.11.x] Fix BakerTaylor cover images on lists While this needs a username/pass to fully test, it should be possible to verify the code changes by comparing to opac-results code To test: 1 - Enable BakerTaylor images 2 - Enter your usernme and password 3 - Do not fill the BookStore URL 4 - Verify OPAC covers are working 5 - Save some times with covers to a public list 6 - Verify they do not display in list 7 - Apply patch 8 - Verify images now work Signed-off-by: Kelly McElligott Signed-off-by: Jonathan Druart --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 15 +++++++++++++-- opac/opac-shelves.pl | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) 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 d0b1b4f318..421515ba97 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -352,10 +352,21 @@ [% END %] - [% IF ( BakerTaylorEnabled ) %] + [% IF ( Koha.Preference('BakerTaylorEnabled') && !Koha.Preference('BakerTaylorBookstoreURL') ) %] [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %] [% IF ( bt_id ) %] - See Baker & Taylor + See Baker & Taylor + [% ELSE %] + No cover image available + [% END %] + [% END %] + + [% IF ( Koha.Preference('BakerTaylorEnabled') && Koha.Preference('BakerTaylorBookstoreURL') ) %] + [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %] + [% IF ( bt_id ) %] + + See Baker & Taylor + [% ELSE %] No cover image available [% END %] diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 1271f1bbf7..e9b41e1986 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -59,6 +59,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ }); my $op = $query->param('op') || 'list'; + +if (C4::Context->preference("BakerTaylorEnabled")) { + $template->param( + BakerTaylorImageURL => &image_url(), + BakerTaylorLinkURL => &link_url(), + ); +} + my $referer = $query->param('referer') || $op; my $category = $query->param('category') || 1; my ( $shelf, $shelfnumber, @messages ); -- 2.11.0