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

(-)a/C4/Auth.pm (+1 lines)
Lines 338-343 sub get_template_and_user { Link Here
338
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
338
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
339
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
339
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
340
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
340
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
341
	    OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
341
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
342
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
342
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
343
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
343
            LoginFirstname               => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
344
            LoginFirstname               => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
(-)a/installer/data/mysql/de-DE/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 314-317 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+1 lines)
Lines 314-316 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
315
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (-1 / +1 lines)
Lines 315-318 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
315
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
315
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
318
318
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/it-IT/necessari/sysprefs.sql (+1 lines)
Lines 301-303 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
302
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
302
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
304
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sysprefs.sql (+1 lines)
Lines 321-323 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
321
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
321
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
322
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
322
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
323
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
323
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
324
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 313-316 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
316
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 / +1 lines)
Lines 368-371 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
368
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
368
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
369
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
369
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
371
371
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql (+1 lines)
Lines 393-395 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
393
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
393
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
394
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
394
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
395
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
395
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
396
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0, 'If ON Openlibrary book covers will be show',NULL,'YesNo');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+7 lines)
Lines 130-135 Enhanced Content: Link Here
130
                  yes: Add
130
                  yes: Add
131
                  no: "Don't add"
131
                  no: "Don't add"
132
            - cover images from Google Books to search results and item detail pages on the OPAC.
132
            - cover images from Google Books to search results and item detail pages on the OPAC.
133
    OpenLibrary:
134
        -
135
            - pref: OpenLibraryCovers
136
              choices:
137
                  yes: Add
138
                  no: "Don't add"
139
            - cover images from OpenLibrary to search results and item detail pages on the OPAC.
133
    Library Thing:
140
    Library Thing:
134
        # Awkward syntax below, due to quoting conflicts
141
        # Awkward syntax below, due to quoting conflicts
135
        -
142
        -
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc (-1 / +11 lines)
Lines 84-90 Link Here
84
	var NO_GOOGLE_JACKET = _("No cover image available");
84
	var NO_GOOGLE_JACKET = _("No cover image available");
85
	//]]>
85
	//]]>
86
</script>
86
</script>
87
[% END %][% IF ( BakerTaylorEnabled ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/bakertaylorimages.js"></script>
87
[% END %]
88
[% IF OpenLibraryCovers %]
89
<script type="text/javascript" language="javascript" src="[% themelang %]/js/openlibrary.js"></script>
90
<script type="text/javascript" language="javascript">
91
//<![CDATA[
92
var NO_OL_JACKET = _("No cover image available");
93
//]]>
94
</script>
95
[% END %]
96
97
[% IF ( BakerTaylorEnabled ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/bakertaylorimages.js"></script>
88
<script type="text/javascript" language="javascript">
98
<script type="text/javascript" language="javascript">
89
	//<![CDATA[
99
	//<![CDATA[
90
	var NO_BAKERTAYLOR_IMAGE = _("No cover image available");
100
	var NO_BAKERTAYLOR_IMAGE = _("No cover image available");
(-)a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js (+70 lines)
Line 0 Link Here
1
if (typeof KOHA == "undefined" || !KOHA) {
2
    var KOHA = {};
3
}
4
5
/**
6
 * A namespace for OpenLibrary related functions.
7
 */
8
KOHA.OpenLibrary = {
9
10
11
    /**
12
     * Search all:
13
     *    <div title="biblionumber" id="isbn" class="openlibrary-thumbnail"></div>
14
     * or
15
     *    <div title="biblionumber" id="isbn" class="openlibrary-thumbnail-preview"></div>
16
     * and run a search with all collected isbns to Open Library Book Search.
17
     * The result is asynchronously returned by OpenLibrary and catched by
18
     * olCallBack().
19
     */
20
    GetCoverFromIsbn: function() {
21
        var bibkeys = [];
22
        $("div [id^=openlibrary-thumbnail]").each(function(i) {
23
            bibkeys.push("ISBN:" + $(this).attr("class")); // id=isbn
24
        });
25
        bibkeys = bibkeys.join(',');
26
        var scriptElement = document.createElement("script");
27
        scriptElement.setAttribute("id", "jsonScript");
28
        scriptElement.setAttribute("src",
29
            "http://openlibrary.org/api/books?bibkeys=" + escape(bibkeys) +
30
            "&callback=KOHA.OpenLibrary.olCallBack");
31
        scriptElement.setAttribute("type", "text/javascript");
32
        document.documentElement.firstChild.appendChild(scriptElement);
33
34
    },
35
36
    /**
37
     * Add cover pages <div
38
     * and link to preview if div id is gbs-thumbnail-preview
39
     */
40
    olCallBack: function(booksInfo) {
41
       for (id in booksInfo) {
42
          var book = booksInfo[id];
43
          var isbn = book.bib_key.substring(5);
44
          
45
          $("."+isbn).each(function() {
46
              var a = document.createElement("a");
47
              a.href = book.info_url;
48
				      if (typeof(book.thumbnail_url) != "undefined") {
49
	               	var img = document.createElement("img");
50
	                img.src = book.thumbnail_url;
51
					        $(this).append(img);
52
                  var re = /^openlibrary-thumbnail-preview/;
53
                  if ( re.exec($(this).attr("id")) ) {
54
                      $(this).append(
55
                        '<div style="margin-bottom:5px; margin-top:-5px;font-size:9px">' +
56
                        '<a href="' + 
57
                        book.info_url + 
58
                        '">Preview</a></div>' 
59
                      );
60
                  }
61
		     		} else {
62
				    	var message = document.createElement("span");
63
					    $(message).attr("class","no-image");
64
					    $(message).html(NO_OL_JACKET);
65
					    $(this).append(message);
66
				    }
67
        });
68
      }
69
    }
70
};
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-1 / +2 lines)
Lines 228-233 $(document).ready(function(){ Link Here
228
        [% END %]
228
        [% END %]
229
        [% END %]
229
        [% END %]
230
    [% END %][% END %]
230
    [% END %][% END %]
231
    [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
231
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
232
    [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
232
});
233
});
233
//]]>
234
//]]>
Lines 535-540 $(document).ready(function(){ Link Here
535
                <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %]
536
                <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %]
536
537
537
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
538
                [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
539
		[% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<div style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
538
                </a>
540
                </a>
539
                [% 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 %]
541
                [% 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 %]
540
				</td>
542
				</td>
541
- 

Return to bug 5429