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

(-)a/installer/data/mysql/sysprefs.sql (+3 lines)
Lines 406-408 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
409
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo');
410
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');
411
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 6339-6344 if ( CheckVersion($DBversion) ) { Link Here
6339
   SetVersion ($DBversion);
6339
   SetVersion ($DBversion);
6340
}
6340
}
6341
6341
6342
$DBversion ="3.11.00.XXX";
6343
if ( CheckVersion($DBversion) ) {
6344
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo');");
6345
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');");
6346
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');");
6347
    print "Upgrade to $DBversion done (Add IDreamBooks enhanced content)\n";
6348
    SetVersion($DBversion);
6349
}
6350
6351
6342
=head1 FUNCTIONS
6352
=head1 FUNCTIONS
6343
6353
6344
=head2 TableExists($table)
6354
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+19 lines)
Lines 141-146 Enhanced Content: Link Here
141
              choices:
141
              choices:
142
                  yes: in tabs.
142
                  yes: in tabs.
143
                  no: in line with the bibliographic information.
143
                  no: in line with the bibliographic information.
144
    IDreamLibraries:
145
        -
146
            - pref: IDreamBooksReviews
147
              choices:
148
                  yes: Add
149
                  no: "Don't add"
150
            - a tab on the OPAC details with book reviews from critics aggregated by <a href='http://idreambooks.com/'>IDreamBooks.com</a>.
151
        -
152
            - pref: IDreamBooksReadometer
153
              choices:
154
                  yes: Add
155
                  no: "Don't add"
156
            - a "Readometer" that summarizes the reviews gathered by <a href='http://idreambooks.com/'>IDreamBooks.com</a> to the OPAC details page.
157
        -
158
            - pref: IDreamBooksResults
159
              choices:
160
                  yes: Add
161
                  no: "Don't add"
162
            - the rating from <a href='http://idreambooks.com/'>IDreamBooks.com</a> to OPAC search results.
144
    OCLC:
163
    OCLC:
145
        -
164
        -
146
            - pref: XISBN
165
            - pref: XISBN
(-)a/koha-tmpl/opac-tmpl/ccsr/en/css/opac.css (+50 lines)
Lines 2698-2700 body#opac-main #opacmainuserblockmobile { Link Here
2698
.tagweight9 {
2698
.tagweight9 {
2699
    font-size: 30px;
2699
    font-size: 30px;
2700
}
2700
}
2701
2702
.review {
2703
    margin-bottom: 20px;
2704
}
2705
2706
#idreambooksreadometer {
2707
    float: right;
2708
}
2709
a.idreambooksrating {
2710
    font-size: 30px;
2711
    color: #29ADE4;
2712
    padding-left: 85px;
2713
    line-height: 30px;
2714
    text-decoration: none;
2715
}
2716
2717
.idreambookslegend {
2718
    font-size: small;
2719
}
2720
2721
a.reviewlink,a.reviewlink:visited {
2722
    text-decoration: none;
2723
    color: black;
2724
    font-weight: normal;
2725
}
2726
2727
.idreambookssummary a {
2728
    color: #707070;
2729
    text-decoration: none;
2730
}
2731
2732
.idreambookssummary img, .idbresult img {
2733
    vertical-align: middle;
2734
}
2735
2736
.idbresult {
2737
    color: #29ADE4;
2738
    text-align: center;
2739
    margin: 0.5em;
2740
    padding: 0.5em;
2741
}
2742
2743
.idbresult a, .idbresult a:visited {
2744
    text-decoration: none;
2745
    color: #29ADE4;
2746
}
2747
2748
.idbresult img {
2749
    padding-right: 6px;
2750
}
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+50 lines)
Lines 2850-2852 body#opac-main #opacmainuserblockmobile { Link Here
2850
video {
2850
video {
2851
    width: 480px;
2851
    width: 480px;
2852
}
2852
}
2853
2854
.review {
2855
    margin-bottom: 20px;
2856
}
2857
2858
#idreambooksreadometer {
2859
    float: right;
