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

(-)a/C4/Auth.pm (+2 lines)
Lines 318-323 sub get_template_and_user { Link Here
318
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
318
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
319
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
319
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
320
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
320
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
321
            CoceHost                     => C4::Context->preference("CoceHost"),
322
            CoceProviders                => C4::Context->preference("CoceProviders"),
321
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
323
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
322
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
324
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
323
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:undef),
325
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:undef),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+9 lines)
Lines 326-328 Enhanced Content: Link Here
326
                  yes: Enable
326
                  yes: Enable
327
                  no: "Don't enable"
327
                  no: "Don't enable"
328
            - the ability to use Koha Plugins. Note, the plugin system must also be enabled in the Koha configuration file to be fully enabled.
328
            - the ability to use Koha Plugins. Note, the plugin system must also be enabled in the Koha configuration file to be fully enabled.
329
    Coce Cover images cache:
330
        -
331
            - Coce server URL
332
            - pref: CoceHost
333
              class: url
334
        -
335
            - Providers
336
            - pref: CoceProviders
337
            - 'separated by comma, for example: aws,gb. Leave empty not to activate this service.'
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc (+3 lines)
Lines 105-110 Link Here
105
	//]]>
105
	//]]>
106
</script>
106
</script>
107
[% END %]
107
[% END %]
108
[% IF CoceProviders %]
109
<script type="text/javascript" src="[% themelang %]/js/coce.js"></script>
110
[% END %]
108
[% IF OpenLibraryCovers %]
111
[% IF OpenLibraryCovers %]
109
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
112
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
110
<script type="text/javascript">
113
<script type="text/javascript">
(-)a/koha-tmpl/opac-tmpl/prog/en/js/coce.js (+42 lines)
Line 0 Link Here
1
if (KOHA === undefined || !KOHA) { var KOHA = {}; }
2
3
4
/**
5
 * A namespace for Coce cover images cache
6
 */
7
KOHA.coce = {
8
9
  /**
10
   * Search all:
11
   *    <div title="biblionumber" id="isbn" class="coce-thumbnail"></div>
12
   * or
13
   *    <div title="biblionumber" id="isbn" class="coce-thumbnail-preview"></div>
14
   * and run a search with all collected isbns to coce cover service.
15
   * The result is asynchronously returned, and used to append <img>.
16
   */
17
  getURL: function(host,provider,newWindow) {
18
    var ids = [];
19
    $("[id^=coce-thumbnail]").each(function(i) {
20
        ids.push($(this).attr("class")); // id=isbn
21
    });
22
    if (ids.length == 0) return;
23
    ids = ids.join(',');
24
    var coceURL = host + '/cover?id=' + ids + '&provider=' + provider;
25
    $.ajax({
26
      url: coceURL,
27
      dataType: 'jsonp',
28
      success: function(urlPerID){
29
        for (var id in urlPerID) {
30
          var url = urlPerID[id];
31
          $("[id^=coce-thumbnail]."+id).each(function() {
32
            var img = document.createElement("img");
33
            img.src = url;
34
            img.title = url; //FIXME: to delete
35
            $(this).append(img);
36
         });
37
        }
38
      }
39
    });
40
  }
41
  
42
};
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (+7 lines)
Lines 96-101 Link Here
96
	[% IF ( GoogleJackets ) %]
96
	[% IF ( GoogleJackets ) %]
97
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
97
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
98
	[% END %]
98
	[% END %]
99
100
[% IF ( CoceProviders ) %]
101
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]',[% covernewwindow %]);
102
[% END %]
103
99
	[% IF OpenLibraryCovers %]
104
	[% IF OpenLibraryCovers %]
100
	KOHA.OpenLibrary.GetCoverFromIsbn();
105
	KOHA.OpenLibrary.GetCoverFromIsbn();
101
	[% END %]
106
	[% END %]
Lines 508-513 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
508
513
509
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
514
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
510
515
516
[% IF ( CoceProviders ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="coce-thumbnail-preview"></div>[% END %]
517
511
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
518
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
512
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
519
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
513
    [% IF ( BakerTaylorEnabled ) %][% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% ELSE %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% END %][% END %][% END %]
520
    [% IF ( BakerTaylorEnabled ) %][% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% ELSE %]<a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>[% END %][% END %][% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-2 / +8 lines)
Lines 303-310 $(document).ready(function(){ Link Here
303
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
303
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
304
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
304
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
305
305
306
[% IF ( CoceProviders ) %]
307
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]');
308
[% END %]
309
306
[% IF ( DidYouMean ) %]
310
[% IF ( DidYouMean ) %]
307
    $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
311
    $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]',
308
        function() {
312
        function() {
309
            $(".searchsuggestion").parent().parent().css({
313
            $(".searchsuggestion").parent().parent().css({
310
                "border-color": "#F4ECBE",
314
                "border-color": "#F4ECBE",
Lines 684-689 $(document).ready(function(){ Link Here
684
                [% END %]
688
                [% END %]
685
689
686
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
690
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
691
692
[% IF ( CoceProviders ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="coce-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
693
687
        [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
694
        [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
688
                </a>
695
                </a>
689
                [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
696
                [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
690
- 

Return to bug 9580