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

(-)a/catalogue/detail.pl (+23 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 427-432 foreach ( keys %{$dat} ) { Link Here
427
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
428
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
428
# method query not found?!?!
429
# method query not found?!?!
429
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
430
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
431
432
if ( C4::Context->preference("BakerTaylorEnabled") ) {
433
    $template->param(
434
        BakerTaylorEnabled      => 1,
435
        BakerTaylorImageURL     => &image_url(),
436
        BakerTaylorLinkURL      => &link_url(),
437
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
438
    );
439
    my ( $bt_user, $bt_pass );
440
    if (    $isbn
441
        and $bt_user = C4::Context->preference('BakerTaylorUsername')
442
        and $bt_pass = C4::Context->preference('BakerTaylorPassword') )
443
    {
444
        $template->param(
445
            BakerTaylorContentURL => sprintf(
446
                "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
447
                $bt_user, $bt_pass, $isbn
448
            )
449
        );
450
    }
451
}
452
430
$template->param(
453
$template->param(
431
    biblionumber        => $biblionumber,
454
    biblionumber        => $biblionumber,
432
    ($analyze? 'analyze':'detailview') =>1,
455
    ($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 (-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 283-288 Link Here
283
                                            [% END %]
283
                                            [% END %]
284
                                    [% END %]
284
                                    [% END %]
285
285
286
                                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
287
                                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
288
                                        [% 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" %]
289
                                        <div class="cover-image" id="bakertaylor-coverimg">
290
                                            [% IF BakerTaylorBookstoreURL %]
291
                                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
292
                                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
293
                                                </a>
294
                                            [% ELSE %]
295
                                                <a href="[% BakerTaylorImageURL | url %]">
296
                                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
297
                                                </a>
298
                                            [% END %]
299
                                            <div class="hint">Image from Baker &amp; Taylor</div>
300
                                        </div>
301
                                    [% END %]
302
286
                                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
303
                                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
287
                                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
304
                                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
288
                                        [% IF custom_cover_image_url %]
305
                                        [% IF custom_cover_image_url %]
Lines 1440-1445 Link Here
1440
                            }
1457
                            }
1441
                            div.find(".hint").html(coce_description);
1458
                            div.find(".hint").html(coce_description);
1442
                            lightbox_descriptions.push(coce_description);
1459
                            lightbox_descriptions.push(coce_description);
1460
                        } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1461
                            lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1443
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1462
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1444
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1463
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1445
                        } else {
1464
                        } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 524-529 Link Here
524
                [% END %]
524
                [% END %]
525
            [% END %]
525
            [% END %]
526
526
527
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
528
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
529
                [% 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" %]
530
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
531
                    [% IF BakerTaylorBookstoreURL %]
532
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
533
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
534
                        </a>
535
                    [% ELSE %]
536
                        <a href="[% BakerTaylorImageURL | url %]">
537
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
538
                        </a>
539
                    [% END %]
540
                    <div class="hint">Image from Baker &amp; Taylor</div>
541
                </div>
542
            [% END %]
543
527
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
544
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
528
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
545
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
529
                [% IF custom_cover_image_url %]
546
                [% IF custom_cover_image_url %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 117-123 Link Here
117
                            [% END %]
117
                            [% END %]
118
118
119
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
119
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
120
                            [% IF ( BakerTaylorEnabled && bt_id ) %]
120
                            [% IF ( OPACBakerTaylorEnabled && bt_id ) %]
121
                                <div class="cover-image" id="bakertaylor-coverimg">
121
                                <div class="cover-image" id="bakertaylor-coverimg">
122
                                    [% IF BakerTaylorBookstoreURL %]
122
                                    [% IF BakerTaylorBookstoreURL %]
123
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
123
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
(-)a/opac/opac-detail.pl (-8 / +7 lines)
Lines 1117-1129 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
	);
1126
    );
1127
	my ($bt_user, $bt_pass);
1127
	my ($bt_user, $bt_pass);
1128
	if ($isbn and
1128
	if ($isbn and
1129
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
1129
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
1130
- 

Return to bug 28307