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 390-395 foreach ( keys %{$dat} ) { Link Here
390
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
391
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
391
# method query not found?!?!
392
# method query not found?!?!
392
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
393
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
394
395
if ( C4::Context->preference("BakerTaylorEnabled") ) {
396
    $template->param(
397
        BakerTaylorEnabled      => 1,
398
        BakerTaylorImageURL     => &image_url(),
399
        BakerTaylorLinkURL      => &link_url(),
400
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
401
    );
402
    my ( $bt_user, $bt_pass );
403
    if (    $isbn
404
        and $bt_user = C4::Context->preference('BakerTaylorUsername')
405
        and $bt_pass = C4::Context->preference('BakerTaylorPassword') )
406
    {
407
        $template->param(
408
            BakerTaylorContentURL => sprintf(
409
                "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
410
                $bt_user, $bt_pass, $isbn
411
            )
412
        );
413
    }
414
}
415
393
$template->param(
416
$template->param(
394
    biblionumber        => $biblionumber,
417
    biblionumber        => $biblionumber,
395
    ($analyze? 'analyze':'detailview') =>1,
418
    ($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 287-292 Link Here
287
                                            [% END %]
287
                                            [% END %]
288
                                    [% END %]
288
                                    [% END %]
289
289
290
                                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
291
                                    [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
292
                                        [% 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" %]
293
                                        <div class="cover-image" id="bakertaylor-coverimg">
294
                                            [% IF BakerTaylorBookstoreURL %]
295
                                                <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
296
                                                    <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
297
                                                </a>
298
                                            [% ELSE %]
299
                                                <a href="[% BakerTaylorImageURL | url %]">
300
                                                    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
301
                                                </a>
302
                                            [% END %]
303
                                            <div class="hint">Image from Baker &amp; Taylor</div>
304
                                        </div>
305
                                    [% END %]
306
290
                                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
307
                                    [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
291
                                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
308
                                        [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
292
                                        [% IF custom_cover_image_url %]
309
                                        [% IF custom_cover_image_url %]
Lines 1341-1346 Link Here
1341
                            }
1358
                            }
1342
                            div.find(".hint").html(coce_description);
1359
                            div.find(".hint").html(coce_description);
1343
                            lightbox_descriptions.push(coce_description);
1360
                            lightbox_descriptions.push(coce_description);
1361
                        } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1362
                            lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1344
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1363
                        } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1345
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1364
                            lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1346
                        } else {
1365
                        } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+17 lines)
Lines 521-526 Link Here
521
                [% END %]
521
                [% END %]
522
            [% END %]
522
            [% END %]
523
523
524
            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
525
            [% IF ( Koha.Preference('BakerTaylorEnabled') && bt_id ) %]
526
                [% 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" %]
527
                <div class="cover-image bakertaylor-coverimg" id="bakertaylor-coverimg">
528
                    [% IF BakerTaylorBookstoreURL %]
529
                        <a href="https://[% Koha.Preference( BakerTaylorBookstoreURL ) | url %][% bt_id | url %]">
530
                            <img alt="See Baker &amp; Taylor" src=" [% BakerTaylorImageURL | url %]" />
531
                        </a>
532
                    [% ELSE %]
533
                        <a href="[% BakerTaylorImageURL | url %]">
534
                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %]" />
535
                        </a>
536
                    [% END %]
537
                    <div class="hint">Image from Baker &amp; Taylor</div>
538
                </div>
539
            [% END %]
540
524
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
541
            [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
525
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
542
                [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
526
                [% IF custom_cover_image_url %]
543
                [% IF custom_cover_image_url %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 116-122 Link Here
116
                            [% END %]
116
                            [% END %]
117
117
118
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
118
                            [% bt_id = ( normalized_upc || normalized_isbn ) %]
119
                            [% IF ( BakerTaylorEnabled && bt_id ) %]
119
                            [% IF ( OPACBakerTaylorEnabled && bt_id ) %]
120
                                <div class="cover-image" id="bakertaylor-coverimg">
120
                                <div class="cover-image" id="bakertaylor-coverimg">
121
                                    [% IF BakerTaylorBookstoreURL %]
121
                                    [% IF BakerTaylorBookstoreURL %]
122
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
122
                                        <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
(-)a/opac/opac-detail.pl (-8 / +7 lines)
Lines 1107-1119 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
1107
1107
1108
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1108
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
1109
1109
1110
if (C4::Context->preference("BakerTaylorEnabled")) {
1110
if ( C4::Context->preference("OPACBakerTaylorEnabled") ) {
1111
	$template->param(
1111
    $template->param(
1112
		BakerTaylorEnabled  => 1,
1112
        OPACBakerTaylorEnabled  => 1,
1113
		BakerTaylorImageURL => &image_url(),
1113
        BakerTaylorImageURL     => &image_url(),
1114
		BakerTaylorLinkURL  => &link_url(),
1114
        BakerTaylorLinkURL      => &link_url(),
1115
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1115
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
1116
	);
1116
    );
1117
	my ($bt_user, $bt_pass);
1117
	my ($bt_user, $bt_pass);
1118
	if ($isbn and
1118
	if ($isbn and
1119
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
1119
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
1120
- 

Return to bug 28307