2860
}
2861
a.idreambooksrating {
2862
    font-size: 30px;
2863
    color: #29ADE4;
2864
    padding-left: 85px;
2865
    line-height: 30px;
2866
    text-decoration: none;
2867
}
2868
2869
.idreambookslegend {
2870
    font-size: small;
2871
}
2872
2873
a.reviewlink,a.reviewlink:visited {
2874
    text-decoration: none;
2875
    color: black;
2876
    font-weight: normal;
2877
}
2878
2879
.idreambookssummary a {
2880
    color: #707070;
2881
    text-decoration: none;
2882
}
2883
2884
.idreambookssummary img, .idbresult img {
2885
    vertical-align: middle;
2886
}
2887
2888
.idbresult {
2889
    color: #29ADE4;
2890
    text-align: center;
2891
    margin: 0.5em;
2892
    padding: 0.5em;
2893
}
2894
2895
.idbresult a, .idbresult a:visited {
2896
    text-decoration: none;
2897
    color: #29ADE4;
2898
}
2899
2900
.idbresult img {
2901
    padding-right: 6px;
2902
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (+65 lines)
Lines 181-187 $(function () { Link Here
181
});
181
});
182
// -----------------------------------------------------
182
// -----------------------------------------------------
183
[% END %]
183
[% END %]
184
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
185
        var isbn = $(".isbn:last").text().split(" ")[1];
186
        if (isbn) {
187
        isbn = isbn.replace(/\W*$/, '');
188
189
        if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
190
        // Use Microsoft XDR for IE version 8 or above
191
            var xdr = new XDomainRequest();
192
            xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
193
            xdr.onload = function() {
194
                json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
195
                eval(json); // json is now a regular JSON object
196
                parseIDBJSON(json); // parse using same function as for jQuery's success event
197
            }
198
            xdr.send();
199
        } else {
200
            $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
201
                parseIDBJSON(json);
202
            });
203
        }
204
    }
205
206
[% END %]
184
});
207
});
208
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
209
function parseIDBJSON( json ) {
210
    if(json.total_results > 0 && json.book.rating > 0){
211
        var isbn = $(".isbn:last").text().split(" ")[1];
212
213
[% IF ( IDreamBooksReadometer ) %]
214
        $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="http://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+' by '+json.book.author+'" title="Rating based on reviews of '+json.book.title+'"></a>');
215
[% END %]
216
217
218
[% IF ( IDreamBooksReviews ) %]
219
        //build new tab for critic reviews
220
        $("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count));
221
222
        //append happy-sad cloud review
223
224
        $("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%</a> <a href='http://www.idreambooks.com/'>rating based on reviews at iDreamBooks.com</a></span>");
225
226
        //insert data into Book reviews tab
227
        $.each(json.book.critic_reviews, function(){
228
                $("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>Review date: "+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>Review result: "+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='iDreamBooks.com rating' title='"+this.pos_or_neg+"' /></a></div></div>");
229
                });
230
        $("#seemoreidb").attr('href', json.book.detail_link);
231
        $("#tab_idb_critic_reviews").show();
232
[% END %]
233
234
    }
235
236
}
237
[% END %]
185
238
186
[% IF ( OpacBrowseResults && busc ) %]
239
[% IF ( OpacBrowseResults && busc ) %]
187
var timeoutRFW;
240
var timeoutRFW;
Lines 724-729 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
724
    <li id="tab_html5media"><a href="#html5media">Play media</a></li>
777
    <li id="tab_html5media"><a href="#html5media">Play media</a></li>
725
[% END %][% END %]
778
[% END %][% END %]
726
779
780
[% IF ( IDreamBooksReviews ) %]
781
    <li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li>
782
[% END %]
727
</ul>
783
</ul>
728
784
729
[% IF ( serialcollection ) %]
785
[% IF ( serialcollection ) %]
Lines 1083-1088 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1083
</div>
1139
</div>
1084
[% END %]
1140
[% END %]
1085
1141
1142
[% IF ( IDreamBooksReviews ) %]
1143
    <div id="idb_critic_reviews">
1144
        <div id="idb_review_snippets">
1145
        </div>
1146
        <span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span>
1147
    </div>
1148
[% END %]
1149
1086
1150
1087
</div>
1151
</div>
1088
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %]
1152
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %]
Lines 1102-1107 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1102
    <div id="BW_videos"></div>
