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

(-)a/C4/ShelfBrowser.pm (+2 lines)
Lines 73-78 to take into account. Link Here
73
  	  print $_->{browser_normalized_upc};
73
  	  print $_->{browser_normalized_upc};
74
  	  print $_->{browser_normalized_oclc};
74
  	  print $_->{browser_normalized_oclc};
75
  	  print $_->{browser_normalized_isbn};
75
  	  print $_->{browser_normalized_isbn};
76
  	  print $_->{browser_normalized_ean};
76
  }
77
  }
77
78
78
  # This is the information required to scroll the browser to the next left
79
  # This is the information required to scroll the browser to the next left
Lines 228-233 sub GetShelfInfo { Link Here
228
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
229
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
229
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
230
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
230
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
231
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
232
        $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
231
        push @valid_items, $item;
233
        push @valid_items, $item;
232
    }
234
    }
233
    return @valid_items;
235
    return @valid_items;
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 86-91 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
86
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
86
('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'),
87
('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'),
87
('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'),
88
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
88
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
89
('CoceHost', NULL, NULL, 'Coce server URL', 'Free'),
90
('CoceProviders', NULL, NULL, 'Coce providers, for example aws,gb', 'Free'),
89
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
91
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
90
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
92
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
91
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
93
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+15 lines)
Lines 8891-8896 if ( CheckVersion($DBversion) ) { Link Here
8891
    SetVersion($DBversion);
8891
    SetVersion($DBversion);
8892
}
8892
}
8893
8893
8894
$DBversion = "3.17.00.XXX";
8895
if ( CheckVersion($DBversion) ) {
8896
    $dbh->do(q{
8897
        INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
8898
        VALUES('CoceHost', NULL, 'Coce server URL', NULL,'Free')
8899
    });
8900
    $dbh->do(q{
8901
        INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
8902
        VALUES('CoceProviders', NULL, 'Coce Providers, for example: aws,gb', NULL,'Free')
8903
    });
8904
    print "Upgrade to $DBversion done (Bug 9580 - Cover image from Coce, a remote image URL cache)\n";
8905
    SetVersion($DBversion);
8906
}
8907
8908
8894
=head1 FUNCTIONS
8909
=head1 FUNCTIONS
8895
8910
8896
=head2 TableExists($table)
8911
=head2 TableExists($table)
(-)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/bootstrap/en/includes/opac-bottom.inc (+9 lines)
Lines 166-171 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
166
        //]]>
166
        //]]>
167
    </script>
167
    </script>
168
[% END %]
168
[% END %]
169
[% IF Koha.Preference('CoceProviders') %]
170
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/coce.js"></script>
171
    <script type="text/javascript">
172
        //<![CDATA[
173
        var NO_COCE_JACKET = _("No cover image available");
174
        //]]>
175
    </script>
176
[% END %]
177
169
[% IF OpenLibraryCovers %]
178
[% IF OpenLibraryCovers %]
170
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/openlibrary.js"></script>
179
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/openlibrary.js"></script>
171
    <script type="text/javascript">
180
    <script type="text/javascript">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc (-1 / +5 lines)
Lines 53-58 Link Here
53
                                        <span class="no-image">No cover image available</span>
53
                                        <span class="no-image">No cover image available</span>
54
                                    [% END %]
54
                                    [% END %]
55
                                [% END %]
55
                                [% END %]
56
                                [% IF ( Koha.Preference('CoceProviders') ) %]
57
                                  [% coce_id = item.browser_normalized_ean || item.browser_normalized_isbn %]
58
                                  <div title="[% item.biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail-preview-[% coce_id %]"></div>
59
                                [% END %]
56
                                [% IF ( BakerTaylorEnabled ) %]
60
                                [% IF ( BakerTaylorEnabled ) %]
57
                                    [% IF ( item.browser_normalized_isbn ) %]
61
                                    [% IF ( item.browser_normalized_isbn ) %]
58
                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% item.browser_normalized_isbn %]" />
62
                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% item.browser_normalized_isbn %]" />
Lines 83-86 Link Here
83
            </table>
87
            </table>
84
        </div>
88
        </div>
