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

(-)a/catalogue/detail.pl (-7 / +30 lines)
Lines 34-46 use C4::Output qw( output_html_with_http_headers ); Link Here
34
use C4::Biblio  qw( GetBiblioData GetFrameworkCode );
34
use C4::Biblio  qw( GetBiblioData GetFrameworkCode );
35
use C4::Items   qw( GetAnalyticsCount );
35
use C4::Items   qw( GetAnalyticsCount );
36
use C4::Reserves;
36
use C4::Reserves;
37
use C4::Serials          qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
37
use C4::Serials               qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
38
use C4::XISBN            qw( get_xisbns );
38
use C4::XISBN                 qw( get_xisbns );
39
use C4::External::Amazon qw( get_amazon_tld );
39
use C4::External::Amazon      qw( get_amazon_tld );
40
use C4::Search           qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
40
use C4::Search                qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
41
use C4::Tags             qw( get_tags );
41
use C4::External::BakerTaylor qw( image_url link_url );
42
use C4::XSLT             qw( XSLTParse4Display );
42
use C4::Tags                  qw( get_tags );
43
use Koha::DateUtils      qw( format_sqldatetime );
43
use C4::XSLT                  qw( XSLTParse4Display );
44
use Koha::DateUtils           qw( format_sqldatetime );
44
use C4::HTML5Media;
45
use C4::HTML5Media;
45
use C4::CourseReserves qw( GetItemCourseReservesInfo );
46
use C4::CourseReserves qw( GetItemCourseReservesInfo );
46
use Koha::AuthorisedValues;
47
use Koha::AuthorisedValues;
Lines 435-440 foreach ( keys %{$dat} ) { Link Here
435
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
436
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
436
# method query not found?!?!
437
# method query not found?!?!
437
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages") );
438
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages") );
439
440
if ( C4::Context->preference("BakerTaylorEnabled") ) {
441
    $template->param(
442
        BakerTaylorEnabled      => 1,
443
        BakerTaylorImageURL     => &image_url(),
444
        BakerTaylorLinkURL      => &link_url(),
445
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
446
    );
447
    my ( $bt_user, $bt_pass );
448
    if (    $isbn
449
        and $bt_user = C4::Context->preference('BakerTaylorUsername')
450
        and $bt_pass = C4::Context->preference('BakerTaylorPassword') )
451
    {
452
        $template->param(
453
            BakerTaylorContentURL => sprintf(
454
                "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
455
                $bt_user, $bt_pass, $isbn
456
            )
457
        );
458
    }
459
}
460
438
$template->param(
461
$template->param(
439
    biblionumber                            => $biblionumber,
462
    biblionumber                            => $biblionumber,
440
    ( $analyze ? 'analyze' : 'detailview' ) => 1,
463
    ( $analyze ? 'analyze' : 'detailview' ) => 1,
(-)a/installer/data/mysql/atomicupdate/bug-28307-BakerTaylorEnabled-staff.pl (+36 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "28307",
6
    description => "Make BakerTaylorEnabled preference separate for staff and OPAC",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        # Get any existing value from the IntranetmainUserblock system preference
12
        my ($bakertaylorenabled) = $dbh->selectrow_array(
13
            q|
14
            SELECT value FROM systempreferences WHERE variable='BakerTaylorEnabled';
15
        |
16
        );
17
18
        $dbh->do("DELETE FROM systempreferences WHERE variable='BakerTaylorEnabled'");
19
20
        $dbh->do(
21
            q{
22
            INSERT IGNORE INTO systempreferences ( variable, value, explanation, options, type) VALUES ( 'OPACBakerTaylorEnabled', ?, 'Enable or disable all Baker & Taylor features in the OPAC', NULL, 'YesNo' )
23
            }, undef, $bakertaylorenabled
24
        );
25
        $dbh->do(
26
            q{
27
            INSERT IGNORE INTO systempreferences ( variable, value, explanation, options, type) VALUES ( 'BakerTaylorEnabled', ?, 'Enable or disable all Baker & Taylor features in the staff interface', NULL, 'YesNo' )
28
            }, undef, $bakertaylorenabled
29
        );
30
31
        say_success(
32
            $out,
33
            "Added new system preference 'OPACBakerTaylorEnabled' to allow separate OPAC and staff interface settings"
34
        );
35
    },
36
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-4 / +10 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
Lines 432-435 Enhanced content: Link Here
432
                pt_BR: Portuguese – Brazil
438
                pt_BR: Portuguese – Brazil
433
                tr: Turkish
439
                tr: Turkish
434
                zh_TW: Chinese – Taiwan
440
                zh_TW: Chinese – Taiwan
435
            - It will be used as a fallback value if the language used by the interface does not have an online manual version.
441
            - It will be used as a fallback value if the language used by the interface does not have an online manual version.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+19 lines)
Lines 301-306 Link Here
301
                        [% END %]
301
                        [% END %]
302
                    [% END %]
302
                    [% END %]
303
303
304
                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
305
                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
306
                        [% 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" %]
307
                        <div class="cover-image" id="bakertaylor-coverimg">
308
                            [% IF BakerTaylorBookstoreURL %]
309
                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
310
                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
311
                                </a>
312
                            [% ELSE %]
313
                                <a href="[% BakerTaylorImageURL | url %]">
314
                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
315
                                </a>
316
                            [% END %]
317
                            <div class="hint">Image from Baker &amp; Taylor</div>
318
                        </div>
319
                    [% END %]
320
304
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
321
                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
305
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
322
                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
306
                        [% IF custom_cover_image_url %]
323
                        [% IF custom_cover_image_url %]
Lines 1484-1489 Link Here
1484
                            }
1501
                            }
1485
                            div.find(".hint").html(coce_description);
1502
                            div.find(".hint").html(coce_description);
1486
                            lightbox_descriptions.push(coce_description);
1503
                            lightbox_descriptions.push(coce_description);
1504
                        } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1505
                            lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1487
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1506
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1488
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1507
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1489
                        } else {
1508
                        } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 634-639 Link Here