1166
    <div id="BW_videos"></div>
1103
[% END %]
1167
[% END %]
1104
1168
1169
1105
</div>
1170
</div>
1106
1171
1107
1172
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (+41 lines)
Lines 109-114 $(document).ready(function(){ Link Here
109
        });
109
        });
110
    [% END %]
110
    [% END %]
111
111
112
    [% IF ( IDreamBooksResults ) %]
113
        $('.idbresult').each(function() {
114
            var isbn = $(this).children('a').text().replace(/\s*/,'');
115
            var element = this;
116
117
            if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
118
            // Use Microsoft XDR for IE version 8 or above
119
                var xdr = new XDomainRequest();
120
                xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
121
                xdr.onload = function() {
122
                    json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
123
                    eval(json); // json is now a regular JSON object
124
                    if(json.total_results > 0 && json.book.rating > 0){
125
                        $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
126
                        $(element).show();
127
                    } else {
128
                        $(element).remove();
129
                    }
130
                }
131
                xdr.send();
132
            } else {
133
                $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
134
                    if(json.total_results > 0 && json.book.rating > 0){
135
                        $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
136
                        $(element).show();
137
                    } else {
138
                        $(element).remove();
139
                    }
140
                });
141
            }
142
        });
143
    [% END %]
144
112
    [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
145
    [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
113
146
114
[% IF ( opacbookbag ) %]
147
[% IF ( opacbookbag ) %]
Lines 648-653 $(document).ready(function(){ Link Here
648
        [% 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 %]
681
        [% 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 %]
649
                </a>
682
                </a>
650
                [% 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 %]
683
                [% 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 %]
684
                [% IF ( IDreamBooksResults ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div class="idbresult" style="display: none;">
685
                    [% IF ( IDreamBooksReviews ) %]
686
                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
687
                    [% ELSE %]
688
                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
689
                    [% END %]
690
                    [% SEARCH_RESULT.normalized_isbn %]</a></div>
691
                [% END %][% END %]
651
                </td>
692
                </td>
652
                </tr>
693
                </tr>
653
                [% END %]
694
                [% END %]
(-)a/opac/opac-detail.pl (+4 lines)
Lines 1003-1008 if (C4::Context->preference('OPACLocalCoverImages') == 1) { Link Here
1003
    $template->{VARS}->{localimages} = \@images;
1003
    $template->{VARS}->{localimages} = \@images;
1004
}
1004
}
1005
1005
1006
$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
1007
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
1008
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
1009
1006
if (C4::Context->preference('OpacHighlightedWords')) {
1010
if (C4::Context->preference('OpacHighlightedWords')) {
1007
    $template->{VARS}->{query_desc} = $query->param('query_desc');
1011
    $template->{VARS}->{query_desc} = $query->param('query_desc');
1008
}
1012
}
(-)a/opac/opac-search.pl (-1 / +3 lines)
Lines 833-838 if (C4::Context->preference('GoogleIndicTransliteration')) { Link Here
833
}
833
}
834
834
835
$template->{VARS}->{DidYouMean} = C4::Context->preference('OPACdidyoumean') =~ m/enable/;
835
$template->{VARS}->{DidYouMean} = C4::Context->preference('OPACdidyoumean') =~ m/enable/;
836
$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
837
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
838
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
836
839
837
    $template->param( borrowernumber    => $borrowernumber);
840
    $template->param( borrowernumber    => $borrowernumber);
838
output_with_http_headers $cgi, $cookie, $template->output, $content_type;
841
output_with_http_headers $cgi, $cookie, $template->output, $content_type;
839
- 

Return to bug 8733