85
    [% END # /IF OpenOPACShelfBrowser %]
89
    [% END # /IF OpenOPACShelfBrowser %]
86
[% END # end of shelfbrowser block %]
90
[% END # end of shelfbrowser block %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+14 lines)
Lines 79-84 Link Here
79
                    [% IF ( GoogleJackets ) %]
79
                    [% IF ( GoogleJackets ) %]
80
                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>
80
                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>
81
                    [% END %]
81
                    [% END %]
82
                    [% IF ( Koha.Preference('CoceProviders') ) %]
83
                      [% coce_id = normalized_ean || normalized_isbn %]
84
                      <div style="block" title="[% biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail-preview"></div>
85
                    [% END %]
82
                    [% IF OpenLibraryCovers %]
86
                    [% IF OpenLibraryCovers %]
83
                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
87
                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
84
                    [% END %]
88
                    [% END %]
Lines 1430-1435 Link Here
1430
    [% IF ( GoogleJackets ) %]
1434
    [% IF ( GoogleJackets ) %]
1431
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1435
        KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1432
    [% END %]
1436
    [% END %]
1437
    [% IF ( Koha.Preference('CoceProviders') ) %]
1438
        KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
1439
    [% END %]
1440
1433
    [% IF OpenLibraryCovers %]
1441
    [% IF OpenLibraryCovers %]
1434
        KOHA.OpenLibrary.GetCoverFromIsbn();
1442
        KOHA.OpenLibrary.GetCoverFromIsbn();
1435
    [% END %]
1443
    [% END %]
Lines 1487-1492 Link Here
1487
                    [% IF ( GoogleJackets ) %]
1495
                    [% IF ( GoogleJackets ) %]
1488
                      KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1496
                      KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1489
                    [% END %]
1497
                    [% END %]
1498
                    [% IF ( Koha.Preference('CoceProviders') ) %]
1499
                      KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
1500
                    [% END %]
1490
                    [% IF OpenLibraryCovers %]
1501
                    [% IF OpenLibraryCovers %]
1491
                      KOHA.OpenLibrary.GetCoverFromIsbn();
1502
                      KOHA.OpenLibrary.GetCoverFromIsbn();
1492
                    [% END %]
1503
                    [% END %]
Lines 1510-1515 Link Here
1510
                    [% IF ( GoogleJackets ) %]
1521
                    [% IF ( GoogleJackets ) %]
1511
                      KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1522
                      KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1512
                    [% END %]
1523
                    [% END %]
1524
                    [% IF ( Koha.Preference('CoceProviders') ) %]
1525
                      KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
1526
                    [% END %]
1513
                    [% IF OpenLibraryCovers %]
1527
                    [% IF OpenLibraryCovers %]
1514
                      KOHA.OpenLibrary.GetCoverFromIsbn();
1528
                      KOHA.OpenLibrary.GetCoverFromIsbn();
1515
                    [% END %]
1529
                    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+10 lines)
Lines 257-262 Link Here
257
                                                            [% END %]
257
                                                            [% END %]
258
                                                        [% END %]
258
                                                        [% END %]
259
259
260
                                                        [% IF ( Koha.Preference('CoceProviders') ) %]
261
                                                          [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]
262
                                                          [% IF ( coce_id ) %]
263
                                                            <span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail[% loop.count %]"></span>
264
                                                          [% ELSE %]
265
                                                            <span class="no-image">No cover image available</span>
266
                                                          [% END %]
267
                                                        [% END %]
268
260
                                                        [% IF OpenLibraryCovers %]
269
                                                        [% IF OpenLibraryCovers %]
261
                                                            [% IF SEARCH_RESULT.normalized_isbn %]
270
                                                            [% IF SEARCH_RESULT.normalized_isbn %]
262
                                                                <span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>
271
                                                                <span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>
Lines 908-913 $(document).ready(function(){ Link Here
908
[% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
917
[% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
909
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
918
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
910
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
919
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
920
[% IF ( Koha.Preference('CoceProviders') ) %]KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]');[% END %]
911
921
912
[% IF ( DidYouMean ) %]
922
[% IF ( DidYouMean ) %]
913
    $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
923
    $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/svc/shelfbrowser.tt (+1 lines)
Lines 1-2 Link Here
1
[% USE Koha %]
1
[% PROCESS 'shelfbrowser.inc' %]
2
[% PROCESS 'shelfbrowser.inc' %]
2
[% INCLUDE shelfbrowser %]
3
[% INCLUDE shelfbrowser %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/coce.js (-1 / +43 lines)
Line 0 Link Here
0
- 
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
        var id = $(this).attr("class"); // id=isbn
21
        if ( id !== '' ) { ids.push(id); }
22
    });
23
    if (ids.length == 0) return;
24
    ids = ids.join(',');
25
    var coceURL = host + '/cover?id=' + ids + '&provider=' + provider;
26
    $.ajax({
27
      url: coceURL,
28
      dataType: 'jsonp',
29
      success: function(urlPerID){
30
        for (var id in urlPerID) {
31
          var url = urlPerID[id];
32
          $("[id^=coce-thumbnail]."+id).each(function() {
33
            var img = document.createElement("img");
34
            img.src = url;
35
            img.title = url; //FIXME: to delete
36
            $(this).html(img);
37
         });
38
        }
39
      }
40
    });
41
  }
42
43
};

Return to bug 9580