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

(-)a/C4/Auth.pm (+2 lines)
Lines 303-308 sub get_template_and_user { Link Here
303
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
303
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
304
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
304
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
305
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
305
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
306
            CoceHost                     => C4::Context->preference("CoceHost"),
307
            CoceProviders                => C4::Context->preference("CoceProviders"),
306
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
308
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
307
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
309
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
308
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:undef),
310
            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 337-339 Enhanced Content: Link Here
337
            - "Show items from the OverDrive catalog of library #"
337
            - "Show items from the OverDrive catalog of library #"
338
            - pref: OverDriveLibraryID
338
            - pref: OverDriveLibraryID
339
            - .
339
            - .
340
    Coce Cover images cache:
341
        -
342
            - Coce server URL
343
            - pref: CoceHost
344
              class: url
345
        -
346
            - Providers
347
            - pref: CoceProviders
348
            - '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 112-117 Link Here
112
	//]]>
112
	//]]>
113
</script>
113
</script>
114
[% END %]
114
[% END %]
115
[% IF CoceProviders %]
116
<script type="text/javascript" src="[% themelang %]/js/coce.js"></script>
117
[% END %]
115
[% IF OpenLibraryCovers %]
118
[% IF OpenLibraryCovers %]
116
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
119
<script type="text/javascript" src="[% themelang %]/js/openlibrary.js"></script>
117
<script type="text/javascript">
120
<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 139-144 Link Here
139
	[% IF ( GoogleJackets ) %]
139
	[% IF ( GoogleJackets ) %]
140
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
140
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
141
	[% END %]
141
	[% END %]
142
143
[% IF ( CoceProviders ) %]
144
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]',[% covernewwindow %]);
145
[% END %]
146
142
	[% IF OpenLibraryCovers %]
147
	[% IF OpenLibraryCovers %]
143
	KOHA.OpenLibrary.GetCoverFromIsbn();
148
	KOHA.OpenLibrary.GetCoverFromIsbn();
144
	[% END %]
149
	[% END %]
Lines 541-546 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
541
546
542
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
547
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
543
548
549
[% IF ( CoceProviders ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="coce-thumbnail-preview"></div>[% END %]
550
544
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
551
    [% IF ( GoogleJackets ) %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>[% END %]
545
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
552
    [% IF OpenLibraryCovers %]<div style="block" title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>[% END %]
546
    [% 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 %]
553
    [% 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 (-3 / +9 lines)
Lines 333-340 $(document).ready(function(){ Link Here
333
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
333
    [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
334
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
334
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
335
335
336
<<<<<<< HEAD
336
[% IF ( DidYouMean ) %]
337
[% IF ( DidYouMean ) %]
337
    $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
338
    $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]',
338
        function() {
339
        function() {
339
            $(".searchsuggestion").parent().parent().css({
340
            $(".searchsuggestion").parent().parent().css({
340
                "border-color": "#F4ECBE",
341
                "border-color": "#F4ECBE",
Lines 343-349 $(document).ready(function(){ Link Here
343
        });
344
        });
344
[% END %]
345
[% END %]
345
346
346
});
347
[% IF ( CoceProviders ) %]
348
KOHA.coce.getURL('[% CoceHost %]', '[% CoceProviders %]');
349
[% END %]
350
347
351
348
//]]>
352
//]]>
349
</script>
353
</script>
Lines 724-729 $(document).ready(function(){ Link Here
724
                [% END %]
728
                [% END %]
725
729
726
                [% 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 %]
730
                [% 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 %]
731
732
[% 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 %]
733
727
        [% 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 %]
734
        [% 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 %]
728
                </a>
735
                </a>
729
                [% 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 %]
736
                [% 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 %]
730
- 

Return to bug 9580