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

(-)a/catalogue/detail.pl (+22 lines)
Lines 40-45 use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLat Link Here
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::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
42
use C4::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
43
use C4::External::BakerTaylor qw( image_url link_url );
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 );
45
use Koha::DateUtils qw( format_sqldatetime );
46
use Koha::DateUtils qw( format_sqldatetime );
Lines 575-580 foreach ( keys %{$dat} ) { Link Here
575
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
576
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
576
# method query not found?!?!
577
# method query not found?!?!
577
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
578
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
579
580
if (C4::Context->preference("BakerTaylorEnabled")) {
581
    $template->param(
582
        BakerTaylorEnabled  => 1,
583
        BakerTaylorImageURL => &image_url(),
584
        BakerTaylorLinkURL  => &link_url(),
585
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
586
    );
587
    my ($bt_user, $bt_pass);
588
    if ($isbn and
589
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
590
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
591
    {
592
        $template->param(
593
        BakerTaylorContentURL   =>
594
        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
595
                $bt_user,$bt_pass,$isbn)
596
        );
597
    }
598
}
599
578
$template->param(
600
$template->param(
579
    itemloop        => \@itemloop,
601
    itemloop        => \@itemloop,
580
    otheritemloop   => \@otheritemloop,
602
    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 64-83 Enhanced content: Link Here
64
            - pref: Babeltheque_url_update
64
            - pref: Babeltheque_url_update
65
              class: url
65
              class: url
66
            - (e.g. http://www.babeltheque.com/.../file.csv.bz2).
66
            - (e.g. http://www.babeltheque.com/.../file.csv.bz2).
67
    Baker and Taylor:
67
    Baker & Taylor:
68
        -
68
        -
69
            - pref: BakerTaylorEnabled
69
            - pref: BakerTaylorEnabled
70
              choices:
70
              choices:
71
                  1: Add
71
                  1: Add
72
                  0: "Don't add"
72
                  0: "Don't add"
73
            - 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).
73
            - 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).
74
        -
75
            - pref: OPACBakerTaylorEnabled
76
              choices:
77
                  1: Add
78
                  0: "Don't add"
79
            - 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).
74
        -
80
        -
75
            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
81
            - 'Baker and Taylor "My Library Bookstore" links should be accessed at <code>https://'
76
            - pref: BakerTaylorBookstoreURL
82
            - pref: BakerTaylorBookstoreURL
77
              class: url
83
              class: url
78
            - <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.
84
            - <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.
79
        -
85
        -
80
            - Access Baker and Taylor using username
86
            - Access Baker & Taylor using username
81
            - pref: BakerTaylorUsername
87
            - pref: BakerTaylorUsername
82
              class: password
88
              class: password
83
            - and password
89
            - and password
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+19 lines)
Lines 250-255 Link Here
250
                            [% END %]
250
                            [% END %]
251
                    [% END %]
251
                    [% END %]
252
252
253
                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
254
                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
255
                        [% 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" %]
256
                        <div class="cover-image" id="bakertaylor-coverimg">
257
                            [% IF BakerTaylorBookstoreURL %]
258
                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
259
                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
260
                                </a>
261
                            [% ELSE %]
262
                                <a href="[% BakerTaylorImageURL | url %]">
263
                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
264
                                </a>
265
                            [% END %]
266
                            <div class="hint">Image from Baker &amp; Taylor</div>
267
                        </div>
268
                    [% END %]
269
253
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
270
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
254
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
271
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
255
                        [% IF custom_cover_image_url %]
272
                        [% IF custom_cover_image_url %]
Lines 1352-1357 Note that permanent location is a code, and location may be an authval. Link Here
1352
                                }
1369
                                }
1353
                                div.find(".hint").html(coce_description);
1370
                                div.find(".hint").html(coce_description);
1354
                                lightbox_descriptions.push(coce_description);
1371
                                lightbox_descriptions.push(coce_description);
1372
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1373
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1355
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1374
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1356
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1375
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1357
                            } else {
1376
                            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 491-496 Link Here
491
                [% END %]
491
                [% END %]
492
            [% END %]
492
            [% END %]
493
493
494
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
495
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
496
                [% 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" %]
497
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
498
                    [% IF BakerTaylorBookstoreURL %]
499
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
500
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
501
                        </a>
502
                    [% ELSE %]
503
                        <a href="[% BakerTaylorImageURL | url %]">
504
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
505
                        </a>
506
                    [% END %]
507
                    <div class="hint">Image from Baker &amp; Taylor</div>
508
                </div>
509
            [% END %]
510
494
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
511
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
495
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
512
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
496
                [% IF custom_cover_image_url %]
513
                [% IF custom_cover_image_url %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 118-124 Link Here
118
                            [% END %]
118
                            [% END %]
119
119
120
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
120
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
121
                            [% IF ( BakerTaylorEnabled && bt_id ) %]
121
                            [% IF ( OPACBakerTaylorEnabled && bt_id ) %]
122
                                <div class="cover-image" id="bakertaylor-coverimg">
122
                                <div class="cover-image" id="bakertaylor-coverimg">
123
                                    [% IF BakerTaylorBookstoreURL %]
123
                                    [% IF BakerTaylorBookstoreURL %]
124
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
124
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
(-)a/opac/opac-detail.pl (-3 / +2 lines)
Lines 1125-1133 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
1125
1125
1126
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1126
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1127
1127
1128
if (C4::Context->preference("BakerTaylorEnabled")) {
1128
if (C4::Context->preference("OPACBakerTaylorEnabled")) {
1129
	$template->param(
1129
	$template->param(
1130
		BakerTaylorEnabled  => 1,
1130
        OPACBakerTaylorEnabled  => 1,
1131
		BakerTaylorImageURL => &image_url(),
1131
		BakerTaylorImageURL => &image_url(),
1132
		BakerTaylorLinkURL  => &link_url(),
1132
		BakerTaylorLinkURL  => &link_url(),
1133
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1133
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1134
- 

Return to bug 28307