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

(-)a/catalogue/detail.pl (+22 lines)
Lines 39-44 use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLat Link Here
39
use C4::XISBN qw( get_xisbns );
39
use C4::XISBN qw( get_xisbns );
40
use C4::External::Amazon qw( get_amazon_tld );
40
use C4::External::Amazon qw( get_amazon_tld );
41
use C4::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
41
use C4::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
42
use C4::External::BakerTaylor qw( image_url link_url );
42
use C4::Tags qw( get_tags );
43
use C4::Tags qw( get_tags );
43
use C4::XSLT qw( XSLTParse4Display );
44
use C4::XSLT qw( XSLTParse4Display );
44
use Koha::DateUtils qw( format_sqldatetime );
45
use Koha::DateUtils qw( format_sqldatetime );
Lines 576-581 foreach ( keys %{$dat} ) { Link Here
576
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
577
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
577
# method query not found?!?!
578
# method query not found?!?!
578
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
579
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
580
581
if (C4::Context->preference("BakerTaylorEnabled")) {
582
    $template->param(
583
        BakerTaylorEnabled  => 1,
584
        BakerTaylorImageURL => &image_url(),
585
        BakerTaylorLinkURL  => &link_url(),
586
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
587
    );
588
    my ($bt_user, $bt_pass);
589
    if ($isbn and
590
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
591
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
592
    {
593
        $template->param(
594
        BakerTaylorContentURL   =>
595
        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
596
                $bt_user,$bt_pass,$isbn)
597
        );
598
    }
599
}
600
579
$template->param(
601
$template->param(
580
    itemloop        => \@itemloop,
602
    itemloop        => \@itemloop,
581
    otheritemloop   => \@otheritemloop,
603
    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 255-260 Link Here
255
                            [% END %]
255
                            [% END %]
256
                    [% END %]
256
                    [% END %]
257
257
258
                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
259
                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
260
                        [% 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" %]
261
                        <div class="cover-image" id="bakertaylor-coverimg">
262
                            [% IF BakerTaylorBookstoreURL %]
263
                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
264
                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
265
                                </a>
266
                            [% ELSE %]
267
                                <a href="[% BakerTaylorImageURL | url %]">
268
                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
269
                                </a>
270
                            [% END %]
271
                            <div class="hint">Image from Baker &amp; Taylor</div>
272
                        </div>
273
                    [% END %]
274
258
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
275
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
259
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
276
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
260
                        [% IF custom_cover_image_url %]
277
                        [% IF custom_cover_image_url %]
Lines 1361-1366 Note that permanent location is a code, and location may be an authval. Link Here
1361
                                }
1378
                                }
1362
                                div.find(".hint").html(coce_description);
1379
                                div.find(".hint").html(coce_description);
1363
                                lightbox_descriptions.push(coce_description);
1380
                                lightbox_descriptions.push(coce_description);
1381
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1382
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1364
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1383
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1365
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1384
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1366
                            } else {
1385
                            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 498-503 Link Here
498
                [% END %]
498
                [% END %]
499
            [% END %]
499
            [% END %]
500
500
501
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
502
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
503
                [% 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" %]
504
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
505
                    [% IF BakerTaylorBookstoreURL %]
506
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
507
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
508
                        </a>
509
                    [% ELSE %]
510
                        <a href="[% BakerTaylorImageURL | url %]">
511
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
512
                        </a>
513
                    [% END %]
514
                    <div class="hint">Image from Baker &amp; Taylor</div>
515
                </div>
516
            [% END %]
517
501
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
518
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
502
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
519
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
503
                [% IF custom_cover_image_url %]
520
                [% 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 1104-1112 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
1104
1104
1105
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1105
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1106
1106
1107
if (C4::Context->preference("BakerTaylorEnabled")) {
1107
if (C4::Context->preference("OPACBakerTaylorEnabled")) {
1108
	$template->param(
1108
	$template->param(
1109
		BakerTaylorEnabled  => 1,
1109
        OPACBakerTaylorEnabled  => 1,
1110
		BakerTaylorImageURL => &image_url(),
1110
		BakerTaylorImageURL => &image_url(),
1111
		BakerTaylorLinkURL  => &link_url(),
1111
		BakerTaylorLinkURL  => &link_url(),
1112
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1112
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1113
- 

Return to bug 28307