View | Details | Raw Unified | Return to bug 28307
Collapse All | Expand All

(-)a/catalogue/detail.pl (+22 lines)
Lines 39-44 use C4::Reserves; Link Here
39
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
39
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
40
use C4::XISBN qw( get_xisbns );
40
use C4::XISBN qw( get_xisbns );
41
use C4::External::Amazon qw( get_amazon_tld );
41
use C4::External::Amazon qw( get_amazon_tld );
42
use C4::External::BakerTaylor qw( image_url link_url );
42
use C4::Search qw( z3950_search_args enabled_staff_search_views );
43
use C4::Search qw( z3950_search_args enabled_staff_search_views );
43
use C4::Tags qw( get_tags );
44
use C4::Tags qw( get_tags );
44
use C4::XSLT qw( XSLTParse4Display );
45
use C4::XSLT qw( XSLTParse4Display );
Lines 502-507 foreach ( keys %{$dat} ) { Link Here
502
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
503
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
503
# method query not found?!?!
504
# method query not found?!?!
504
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
505
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
506
507
if (C4::Context->preference("BakerTaylorEnabled")) {
508
    $template->param(
509
        BakerTaylorEnabled  => 1,
510
        BakerTaylorImageURL => &image_url(),
511
        BakerTaylorLinkURL  => &link_url(),
512
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
513
    );
514
    my ($bt_user, $bt_pass);
515
    if ($isbn and
516
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
517
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
518
    {
519
        $template->param(
520
        BakerTaylorContentURL   =>
521
        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
522
                $bt_user,$bt_pass,$isbn)
523
        );
524
    }
525
}
526
505
$template->param(
527
$template->param(
506
    itemloop        => \@itemloop,
528
    itemloop        => \@itemloop,
507
    otheritemloop   => \@otheritemloop,
529
    otheritemloop   => \@otheritemloop,
(-)a/installer/data/mysql/atomicupdate/bug-28307-BakerTaylorEnabled-staff.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do("UPDATE systempreferences SET `variable` = 'OPACBakerTaylorEnabled', `explanation` = 'Enable or disable all Baker & Taylor features in the OPAC' WHERE `variable` = 'BakerTaylorEnabled'");
5
    $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, options, type) VALUES ( 'BakerTaylorEnabled', '0', 'Enable or disable all Baker & Taylor features in the staff interface', NULL, 'YesNo' )");
6
7
    # Always end with this (adjust the bug info)
8
    NewVersion( $DBversion, 28307, "Bug 28307: Make BakerTaylorEnabled preference separate for staff and OPAC");
9
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-3 / +9 lines)
Lines 80-99 Enhanced content: Link Here
80
            - pref: Babeltheque_url_update
80
            - pref: Babeltheque_url_update
81
              class: url
81
              class: url
82
            - (e.g. http://www.babeltheque.com/.../file.csv.bz2).
82
            - (e.g. http://www.babeltheque.com/.../file.csv.bz2).
83
    Baker and Taylor:
83
    Baker & Taylor:
84
        -
84
        -
85
            - pref: BakerTaylorEnabled
85
            - pref: BakerTaylorEnabled
86
              choices:
86
              choices:
87
                  1: Add
87
                  1: Add
88
                  0: "Don't add"
88
                  0: "Don't add"
89
            - 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).
89
            - Baker & Taylor links and cover images to the staff interface. This requires that you have entered your <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BakerTaylorUsername">BakerTaylorUsername</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BakerTaylorPassword">BakerTaylorPassword</a> (which will be publicly visible in image links).
90
        -
91
            - pref: OPACBakerTaylorEnabled
92
              choices:
93
                  1: Add
94
                  0: "Don't add"
95
            - Baker & Taylor links and cover images to the OPAC. This requires that you have entered your <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BakerTaylorUsername">BakerTaylorUsername</a> and <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BakerTaylorPassword">BakerTaylorPassword</a> (which will be publicly visible in image links).
90
        -
96
        -
91
            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
97
            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
92
            - pref: BakerTaylorBookstoreURL
98
            - pref: BakerTaylorBookstoreURL
93
              class: url
99
              class: url
94
            - <em>isbn</em></code> (this should be filled in with something like <code>ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&amp;parentNum=10923&amp;key=</code>). Leave it blank to disable these links.
100
            - <em>isbn</em></code> (this should be filled in with something like <code>ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&amp;parentNum=10923&amp;key=</code>). Leave it blank to disable these links.
95
        -
101
        -
96
            - Access Baker and Taylor using username
102
            - Access Baker & Taylor using username
97
            - pref: BakerTaylorUsername
103
            - pref: BakerTaylorUsername
98
              class: password
104
              class: password
99
            - and password
105
            - and password
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+20 lines)
Lines 241-246 Link Here
241
                        </div>
241
                        </div>
242
                    [% END %]
242
                    [% END %]
243
243
244
                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
245
                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
246
                        [% SET BakerTaylorImageURL = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=${ Koha.Preference('BakerTaylorUsername') }&Password=${ Koha.Preference('BakerTaylorPassword') }&Options=Y&Return=T&Type=S&Value=$bt_id" %]
247
                        <div class="cover-image" id="bakertaylor-coverimg">
248
                            [% IF BakerTaylorBookstoreURL %]
249
                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
250
                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
251
                                </a>
252
                            [% ELSE %]
253
                                <a href="[% BakerTaylorImageURL | url %]">
254
                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
255
                                </a>
256
                            [% END %]
257
                            <div class="hint">Image from Baker &amp; Taylor</div>
258
                        </div>
259
                    [% END %]
260
244
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
261
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
245
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
262
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
246
                        [% IF custom_cover_image_url %]
263
                        [% IF custom_cover_image_url %]
Lines 1080-1085 Note that permanent location is a code, and location may be an authval. Link Here
1080
                                lightbox_descriptions.push(coce_description);
1097
                                lightbox_descriptions.push(coce_description);
1081
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1098
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1082
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1099
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1100
1101
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1102
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1083
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1103
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1084
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1104
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1085
                            } else {
1105
                            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 475-480 Link Here
475
                [% END %]
475
                [% END %]
476
            [% END %]
476
            [% END %]
477
477
478
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
479
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
480
                [% SET BakerTaylorImageURL = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=${ Koha.Preference('BakerTaylorUsername') }&Password=${ Koha.Preference('BakerTaylorPassword') }&Options=Y&Return=T&Type=S&Value=$bt_id" %]
481
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
482
                    [% IF BakerTaylorBookstoreURL %]
483
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
484
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
485
                        </a>
486
                    [% ELSE %]
487
                        <a href="[% BakerTaylorImageURL | url %]">
488
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
489
                        </a>
490
                    [% END %]
491
                    <div class="hint">Image from Baker &amp; Taylor</div>
492
                </div>
493
            [% END %]
494
478
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
495
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
479
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
496
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
480
                [% IF custom_cover_image_url %]
497
                [% IF custom_cover_image_url %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-8 / +11 lines)
Lines 101-116 Link Here
101
                            <div title="[% img_title | html %]" class="[% normalized_isbn | html %]" id="openlibrary-thumbnail-preview"></div>
101
                            <div title="[% img_title | html %]" class="[% normalized_isbn | html %]" id="openlibrary-thumbnail-preview"></div>
102
                        [% END %]
102
                        [% END %]
103
                        [% bt_id = ( normalized_upc || normalized_isbn ) %]
103
                        [% bt_id = ( normalized_upc || normalized_isbn ) %]
104
                        [% IF ( BakerTaylorEnabled && bt_id ) %]
104
                        [% IF ( OPACBakerTaylorEnabled && bt_id ) %]
105
                            [% IF BakerTaylorBookstoreURL %]
105
                            <div class="cover-image" id="bakertaylor-coverimg">
106
                                [% IF ( OPACURLOpenInNewWindow ) %]
106
                                [% IF BakerTaylorBookstoreURL %]
107
                                    <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]" target="_blank" rel="noreferrer"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
107
                                    <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
108
                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
109
                                    </a>
108
                                [% ELSE %]
110
                                [% ELSE %]
109
                                    <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
111
                                    <a href="[% BakerTaylorImageURL | url %][% bt_id | uri%]">
112
                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
113
                                    </a>
110
                                [% END %]
114
                                [% END %]
111
                            [% ELSE %]
115
                                <div class="hint">Image from Baker &amp; Taylor</div>
112
                                <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
116
                            </div>
113
                            [% END %]
114
                        [% END %]
117
                        [% END %]
115
                        [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
118
                        [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
116
                            [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
119
                            [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
(-)a/opac/opac-detail.pl (-3 / +2 lines)
Lines 1116-1124 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
1116
1116
1117
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1117
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1118
1118
1119
if (C4::Context->preference("BakerTaylorEnabled")) {
1119
if (C4::Context->preference("OPACBakerTaylorEnabled")) {
1120
	$template->param(
1120
	$template->param(
1121
		BakerTaylorEnabled  => 1,
1121
        OPACBakerTaylorEnabled  => 1,
1122
		BakerTaylorImageURL => &image_url(),
1122
		BakerTaylorImageURL => &image_url(),
1123
		BakerTaylorLinkURL  => &link_url(),
1123
		BakerTaylorLinkURL  => &link_url(),
1124
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1124
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1125
- 

Return to bug 28307