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
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
parent
101f292a5a
commit
41ea86bc27
|
|
@ -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
|
|
||||||
|
|
@ -242,7 +242,6 @@ sub _shared_preferences {
|
||||||
AmazonCoverImages
|
AmazonCoverImages
|
||||||
OPACAmazonCoverImages
|
OPACAmazonCoverImages
|
||||||
Babeltheque
|
Babeltheque
|
||||||
BakerTaylorEnabled
|
|
||||||
GoogleJackets
|
GoogleJackets
|
||||||
HTML5MediaEnabled
|
HTML5MediaEnabled
|
||||||
LibraryThingForLibrariesEnabled
|
LibraryThingForLibrariesEnabled
|
||||||
|
|
|
||||||
|
|
@ -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')}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -118,10 +118,6 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES
|
||||||
('Babeltheque','0'),
|
('Babeltheque','0'),
|
||||||
('Babeltheque_url_js',''),
|
('Babeltheque_url_js',''),
|
||||||
('Babeltheque_url_update',''),
|
('Babeltheque_url_update',''),
|
||||||
('BakerTaylorBookstoreURL',''),
|
|
||||||
('BakerTaylorEnabled','0'),
|
|
||||||
('BakerTaylorPassword',''),
|
|
||||||
('BakerTaylorUsername',''),
|
|
||||||
('BarcodeSeparators','\\s\\r\\n'),
|
('BarcodeSeparators','\\s\\r\\n'),
|
||||||
('BasketConfirmations','1'),
|
('BasketConfirmations','1'),
|
||||||
('BatchCheckouts','0'),
|
('BatchCheckouts','0'),
|
||||||
|
|
|
||||||
|
|
@ -64,26 +64,6 @@ Enhanced content:
|
||||||
- pref: Babeltheque_url_update
|
- pref: Babeltheque_url_update
|
||||||
class: url
|
class: url
|
||||||
- (e.g. http://www.babeltheque.com/.../file.csv.bz2).
|
- (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:
|
Novelist Select:
|
||||||
-
|
-
|
||||||
- pref: NovelistSelectEnabled
|
- pref: NovelistSelectEnabled
|
||||||
|
|
|
||||||
|
|
@ -81,22 +81,6 @@
|
||||||
</div>
|
</div>
|
||||||
[% END %]
|
[% 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 %]
|
[% IF OPACCustomCoverImages %]
|
||||||
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
||||||
[% IF custom_cover_image_url %]
|
[% IF custom_cover_image_url %]
|
||||||
|
|
|
||||||
|
|
@ -157,15 +157,6 @@
|
||||||
[% Asset.js("js/localcovers.js") | $raw %]
|
[% Asset.js("js/localcovers.js") | $raw %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% IF ( BakerTaylorEnabled ) %]
|
|
||||||
[% Asset.js("js/bakertaylorimages.js") | $raw %]
|
|
||||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
|
||||||
$(window).load(function () {
|
|
||||||
bt_verify_images();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[% END %]
|
|
||||||
|
|
||||||
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
|
[% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
|
||||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||||
$("#news-branch-select").change(function () {
|
$("#news-branch-select").change(function () {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
[% img_title = item.biblionumber %]
|
[% img_title = item.biblionumber %]
|
||||||
[% END %]
|
[% 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
|
<a
|
||||||
class="shelfbrowser_cover"
|
class="shelfbrowser_cover"
|
||||||
href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% item.biblionumber | uri %]&shelfbrowse_itemnumber=[% item.itemnumber | uri %]#shelfbrowser"
|
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 %]
|
[% 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>
|
<div title="[% img_title | html %]" class="[% coce_id | html %]" id="coce-thumbnail-preview-[% coce_id | html %]"></div>
|
||||||
[% END %]
|
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = item.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = item.biblio_object.custom_cover_image_url %]
|
||||||
[% IF custom_cover_image_url %]
|
[% IF custom_cover_image_url %]
|
||||||
|
|
|
||||||
|
|
@ -148,22 +148,6 @@
|
||||||
</div>
|
</div>
|
||||||
[% END %]
|
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = biblio.custom_cover_image_url %]
|
[% SET custom_cover_image_url = biblio.custom_cover_image_url %]
|
||||||
[% IF custom_cover_image_url %]
|
[% IF custom_cover_image_url %]
|
||||||
|
|
@ -405,13 +389,6 @@
|
||||||
</form>
|
</form>
|
||||||
[% END # / IF OpacStarRatings != 'disable' %]
|
[% 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 ( NovelistSelectProfile && (normalized_isbn || normalized_upc) ) %]
|
||||||
[% IF ( NovelistSelectView == 'above') %]
|
[% IF ( NovelistSelectView == 'above') %]
|
||||||
<span class="results_summary NovelistSelect" style="display:none;">
|
<span class="results_summary NovelistSelect" style="display:none;">
|
||||||
|
|
@ -1793,8 +1770,6 @@
|
||||||
}
|
}
|
||||||
div.find(".hint").html(coce_description);
|
div.find(".hint").html(coce_description);
|
||||||
lightbox_descriptions.push(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") {
|
} else if (div.attr("class") == "cover-image local-coverimg") {
|
||||||
lightbox_descriptions.push(_("Local cover image"));
|
lightbox_descriptions.push(_("Local cover image"));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,6 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
||||||
|
|
@ -192,12 +186,6 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
|
||||||
|
|
|
||||||
|
|
@ -164,19 +164,8 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% 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 %]
|
[% 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
|
<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 %]"
|
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=""
|
alt=""
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,9 @@
|
||||||
[% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %]
|
[% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %]
|
||||||
[% SET GoogleJackets = Koha.Preference('GoogleJackets') %]
|
[% SET GoogleJackets = Koha.Preference('GoogleJackets') %]
|
||||||
[% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %]
|
[% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %]
|
||||||
[% SET BakerTaylorEnabled = Koha.Preference('BakerTaylorEnabled') %]
|
|
||||||
[% SET OPACCoce = ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') ) %]
|
[% SET OPACCoce = ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') ) %]
|
||||||
[% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %]
|
[% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %]
|
||||||
[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || BakerTaylorEnabled || OPACCoce || OPACCustomCoverImages ) %]
|
[% IF ( CoverImagePlugins || OPACLocalCoverImages || OPACAmazonCoverImages || SyndeticsCoverImages || GoogleJackets || OpenLibraryCovers || OPACCoce || OPACCustomCoverImages ) %]
|
||||||
[% SET CoverImages = 1 %]
|
[% SET CoverImages = 1 %]
|
||||||
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
|
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,8 @@
|
||||||
[% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %]
|
[% SET SyndeticsCoverImages = ( Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') ) %]
|
||||||
[% SET GoogleJackets = Koha.Preference('GoogleJackets') %]
|
[% SET GoogleJackets = Koha.Preference('GoogleJackets') %]
|
||||||
[% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %]
|
[% SET OpenLibraryCovers = Koha.Preference('OpenLibraryCovers') %]
|
||||||
[% SET BakerTaylorEnabled = Koha.Preference('BakerTaylorEnabled') %]
|
|
||||||
[% SET OPACCoce = ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') ) %]
|
[% 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 CoverImages = 1 %]
|
||||||
[% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %]
|
[% SET OPACCustomCoverImages = ( Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') ) %]
|
||||||
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
|
[% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,6 @@
|
||||||
/>
|
/>
|
||||||
[% END %][% END %][% END %]
|
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %]
|
||||||
[% IF custom_cover_image_url %]
|
[% IF custom_cover_image_url %]
|
||||||
|
|
|
||||||
|
|
@ -146,14 +146,6 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
</a>
|
</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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %]
|
||||||
|
|
|
||||||
|
|
@ -366,16 +366,6 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% 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') %]
|
[% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
|
||||||
[% SET custom_cover_image_url = ISSUE.biblio_object.custom_cover_image_url %]
|
[% SET custom_cover_image_url = ISSUE.biblio_object.custom_cover_image_url %]
|
||||||
[% IF custom_cover_image_url %]
|
[% IF custom_cover_image_url %]
|
||||||
|
|
@ -737,16 +727,6 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% 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 ) %]
|
[% IF ( SyndeticsCoverImages ) %]
|
||||||
<img
|
<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"
|
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"
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,6 @@ function verify_cover_images() {
|
||||||
}
|
}
|
||||||
div.find(".hint").html(coce_description);
|
div.find(".hint").html(coce_description);
|
||||||
lightbox_descriptions.push(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")) {
|
} else if (div.hasClass("cover-image local-coverimg")) {
|
||||||
lightbox_descriptions.push(__("Local cover image"));
|
lightbox_descriptions.push(__("Local cover image"));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,11 @@ use C4::Biblio qw(
|
||||||
GetMarcSubjects
|
GetMarcSubjects
|
||||||
GetMarcUrls
|
GetMarcUrls
|
||||||
);
|
);
|
||||||
use C4::Record qw( marc2cites );
|
use C4::Record qw( marc2cites );
|
||||||
use C4::Tags qw( get_tags );
|
use C4::Tags qw( get_tags );
|
||||||
use C4::XISBN qw( get_xisbns );
|
use C4::XISBN qw( get_xisbns );
|
||||||
use C4::External::Amazon qw( get_amazon_tld );
|
use C4::External::Amazon qw( get_amazon_tld );
|
||||||
use C4::External::BakerTaylor qw( image_url link_url );
|
use C4::External::Syndetics qw(
|
||||||
use C4::External::Syndetics qw(
|
|
||||||
get_syndetics_anotes
|
get_syndetics_anotes
|
||||||
get_syndetics_excerpt
|
get_syndetics_excerpt
|
||||||
get_syndetics_index
|
get_syndetics_index
|
||||||
|
|
@ -1143,27 +1142,6 @@ if ( C4::Context->preference("OPACShelfBrowser") ) {
|
||||||
|
|
||||||
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages") );
|
$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;
|
my $tag_quantity;
|
||||||
if ( C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail') ) {
|
if ( C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail') ) {
|
||||||
$template->param(
|
$template->param(
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ use CGI qw ( -utf8 );
|
||||||
|
|
||||||
use C4::Auth qw( get_template_and_user );
|
use C4::Auth qw( get_template_and_user );
|
||||||
use C4::Biblio;
|
use C4::Biblio;
|
||||||
use C4::External::BakerTaylor qw( image_url link_url );
|
|
||||||
use MARC::Record;
|
use MARC::Record;
|
||||||
|
|
||||||
use C4::Output qw( output_html_with_http_headers );
|
use C4::Output qw( output_html_with_http_headers );
|
||||||
|
|
@ -87,14 +86,6 @@ my $old_checkouts = [
|
||||||
)->as_list
|
)->as_list
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( C4::Context->preference('BakerTaylorEnabled') ) {
|
|
||||||
$template->param(
|
|
||||||
JacketImages => 1,
|
|
||||||
BakerTaylorImageURL => &image_url(),
|
|
||||||
BakerTaylorLinkURL => &link_url(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $saving_display = C4::Context->preference('OPACShowSavings');
|
my $saving_display = C4::Context->preference('OPACShowSavings');
|
||||||
if ( $saving_display =~ /checkouthistory/ ) {
|
if ( $saving_display =~ /checkouthistory/ ) {
|
||||||
$template->param( savings => $patron->get_savings );
|
$template->param( savings => $patron->get_savings );
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ use C4::Koha qw( GetItemTypesCategorized getitemtypeimagelocation GetAuthorise
|
||||||
use C4::Tags qw( get_tags );
|
use C4::Tags qw( get_tags );
|
||||||
use C4::SocialData;
|
use C4::SocialData;
|
||||||
use C4::External::OverDrive;
|
use C4::External::OverDrive;
|
||||||
use C4::External::BakerTaylor qw( image_url link_url );
|
|
||||||
|
|
||||||
use Koha::CirculationRules;
|
use Koha::CirculationRules;
|
||||||
use Koha::Libraries;
|
use Koha::Libraries;
|
||||||
|
|
@ -173,15 +172,6 @@ $template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResults
|
||||||
|
|
||||||
$template->param( OpacStarRatings => C4::Context->preference("OpacStarRatings") );
|
$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
|
## URI Re-Writing
|
||||||
# Deprecated, but preserved because it's interesting :-)
|
# Deprecated, but preserved because it's interesting :-)
|
||||||
# The same thing can be accomplished with mod_rewrite in
|
# The same thing can be accomplished with mod_rewrite in
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,10 @@
|
||||||
|
|
||||||
use Modern::Perl;
|
use Modern::Perl;
|
||||||
|
|
||||||
use CGI qw ( -utf8 );
|
use CGI qw ( -utf8 );
|
||||||
use C4::Auth qw( get_template_and_user );
|
use C4::Auth qw( get_template_and_user );
|
||||||
use C4::Biblio qw( GetBiblioData GetFrameworkCode );
|
use C4::Biblio qw( GetBiblioData GetFrameworkCode );
|
||||||
use C4::External::BakerTaylor qw( image_url link_url );
|
use C4::Koha qw(
|
||||||
use C4::Koha qw(
|
|
||||||
GetNormalizedEAN
|
GetNormalizedEAN
|
||||||
GetNormalizedISBN
|
GetNormalizedISBN
|
||||||
GetNormalizedOCLCNumber
|
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 $referer = $query->param('referer') || $op;
|
||||||
my $page = int( $query->param('page') || 1 );
|
my $page = int( $query->param('page') || 1 );
|
||||||
my $public = 0;
|
my $public = 0;
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,8 @@ use C4::Koha qw(
|
||||||
GetNormalizedUPC
|
GetNormalizedUPC
|
||||||
GetNormalizedOCLCNumber
|
GetNormalizedOCLCNumber
|
||||||
);
|
);
|
||||||
use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges );
|
use C4::Circulation qw( CanBookBeRenewed GetRenewCount GetIssuingCharges );
|
||||||
use C4::External::BakerTaylor qw( image_url link_url );
|
use C4::Reserves qw( GetReserveStatus );
|
||||||
use C4::Reserves qw( GetReserveStatus );
|
|
||||||
use C4::Members;
|
use C4::Members;
|
||||||
use C4::Output qw( output_html_with_http_headers );
|
use C4::Output qw( output_html_with_http_headers );
|
||||||
use Koha::Account::Lines;
|
use Koha::Account::Lines;
|
||||||
|
|
@ -298,8 +297,7 @@ if ( $pending_checkouts->count ) { # Useless test
|
||||||
my $isbn = GetNormalizedISBN( $issue->{'isbn'} );
|
my $isbn = GetNormalizedISBN( $issue->{'isbn'} );
|
||||||
$issue->{normalized_isbn} = $isbn;
|
$issue->{normalized_isbn} = $isbn;
|
||||||
|
|
||||||
if ( C4::Context->preference('BakerTaylorEnabled')
|
if ( C4::Context->preference('SyndeticsEnabled')
|
||||||
|| C4::Context->preference('SyndeticsEnabled')
|
|
||||||
|| C4::Context->preference('SyndeticsCoverImages') )
|
|| C4::Context->preference('SyndeticsCoverImages') )
|
||||||
{
|
{
|
||||||
my $marcrecord = $biblio_object->metadata_record(
|
my $marcrecord = $biblio_object->metadata_record(
|
||||||
|
|
@ -357,18 +355,8 @@ if ( C4::Context->preference('UseRecalls') ) {
|
||||||
$template->param( RECALLS => $recalls );
|
$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")
|
if ( C4::Context->preference("OPACAmazonCoverImages")
|
||||||
or C4::Context->preference("GoogleJackets")
|
or C4::Context->preference("GoogleJackets")
|
||||||
or C4::Context->preference("BakerTaylorEnabled")
|
|
||||||
or C4::Context->preference("SyndeticsCoverImages")
|
or C4::Context->preference("SyndeticsCoverImages")
|
||||||
or ( C4::Context->preference('OPACCustomCoverImages') and C4::Context->preference('CustomCoverImagesURL') ) )
|
or ( C4::Context->preference('OPACCustomCoverImages') and C4::Context->preference('CustomCoverImagesURL') ) )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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" );
|
|
||||||
Loading…
Reference in New Issue