634
                                                    [% END %]
634
                                                    [% END %]
635
                                                [% END %]
635
                                                [% END %]
636
636
637
                                                [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
638
                                                [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
639
                                                    [% 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" %]
640
                                                    <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
641
                                                        [% IF BakerTaylorBookstoreURL %]
642
                                                            <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
643
                                                                <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
644
                                                            </a>
645
                                                        [% ELSE %]
646
                                                            <a href="[% BakerTaylorImageURL | url %]">
647
                                                                <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
648
                                                            </a>
649
                                                        [% END %]
650
                                                        <div class="hint">Image from Baker &amp; Taylor</div>
651
                                                    </div>
652
                                                [% END %]
653
637
                                                [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
654
                                                [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
638
                                                    [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
655
                                                    [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
639
                                                    [% IF custom_cover_image_url %]
656
                                                    [% IF custom_cover_image_url %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 129-135 Link Here
129
                            [% END %]
129
                            [% END %]
130
130
131
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
131
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
132
                            [% IF ( BakerTaylorEnabled && bt_id ) %]
132
                            [% IF ( OPACBakerTaylorEnabled && bt_id ) %]
133
                                <div class="cover-image" id="bakertaylor-coverimg">
133
                                <div class="cover-image" id="bakertaylor-coverimg">
134
                                    [% IF BakerTaylorBookstoreURL %]
134
                                    [% IF BakerTaylorBookstoreURL %]
135
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
135
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
(-)a/opac/opac-detail.pl (-3 / +2 lines)
Lines 1162-1170 if ( C4::Context->preference("OPACShelfBrowser") ) { Link Here
1162
1162
1163
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages") );
1163
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages") );
1164
1164
1165
if ( C4::Context->preference("BakerTaylorEnabled") ) {
1165
if ( C4::Context->preference("OPACBakerTaylorEnabled") ) {
1166
    $template->param(
1166
    $template->param(
1167
        BakerTaylorEnabled      => 1,
1167
        OPACBakerTaylorEnabled  => 1,
1168
        BakerTaylorImageURL     => &image_url(),
1168
        BakerTaylorImageURL     => &image_url(),
1169
        BakerTaylorLinkURL      => &link_url(),
1169
        BakerTaylorLinkURL      => &link_url(),
1170
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1170
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1171
- 

Return to bug 28307