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 516-521 foreach ( keys %{$dat} ) { Link Here
516
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
517
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
517
# method query not found?!?!
518
# method query not found?!?!
518
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
519
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
520
521
if (C4::Context->preference("BakerTaylorEnabled")) {
522
    $template->param(
523
        BakerTaylorEnabled  => 1,
524
        BakerTaylorImageURL => &image_url(),
525
        BakerTaylorLinkURL  => &link_url(),
526
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
527
    );
528
    my ($bt_user, $bt_pass);
529
    if ($isbn and
530
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
531
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
532
    {
533
        $template->param(
534
        BakerTaylorContentURL   =>
535
        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
536
                $bt_user,$bt_pass,$isbn)
537
        );
538
    }
539
}
540
519
$template->param(
541
$template->param(
520
    itemloop        => \@itemloop,
542
    itemloop        => \@itemloop,
521
    otheritemloop   => \@otheritemloop,
543
    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 1115-1120 Note that permanent location is a code, and location may be an authval. Link Here
1115
                                }
1132
                                }
1116
                                div.find(".hint").html(coce_description);
1133
                                div.find(".hint").html(coce_description);
1117
                                lightbox_descriptions.push(coce_description);
1134
                                lightbox_descriptions.push(coce_description);
1135
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1136
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1118
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1137
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1119
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1138
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1120
                            } else {
1139
                            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 473-478 Link Here
473
                [% END %]
473
                [% END %]
474
            [% END %]
474
            [% END %]
475
475
476
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
477
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
478
                [% 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" %]
479
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
480
                    [% IF BakerTaylorBookstoreURL %]
481
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
482
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
483
                        </a>
484
                    [% ELSE %]
485
                        <a href="[% BakerTaylorImageURL | url %]">
486
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
487
                        </a>
488
                    [% END %]
489
                    <div class="hint">Image from Baker &amp; Taylor</div>
490
                </div>
491
            [% END %]
492
476
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
493
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
477
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
494
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
478
                [% IF custom_cover_image_url %]
495
                [% 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 1117-1125 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
1117
1117
1118
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1118
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1119
1119
1120
if (C4::Context->preference("BakerTaylorEnabled")) {
1120
if (C4::Context->preference("OPACBakerTaylorEnabled")) {
1121
	$template->param(
1121
	$template->param(
1122
		BakerTaylorEnabled  => 1,
1122
        OPACBakerTaylorEnabled  => 1,
1123
		BakerTaylorImageURL => &image_url(),
1123
		BakerTaylorImageURL => &image_url(),
1124
		BakerTaylorLinkURL  => &link_url(),
1124
		BakerTaylorLinkURL  => &link_url(),
1125
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1125
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1126
- 

Return to bug 28307