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 511-516 foreach ( keys %{$dat} ) { Link Here
511
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
512
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
512
# method query not found?!?!
513
# method query not found?!?!
513
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
514
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
515
516
if (C4::Context->preference("BakerTaylorEnabled")) {
517
    $template->param(
518
        BakerTaylorEnabled  => 1,
519
        BakerTaylorImageURL => &image_url(),
520
        BakerTaylorLinkURL  => &link_url(),
521
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
522
    );
523
    my ($bt_user, $bt_pass);
524
    if ($isbn and
525
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
526
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
527
    {
528
        $template->param(
529
        BakerTaylorContentURL   =>
530
        sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
531
                $bt_user,$bt_pass,$isbn)
532
        );
533
    }
534
}
535
514
$template->param(
536
$template->param(
515
    itemloop        => \@itemloop,
537
    itemloop        => \@itemloop,
516
    otheritemloop   => \@otheritemloop,
538
    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 236-241 Link Here
236
                        </div>
236
                        </div>
237
                    [% END %]
237
                    [% END %]
238
238
239
                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
240
                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
241
                        [% 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" %]
242
                        <div class="cover-image" id="bakertaylor-coverimg">
243
                            [% IF BakerTaylorBookstoreURL %]
244
                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
245
                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
246
                                </a>
247
                            [% ELSE %]
248
                                <a href="[% BakerTaylorImageURL | url %]">
249
                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
250
                                </a>
251
                            [% END %]
252
                            <div class="hint">Image from Baker &amp; Taylor</div>
253
                        </div>
254
                    [% END %]
255
239
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
256
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
240
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
257
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
241
                        [% IF custom_cover_image_url %]
258
                        [% IF custom_cover_image_url %]
Lines 1094-1099 Note that permanent location is a code, and location may be an authval. Link Here
1094
                                }
1111
                                }
1095
                                div.find(".hint").html(coce_description);
1112
                                div.find(".hint").html(coce_description);
1096
                                lightbox_descriptions.push(coce_description);
1113
                                lightbox_descriptions.push(coce_description);
1114
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1115
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1097
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1116
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1098
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1117
                                lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1099
                            } else {
1118
                            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 466-471 Link Here
466
                [% END %]
466
                [% END %]
467
            [% END %]
467
            [% END %]
468
468
469
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
470
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
471
                [% 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" %]
472
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
473
                    [% IF BakerTaylorBookstoreURL %]
474
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
475
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
476
                        </a>
477
                    [% ELSE %]
478
                        <a href="[% BakerTaylorImageURL | url %]">
479
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
480
                        </a>
481
                    [% END %]
482
                    <div class="hint">Image from Baker &amp; Taylor</div>
483
                </div>
484
            [% END %]
485
469
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
486
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
470
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
487
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
471
                [% IF custom_cover_image_url %]
488
                [% 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