Bugzilla – Attachment 190911 Details for
Bug 41479
Remove Baker & Taylor integration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41479: Remove Baker & Taylor integration
Bug-41479-Remove-Baker--Taylor-integration.patch (text/plain), 42.21 KB, created by
Owen Leonard
on 2026-01-05 19:12:35 UTC
(
hide
)
Description:
Bug 41479: Remove Baker & Taylor integration
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-01-05 19:12:35 UTC
Size:
42.21 KB
patch
obsolete
>From 1f154065aa963042d83b7820b4651c279e18d0c2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 18 Dec 2025 08:49:32 -0500 >Subject: [PATCH] Bug 41479: Remove Baker & Taylor integration > >This patch removes Baker & Taylor integration following the shutdown of >the company. > >To test, apply the patch, run the database update, and restart all. > >- In the staff interface go to Administration -> System preferences and > search for 'Baker.' There should be no results. >- If necessary enable at least one cover image service, e.g. > AmazonCoverImages, OpacCoce, GoogleJackets, etc. >- Log in to the OPAC and confirm that cover images display correctly on > these pages: > - Search results > - Bibliographic detail page > - Shelf browser > - Your summary -> Checked out > - Checkout history > - Recent comments > - Lists > >Sponsored-by: Athens County Public Libraries >--- > C4/External/BakerTaylor.pm | 169 ------------------ > C4/UsageStats.pm | 1 - > .../data/mysql/atomicupdate/bug_41479.pl | 15 ++ > installer/data/mysql/mandatory/sysprefs.sql | 4 - > .../admin/preferences/enhanced_content.pref | 20 --- > .../bootstrap/en/includes/cover-images.inc | 16 -- > .../bootstrap/en/includes/opac-bottom.inc | 9 - > .../bootstrap/en/includes/shelfbrowser.inc | 10 +- > .../bootstrap/en/modules/opac-detail.tt | 25 --- > .../bootstrap/en/modules/opac-opensearch.tt | 12 -- > .../en/modules/opac-readingrecord.tt | 13 +- > .../bootstrap/en/modules/opac-results.tt | 3 +- > .../bootstrap/en/modules/opac-shelves.tt | 3 +- > .../en/modules/opac-showreviews-rss.tt | 3 - > .../bootstrap/en/modules/opac-showreviews.tt | 8 - > .../bootstrap/en/modules/opac-user.tt | 20 --- > .../opac-tmpl/bootstrap/js/cover_images.js | 4 - > opac/opac-detail.pl | 32 +--- > opac/opac-readingrecord.pl | 9 - > opac/opac-search.pl | 10 -- > opac/opac-shelves.pl | 16 +- > opac/opac-user.pl | 18 +- > t/External/BakerTaylor.t | 36 ---- > 23 files changed, 31 insertions(+), 425 deletions(-) > delete mode 100644 C4/External/BakerTaylor.pm > create mode 100755 installer/data/mysql/atomicupdate/bug_41479.pl > delete mode 100755 t/External/BakerTaylor.t > >diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm >deleted file mode 100644 >index 3da7f84d1bb..00000000000 >--- a/C4/External/BakerTaylor.pm >+++ /dev/null >@@ -1,169 +0,0 @@ >-package C4::External::BakerTaylor; >- >-# Copyright (C) 2008 LibLime >-# <jmf at liblime dot com> >-# >-# This file is part of Koha. >-# >-# Koha is free software; you can redistribute it and/or modify it >-# under the terms of the GNU General Public License as published by >-# the Free Software Foundation; either version 3 of the License, or >-# (at your option) any later version. >-# >-# Koha is distributed in the hope that it will be useful, but >-# WITHOUT ANY WARRANTY; without even the implied warranty of >-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >-# GNU General Public License for more details. >-# >-# You should have received a copy of the GNU General Public License >-# along with Koha; if not, see <https://www.gnu.org/licenses>. >- >-use Modern::Perl; >-use base 'Exporter'; >- >-BEGIN { >- our @EXPORT_OK = qw(availability content_cafe_url image_url link_url http_jacket_link); >-} >- >-use XML::Simple; >-use LWP::Simple qw( get ); >- >-use C4::Context; >- >-use vars qw(%EXPORT_TAGS $VERSION); >- >-BEGIN { >- $VERSION = 3.07.00.049; >-} >- >-# These variables are plack safe: they are initialized each time >-my ( $user, $pass, $agent, $image_url, $link_url ); >- >-sub _initialize { >- $user = ( @_ ? shift : C4::Context->preference('BakerTaylorUsername') ) || ''; # LL17984 >- $pass = ( @_ ? shift : C4::Context->preference('BakerTaylorPassword') ) || ''; # CC82349 >- $link_url = ( @_ ? shift : C4::Context->preference('BakerTaylorBookstoreURL') ); >- $image_url = >- "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value="; >- $agent = "Koha/$VERSION [en] (Linux)"; >- >- #"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this >-} >- >-sub image_url { >- _initialize(); >- ( $user and $pass ) or return; >- my $isbn = ( @_ ? shift : '' ); >- $isbn =~ s/(p|-)//g; # sanitize >- return $image_url . $isbn; >-} >- >-sub link_url { >- _initialize(); >- my $isbn = ( @_ ? shift : '' ); >- $isbn =~ s/(p|-)//g; # sanitize >- $link_url or return; >- return $link_url . $isbn; >-} >- >-sub content_cafe_url { >- _initialize(); >- ( $user and $pass ) or return; >- my $isbn = ( @_ ? shift : '' ); >- $isbn =~ s/(p|-)//g; # sanitize >- return >- "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn"; >-} >- >-sub http_jacket_link { >- _initialize(); >- my $isbn = shift or return; >- $isbn =~ s/(p|-)//g; # sanitize >- my $image = availability($isbn); >- my $alt = "Buy this book"; >- $image and $image = qq(<img class="btjacket" alt="$alt" src="$image" />); >- my $link = &link_url($isbn); >- unless ($link) { return $image || ''; } >- return sprintf qq(<a class="btlink" href="%s">%s</a>), $link, ( $image || $alt ); >-} >- >-sub availability { >- _initialize(); >- my $isbn = shift or return; >- ( $user and $pass ) or return; >- $isbn =~ s/(p|-)//g; # sanitize >- my $url = >- "https://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn"; >- my $content = get($url); >- warn "could not retrieve $url" unless $content; >- my $xmlsimple = XML::Simple->new(); >- my $result = $xmlsimple->XMLin($content); >- >- if ( $result->{Error} ) { >- warn "Error returned to " . __PACKAGE__ . " : " . $result->{Error}; >- } >- my $avail = $result->{Availability}; >- return ( $avail and $avail !~ /^false$/i ) ? &image_url($isbn) : 0; >-} >- >-1; >- >-__END__ >- >-=head1 NAME >- >-C4::External::BakerTaylor >- >-=head1 DESCRIPTION >- >-Functions for retrieving content from Baker and Taylor, inventory availability and "Content Cafe". >- >-The settings for this module are controlled by System Preferences: >- >-These can be overridden for testing purposes using the initialize function. >- >-=head1 FUNCTIONS >- >-=head2 image_url >- >-Missing POD for image_url. >- >-=head2 link_url >- >-Missing POD for link_url. >- >-=head2 content_cafe_url >- >-Missing POD for content_cafe_url. >- >-=head2 http_jacket_link >- >-Missing POD for http_jacket_link. >- >-=head2 availability($isbn); >- >-$isbn is a isbn string >- >-=head1 NOTES >- >-A request with failed authentication might see this back from Baker + Taylor: >- >- <?xml version="1.0" encoding="utf-8"?> >- <InventoryAvailability xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" DateTime="2008-03-07T22:01:25.6520429-05:00" xmlns="http://ContentCafe2.btol.com"> >- <Key Type="Undefined">string</Key> >- <Availability>false</Availability> >- <Error>Invalid UserID</Error> >- </InventoryAvailability> >- >-Such response will trigger a warning for each request (potentially many). Point being, do not leave this module configured with incorrect username and password in production. >- >-=head1 SEE ALSO >- >-LWP::UserAgent >- >-=head1 AUTHOR >- >-Joe Atzberger >-atz AT liblime DOT com >- >-=cut >diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm >index 4492080c097..a02b1d83314 100644 >--- a/C4/UsageStats.pm >+++ b/C4/UsageStats.pm >@@ -234,7 +234,6 @@ sub _shared_preferences { > AmazonCoverImages > OPACAmazonCoverImages > Babeltheque >- BakerTaylorEnabled > GoogleJackets > HTML5MediaEnabled > LibraryThingForLibrariesEnabled >diff --git a/installer/data/mysql/atomicupdate/bug_41479.pl b/installer/data/mysql/atomicupdate/bug_41479.pl >new file mode 100755 >index 00000000000..e64cefca1c2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_41479.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "41479", >+ description => >+ "Remove system preferences BakerTaylorBookstoreURL, BakerTaylorEnabled, BakerTaylorPassword, BakerTaylorUsername", >+ up => sub { >+ my ($args) = @_; >+ my $dbh = $args->{dbh}; >+ >+ $dbh->do( >+ q{ DELETE FROM systempreferences WHERE variable IN ('BakerTaylorBookstoreURL', 'BakerTaylorEnabled', 'BakerTaylorPassword', 'BakerTaylorUsername')} >+ ); >+ }, >+ } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 734150ba931..2b394383d03 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -113,10 +113,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('Babeltheque','0','','Turn ON Babeltheque content - See babeltheque.com to subscribe to this service','YesNo'), > ('Babeltheque_url_js','','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','Free'), > ('Babeltheque_url_update','','','Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)','Free'), >-('BakerTaylorBookstoreURL','','','URL template for \"My Libary Bookstore\" links, to which the \"key\" value is appended, and \"https://\" is prepended. It should include your hostname and \"Parent Number\". Make this variable empty to turn MLB links off. Example: ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=',''), >-('BakerTaylorEnabled','0','','Enable or disable all Baker & Taylor features.','YesNo'), >-('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Free'), >-('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Free'), > ('BarcodeSeparators','\\s\\r\\n','','Splitting characters for barcodes','Free'), > ('BasketConfirmations','1','always ask for confirmation.|do not ask for confirmation.','When closing or reopening a basket,','Choice'), > ('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref >index 1f088136f49..b577f7d139e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref >@@ -64,26 +64,6 @@ Enhanced content: > - pref: Babeltheque_url_update > class: url > - (e.g. http://www.babeltheque.com/.../file.csv.bz2). >- Baker and Taylor: >- - >- - pref: BakerTaylorEnabled >- choices: >- 1: Add >- 0: "Don't add" >- - Baker and Taylor links and cover images to the OPAC and staff interface. This requires that you have entered in a username and password (which can be seen in image links). >- - >- - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://' >- - pref: BakerTaylorBookstoreURL >- class: url >- - <em>isbn</em></code> (this should be filled in with something like <code>ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=</code>). Leave it blank to disable these links. >- - >- - Access Baker and Taylor using username >- - pref: BakerTaylorUsername >- class: password >- - and password >- - pref: BakerTaylorPassword >- class: password >- - . > Novelist Select: > - > - pref: NovelistSelectEnabled >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >index 16f7fe26984..6ff39db6f1d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc >@@ -81,22 +81,6 @@ > </div> > [% END %] > >- [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled && bt_id ) %] >- <div class="cover-image bakertaylor-coverimg"> >- [% IF BakerTaylorBookstoreURL %] >- <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]"> >- <img alt="See Baker & Taylor" id="bakertaylor-thumbnail-[% SEARCH_RESULT.biblionumber | html %]" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" /> >- </a> >- [% ELSE %] >- <a href="[% BakerTaylorImageURL | url %][% bt_id | uri %]"> >- <img alt="See Baker & Taylor" id="bakertaylor-thumbnail-[% SEARCH_RESULT.biblionumber | html %]" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" /> >- </a> >- [% END %] >- <div class="hint">Image from Baker & Taylor</div> >- </div> >- [% END %] >- > [% IF OPACCustomCoverImages %] > [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %] > [% IF custom_cover_image_url %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 825846e29af..75060152d90 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -159,15 +159,6 @@ > [% Asset.js("js/localcovers.js") | $raw %] > [% END %] > >-[% IF ( BakerTaylorEnabled ) %] >- [% Asset.js("js/bakertaylorimages.js") | $raw %] >- <script> >- $(window).load(function () { >- bt_verify_images(); >- }); >- </script> >-[% END %] >- > [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %] > <script> > $("#news-branch-select").change(function () { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >index f96ce899d2b..71e859a48b3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >@@ -32,7 +32,7 @@ > [% img_title = item.biblionumber %] > [% END %] > >- [% IF ( OPACLocalCoverImages || OPACAmazonCoverImages || ( SyndeticsEnabled && SyndeticsCoverImages ) || GoogleJackets || BakerTaylorEnabled || ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) || ( Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') ) ) %] >+ [% IF ( OPACLocalCoverImages || OPACAmazonCoverImages || ( SyndeticsEnabled && SyndeticsCoverImages ) || GoogleJackets || ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) || ( Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') ) ) %] > <a > class="shelfbrowser_cover" > href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% item.biblionumber | uri %]&shelfbrowse_itemnumber=[% item.itemnumber | uri %]#shelfbrowser" >@@ -73,14 +73,6 @@ > [% coce_id = item.browser_normalized_ean || item.browser_normalized_isbn | html %] > <div title="[% img_title | html %]" class="[% coce_id | html %]" id="coce-thumbnail-preview-[% coce_id | html %]"></div> > [% END %] >- [% IF ( BakerTaylorEnabled ) %] >- [% bt_id = ( item.browser_normalized_upc || item.browser_normalized_isbn ) | html %] >- [% IF ( bt_id ) %] >- <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /> >- [% ELSE %] >- <span class="no-image">No cover image available</span> >- [% END %] >- [% END %] > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = item.biblio_object.custom_cover_image_url %] > [% IF custom_cover_image_url %] >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 63e004d0291..40a67dc35e2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -148,22 +148,6 @@ > </div> > [% END %] > >- [% bt_id = ( normalized_upc || normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled && bt_id ) %] >- <div class="cover-image" id="bakertaylor-coverimg"> >- [% IF BakerTaylorBookstoreURL %] >- <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]"> >- <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" /> >- </a> >- [% ELSE %] >- <a href="[% BakerTaylorImageURL | url %][% bt_id | uri %]"> >- <img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" /> >- </a> >- [% END %] >- <div class="hint">Image from Baker & Taylor</div> >- </div> >- [% END %] >- > [% IF Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = biblio.custom_cover_image_url %] > [% IF custom_cover_image_url %] >@@ -405,13 +389,6 @@ > </form> > [% END # / IF OpacStarRatings != 'disable' %] > >- [% IF ( BakerTaylorContentURL ) %] >- <span class="results_summary"> >- <span class="label">Enhanced content: </span> >- [% IF ( OPACURLOpenInNewWindow ) %]<a href="[% BakerTaylorContentURL | url %]" target="_blank" rel="noreferrer">Content Cafe</a>[% ELSE %]<a href="[% BakerTaylorContentURL | url %]">Content Cafe</a>[% END %] >- </span> >- [% END # / IF BakerTaylorContentURL %] >- > [% IF ( NovelistSelectProfile && (normalized_isbn || normalized_upc) ) %] > [% IF ( NovelistSelectView == 'above') %] > <span class="results_summary NovelistSelect" style="display:none;"> >@@ -1742,8 +1719,6 @@ > } > div.find(".hint").html(coce_description); > lightbox_descriptions.push(coce_description); >- } else if ( div.attr("id") == "bakertaylor-coverimg" ){ >- lightbox_descriptions.push(_("Image from Baker & Taylor")); > } else if ( div.attr("class") == "cover-image local-coverimg" ) { > lightbox_descriptions.push(_("Local cover image")); > } else { >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 e710ff29889..a2669f1b1cc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt >@@ -80,12 +80,6 @@ > [% END %] > [% END %] > [% END %] >- [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled ) %] >- [% IF bt_id %] >- <![CDATA[ <a href="https://[% BakerTaylorBookstoreURL |url %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |url %][% bt_id | uri %]" /></a> ]]> >- [% END %] >- [% END %] > > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %] >@@ -192,12 +186,6 @@ > [% END %] > [% END %] > [% END %] >- [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled ) %] >- [% IF bt_id %] >- <a href="https://[% BakerTaylorBookstoreURL |url %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |url %][% bt_id | uri %]" /></a> >- [% END %] >- [% END %] > > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %] >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 85f083cecbe..a285fd52136 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >@@ -164,19 +164,8 @@ > [% END %] > [% END %] > >- [% IF Koha.Preference( "BakerTaylorEnabled" ) || Koha.Preference( "SyndeticsEnabled" ) && Koha.Preference( "SyndeticsCoverImages" ) %] >+ [% IF Koha.Preference( "SyndeticsEnabled" ) && Koha.Preference( "SyndeticsCoverImages" ) %] > [% SET normalized_upc = biblio.normalized_upc %] >- [% END %] >- [% IF Koha.Preference( "BakerTaylorEnabled" ) %] >- [% bt_id = ( normalized_upc || normalized_isbn ) %] >- [% IF ( bt_id ) %] >- <a href="https://[% Koha.Preference( "BakerTaylorBookstoreURL" ) | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a> >- [% ELSE %] >- <span class="no-image">No cover image available</span> >- [% END %] >- [% END %] >- >- [% IF SyndeticsEnabled && SyndeticsCoverImages %] > <img > src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&client=[% SyndeticsClientCode | html %]&type=xw10&upc=[% normalized_upc | html %]&oclc=[% biblio.normalized_oclc | html %]" > alt="" >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 96eae27072f..26fd5221894 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -22,9 +22,8 @@ > [% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %] > [% SET GoogleJackets = Koha.Preference('GoogleJackets') %] > [% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %] >-[% SET BakerTaylorEnabled = Koha.Preference('BakerTaylorEnabled') %] > [% SET OPACCoce = ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') ) %] >-[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || BakerTaylorEnabled || OPACCoce || OPACCustomCoverImages ) %] >+[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || OPACCoce || OPACCustomCoverImages ) %] > [% SET CoverImages = 1 %] > [% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %] > [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] >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 0bdb569c82f..86d16a454d7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -23,9 +23,8 @@ > [% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %] > [% SET GoogleJackets = Koha.Preference('GoogleJackets') %] > [% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %] >-[% SET BakerTaylorEnabled = Koha.Preference('BakerTaylorEnabled') %] > [% SET OPACCoce = ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') ) %] >-[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || BakerTaylorEnabled || OPACCoce || OPACCustomCoverImages ) %] >+[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || OPACCoce || OPACCustomCoverImages ) %] > [% SET CoverImages = 1 %] > [% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %] > [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] >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 5246b9d3e2c..a19b5ca2a61 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 >@@ -27,9 +27,6 @@ > /> > [% END %][% END %][% END %] > >- [% bt_id = ( review.normalized_upc || review.normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled && bt_id ) %]<a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>[% END %] >- > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %] > [% IF custom_cover_image_url %] >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 71b8374b627..73e20164060 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt >@@ -139,14 +139,6 @@ > [% END %] > [% END %] > </a> >- [% bt_id = ( review.normalized_upc || review.normalized_isbn ) %] >- [% IF ( BakerTaylorEnabled ) %] >- [% IF ( bt_id ) %] >- <a href="https://[% review.BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% review.BakerTaylorImageURL | html %][% bt_id | html %]" /></a> >- [% ELSE %] >- <span class="no-image">No cover image available</span> >- [% END %] >- [% END %] > > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %] >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 27d287c20b2..be396352af0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -359,16 +359,6 @@ > [% END %] > [% END %] > >- [% IF ( BakerTaylorEnabled ) %] >- [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %] >- [% IF ( bt_id ) %] >- <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a> >- [% ELSE %] >- <span class="no-image">No cover image available</span >- ><!-- BakerTaylor needs normalized_upc or normalized_isbn! --> >- [% END %] >- [% END %] >- > [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] > [% SET custom_cover_image_url = ISSUE.biblio_object.custom_cover_image_url %] > [% IF custom_cover_image_url %] >@@ -730,16 +720,6 @@ > [% END %] > [% END %] > >- [% IF ( BakerTaylorEnabled ) %] >- [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %] >- [% IF ( bt_id ) %] >- <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a> >- [% ELSE %] >- <span class="no-image">No cover image available</span >- ><!-- BakerTaylor needs normalized_upc or normalized_isbn! --> >- [% END %] >- [% END %] >- > [% IF ( SyndeticsCoverImages ) %] > <img > src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&client=[% SyndeticsClientCode | html %]&upc=[% OVERDUE.normalized_upc | html %]&oclc=[% OVERDUE.normalized_oclc | html %]&type=xw10" >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/cover_images.js b/koha-tmpl/opac-tmpl/bootstrap/js/cover_images.js >index ceb9174df24..a1b0325f399 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/cover_images.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/cover_images.js >@@ -73,10 +73,6 @@ function verify_cover_images() { > } > div.find(".hint").html(coce_description); > lightbox_descriptions.push(coce_description); >- } else if (div.hasClass("bakertaylor-coverimg")) { >- lightbox_descriptions.push( >- __("Image from Baker & Taylor") >- ); > } else if (div.hasClass("cover-image local-coverimg")) { > lightbox_descriptions.push(__("Local cover image")); > } else { >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index edf609cb021..daf387bbc0a 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -43,12 +43,11 @@ use C4::Biblio qw( > GetMarcSubjects > GetMarcUrls > ); >-use C4::Record qw( marc2cites ); >-use C4::Tags qw( get_tags ); >-use C4::XISBN qw( get_xisbns ); >-use C4::External::Amazon qw( get_amazon_tld ); >-use C4::External::BakerTaylor qw( image_url link_url ); >-use C4::External::Syndetics qw( >+use C4::Record qw( marc2cites ); >+use C4::Tags qw( get_tags ); >+use C4::XISBN qw( get_xisbns ); >+use C4::External::Amazon qw( get_amazon_tld ); >+use C4::External::Syndetics qw( > get_syndetics_anotes > get_syndetics_excerpt > get_syndetics_index >@@ -1142,27 +1141,6 @@ if ( C4::Context->preference("OPACShelfBrowser") ) { > > $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages") ); > >-if ( C4::Context->preference("BakerTaylorEnabled") ) { >- $template->param( >- BakerTaylorEnabled => 1, >- BakerTaylorImageURL => &image_url(), >- BakerTaylorLinkURL => &link_url(), >- BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), >- ); >- my ( $bt_user, $bt_pass ); >- if ( $isbn >- and $bt_user = C4::Context->preference('BakerTaylorUsername') >- and $bt_pass = C4::Context->preference('BakerTaylorPassword') ) >- { >- $template->param( >- BakerTaylorContentURL => sprintf( >- "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", >- $bt_user, $bt_pass, $isbn >- ) >- ); >- } >-} >- > my $tag_quantity; > if ( C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail') ) { > $template->param( >diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl >index 202c580686b..84394b8a87b 100755 >--- a/opac/opac-readingrecord.pl >+++ b/opac/opac-readingrecord.pl >@@ -21,7 +21,6 @@ use CGI qw ( -utf8 ); > > use C4::Auth qw( get_template_and_user ); > use C4::Biblio; >-use C4::External::BakerTaylor qw( image_url link_url ); > use MARC::Record; > > use C4::Output qw( output_html_with_http_headers ); >@@ -87,14 +86,6 @@ my $old_checkouts = [ > )->as_list > ]; > >-if ( C4::Context->preference('BakerTaylorEnabled') ) { >- $template->param( >- JacketImages => 1, >- BakerTaylorImageURL => &image_url(), >- BakerTaylorLinkURL => &link_url(), >- ); >-} >- > my $saving_display = C4::Context->preference('OPACShowSavings'); > if ( $saving_display =~ /checkouthistory/ ) { > $template->param( savings => $patron->get_savings ); >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index db9dc776c3f..b6ca32ba480 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -54,7 +54,6 @@ use C4::Koha qw( GetItemTypesCategorized getitemtypeimagelocation GetAuthorise > use C4::Tags qw( get_tags ); > use C4::SocialData; > use C4::External::OverDrive; >-use C4::External::BakerTaylor qw( image_url link_url ); > > use Koha::CirculationRules; > use Koha::Libraries; >@@ -173,15 +172,6 @@ $template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResults > > $template->param( OpacStarRatings => C4::Context->preference("OpacStarRatings") ); > >-if ( C4::Context->preference('BakerTaylorEnabled') ) { >- $template->param( >- BakerTaylorEnabled => 1, >- BakerTaylorImageURL => &image_url(), >- BakerTaylorLinkURL => &link_url(), >- BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), >- ); >-} >- > ## URI Re-Writing > # Deprecated, but preserved because it's interesting :-) > # The same thing can be accomplished with mod_rewrite in >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 1f999d827ca..55e4870d1aa 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -19,11 +19,10 @@ > > use Modern::Perl; > >-use CGI qw ( -utf8 ); >-use C4::Auth qw( get_template_and_user ); >-use C4::Biblio qw( GetBiblioData GetFrameworkCode ); >-use C4::External::BakerTaylor qw( image_url link_url ); >-use C4::Koha qw( >+use CGI qw ( -utf8 ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Biblio qw( GetBiblioData GetFrameworkCode ); >+use C4::Koha qw( > GetNormalizedEAN > GetNormalizedISBN > GetNormalizedOCLCNumber >@@ -83,13 +82,6 @@ if ( $op eq 'view' || $op eq 'list' ) { > ); > } > >-if ( C4::Context->preference("BakerTaylorEnabled") ) { >- $template->param( >- BakerTaylorImageURL => &image_url(), >- BakerTaylorLinkURL => &link_url(), >- ); >-} >- > my $referer = $query->param('referer') || $op; > my $page = int( $query->param('page') || 1 ); > my $public = 0; >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index e0671b33aa5..d326c3053ed 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -28,9 +28,8 @@ use C4::Koha qw( > GetNormalizedUPC > GetNormalizedOCLCNumber > ); >-use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges ); >-use C4::External::BakerTaylor qw( image_url link_url ); >-use C4::Reserves qw( GetReserveStatus ); >+use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges ); >+use C4::Reserves qw( GetReserveStatus ); > use C4::Members; > use C4::Output qw( output_html_with_http_headers ); > use Koha::Account::Lines; >@@ -298,8 +297,7 @@ if ( $pending_checkouts->count ) { # Useless test > my $isbn = GetNormalizedISBN( $issue->{'isbn'} ); > $issue->{normalized_isbn} = $isbn; > >- if ( C4::Context->preference('BakerTaylorEnabled') >- || C4::Context->preference('SyndeticsEnabled') >+ if ( C4::Context->preference('SyndeticsEnabled') > || C4::Context->preference('SyndeticsCoverImages') ) > { > my $marcrecord = $biblio_object->metadata_record( >@@ -357,18 +355,8 @@ if ( C4::Context->preference('UseRecalls') ) { > $template->param( RECALLS => $recalls ); > } > >-if ( C4::Context->preference('BakerTaylorEnabled') ) { >- $template->param( >- BakerTaylorEnabled => 1, >- BakerTaylorImageURL => &image_url(), >- BakerTaylorLinkURL => &link_url(), >- BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), >- ); >-} >- > if ( C4::Context->preference("OPACAmazonCoverImages") > or C4::Context->preference("GoogleJackets") >- or C4::Context->preference("BakerTaylorEnabled") > or C4::Context->preference("SyndeticsCoverImages") > or ( C4::Context->preference('OPACCustomCoverImages') and C4::Context->preference('CustomCoverImagesURL') ) ) > { >diff --git a/t/External/BakerTaylor.t b/t/External/BakerTaylor.t >deleted file mode 100755 >index 54a0adab869..00000000000 >--- a/t/External/BakerTaylor.t >+++ /dev/null >@@ -1,36 +0,0 @@ >-#!/usr/bin/perl >- >-# some simple tests of the elements of C4::External::BakerTaylor that do not require a valid username and password >- >-use Modern::Perl; >- >-use Test::NoWarnings; >-use Test::More tests => 10; >-use t::lib::Mocks; >- >-BEGIN { >- use_ok( 'C4::External::BakerTaylor', qw( link_url image_url content_cafe_url http_jacket_link availability ) ); >-} >- >-# test with mocked prefs >-my $username = "testing_username"; >-my $password = "testing_password"; >-my $link_url = "http://wrongexample.com?ContentCafe.aspx?UserID=$username"; >- >-t::lib::Mocks::mock_preference( 'BakerTaylorUsername', $username ); >-t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password ); >-t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url ); >- >-my $image_url = >- "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value="; >-my $content_cafe = >- "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey="; >- >-is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url" ); >-is( C4::External::BakerTaylor::image_url("aa"), $image_url . "aa", "testing image url construction" ); >-is( C4::External::BakerTaylor::link_url(), $link_url, "testing default link url" ); >-is( C4::External::BakerTaylor::link_url("bb"), "${link_url}bb", "testing link url construction" ); >-is( C4::External::BakerTaylor::content_cafe_url(""), $content_cafe, "testing default content cafe url" ); >-is( C4::External::BakerTaylor::content_cafe_url("cc"), "${content_cafe}cc", "testing content cafe url construction" ); >-is( C4::External::BakerTaylor::http_jacket_link(""), undef, "testing empty http jacket link" ); >-is( C4::External::BakerTaylor::availability(""), undef, "testing empty availability" ); >-- >2.39.5
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 41479
:
190911
|
190912
|
192126
|
192134
|
192636