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

(-)a/C4/UsageStats.pm (-3 lines)
Lines 207-215 sub BuildReport { Link Here
207
        BakerTaylorEnabled
207
        BakerTaylorEnabled
208
        GoogleJackets
208
        GoogleJackets
209
        HTML5MediaEnabled
209
        HTML5MediaEnabled
210
        IDreamBooksReadometer
211
        IDreamBooksResults
212
        IDreamBooksReviews
213
        LibraryThingForLibrariesEnabled
210
        LibraryThingForLibrariesEnabled
214
        LocalCoverImages
211
        LocalCoverImages
215
        OPACLocalCoverImages
212
        OPACLocalCoverImages
(-)a/installer/data/mysql/atomicupdate/bug_24854-remove_idreambooks.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "DELETE FROM systempreferences WHERE variable in ('IDreamBooksReadometer','IDreamBooksResults','IDreamBooksReviews')" );
4
    SetVersion( $DBversion );
5
    print "Upgrade to $DBversion done (Bug 24854 - Remove IDeamBooks* system preferences)\n";
6
}
(-)a/installer/data/mysql/sysprefs.sql (-3 lines)
Lines 228-236 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
228
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
228
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
229
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
229
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
230
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
230
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
231
('IDreamBooksReadometer','0','','Display Readometer from IDreamBooks.com','YesNo'),
232
('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'),
233
('IDreamBooksReviews','0','','Display book review snippets from IDreamBooks.com','YesNo'),
234
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
231
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
235
('IllLog', 0, '', 'If ON, log information about ILL requests', 'YesNo'),
232
('IllLog', 0, '', 'If ON, log information about ILL requests', 'YesNo'),
236
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
233
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-19 lines)
Lines 184-208 Enhanced Content: Link Here
184
              choices:
184
              choices:
185
                  yes: in tabs.
185
                  yes: in tabs.
186
                  no: in line with the bibliographic information.
186
                  no: in line with the bibliographic information.
187
    IDreamLibraries:
188
        -
189
            - pref: IDreamBooksReviews
190
              choices:
191
                  yes: Add
192
                  no: "Don't add"
193
            - a tab on the OPAC details with book reviews from critics aggregated by <a href='https://idreambooks.com/'>IDreamBooks.com</a>.
194
        -
195
            - pref: IDreamBooksReadometer
196
              choices:
197
                  yes: Add
198
                  no: "Don't add"
199
            - a "Readometer" that summarizes the reviews gathered by <a href='https://idreambooks.com/'>IDreamBooks.com</a> to the OPAC details page.
200
        -
201
            - pref: IDreamBooksResults
202
              choices:
203
                  yes: Add
204
                  no: "Don't add"
205
            - the rating from <a href='https://idreambooks.com/'>IDreamBooks.com</a> to OPAC search results.
206
    Syndetics:
187
    Syndetics:
207
        -
188
        -
208
            - pref: SyndeticsEnabled
189
            - pref: SyndeticsEnabled
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-61 lines)
Lines 549-557 Link Here
549
                            [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
549
                            [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
550
                        [% END %]
550
                        [% END %]
551
551
552
                        [% IF ( IDreamBooksReviews ) %]
553
                            <li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li>
554
                        [% END %]
555
                    </ul>
552
                    </ul>
556
553
557
                    [% IF ( serialcollection ) %]
554
                    [% IF ( serialcollection ) %]
Lines 973-984 Link Here
973
                            </div><!-- / #images -->
970
                            </div><!-- / #images -->
974
                        [% END # / IF OPACLocalCoverImages && localimages.size %]
971
                        [% END # / IF OPACLocalCoverImages && localimages.size %]
975
972
976
                        [% IF ( IDreamBooksReviews ) %]
977
                            <div id="idb_critic_reviews">
978
                                <div id="idb_review_snippets"></div>
979
                                <span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span>
980
                            </div>
981
                        [% END %]
982
                </div> <!-- / #bibliodescriptions -->
973
                </div> <!-- / #bibliodescriptions -->
983
974
984
                [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
975
                [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
Lines 1682-1740 Link Here
1682
1673
1683
[% END # / IF ( OpacStarRatings != 'disable' )%]
1674
[% END # / IF ( OpacStarRatings != 'disable' )%]
1684
1675
1685
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1686
    var isbn = $(".isbn:last").text().split(" ")[1];
1687
    if (isbn) {
1688
        isbn = isbn.replace(/\W*$/, '');
1689
        isbn = isbn.replace(/-/, '');
1690
1691
        if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
1692
        // Use Microsoft XDR for IE version 8 or above
1693
            var xdr = new XDomainRequest();
1694
            xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
1695
            xdr.onload = function() {
1696
                json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
1697
                eval(json); // json is now a regular JSON object
1698
                parseIDBJSON(json); // parse using same function as for jQuery's success event
1699
            }
1700
            xdr.send();
1701
        } else {
1702
            $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
1703
                parseIDBJSON(json);
1704
            });
1705
        }
1706
    }
1707
[% END # / IDreamBooksReviews || IDreamBooksReadometer%]
1708
1709
});
1676
});
1710
    [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1711
        function parseIDBJSON( json ) {
1712
            if(json.total_results > 0 && json.book.rating > 0){
1713
                var isbn = $(".isbn:last").text().split(" ")[1];
1714
                isbn = isbn.replace(/\W+/g, '');
1715
1716
                [% IF ( IDreamBooksReadometer ) %]
1717
                    $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="https://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+_(" by ")+json.book.author+'" title="'+_("Rating based on reviews of ")+json.book.title+'"></a>');
1718
                [% END %]
1719
1720
                [% IF ( IDreamBooksReviews ) %]
1721
                    //build new tab for critic reviews
1722
                    $("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count));
1723
1724
                    //append happy-sad cloud review
1725
1726
                    $("#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>");
1727
1728
                    //insert data into Book reviews tab
1729
                    $.each(json.book.critic_reviews, function(){
1730
                            $("#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>");
1731
                            });
1732
                    $("#seemoreidb").attr('href', json.book.detail_link);
1733
                    $("#tab_idb_critic_reviews").show();
1734
                [% END %]
1735
            }
1736
        }
1737
    [% END # / IF IDreamBooksReviews || IDreamBooksReadometer %]
1738
1677
1739
        $(document).ready(function() {
1678
        $(document).ready(function() {
1740
            if( OPACPopupAuthorsSearch == "1" ){
1679
            if( OPACPopupAuthorsSearch == "1" ){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-44 lines)
Lines 330-346 Link Here
330
                                                        [% END %]
330
                                                        [% END %]
331
                                                    [% END %]
331
                                                    [% END %]
332
332
333
334
                                                    [% IF ( IDreamBooksResults && SEARCH_RESULT.normalized_isbn ) %]
335
                                                        <div class="idbresult" style="display: none;">
336
                                                            [% IF ( IDreamBooksReviews ) %]
337
                                                                <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]#idb_critic_reviews">
338
                                                            [% ELSE %]
339
                                                                <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
340
                                                            [% END %]
341
                                                            [% SEARCH_RESULT.normalized_isbn | html %]</a>
342
                                                        </div>
343
                                                    [% END %]
344
                                                </div>
333
                                                </div>
345
                                                [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
334
                                                [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
346
                                                    <!-- COinS / Openurl -->
335
                                                    <!-- COinS / Openurl -->
Lines 722-760 $(document).ready(function(){ Link Here
722
        e.preventDefault();
711
        e.preventDefault();
723
    });
712
    });
724
713
725
    [% IF ( IDreamBooksResults ) %]
726
        $('.idbresult').each(function() {
727
            var isbn = $(this).children('a').text().replace(/\s*/,'');
728
            var element = this;
729
730
            if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
731
            // Use Microsoft XDR for IE version 8 or above
732
                var xdr = new XDomainRequest();
733
                xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
734
                xdr.onload = function() {
735
                    json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
736
                    eval(json); // json is now a regular JSON object
737
                    if(json.total_results > 0 && json.book.rating > 0){
738
                        $(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+"%");
739
                        $(element).show();
740
                    } else {
741
                        $(element).remove();
742
                    }
743
                }
744
                xdr.send();
745
            } else {
746
                $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
747
                    if(json.total_results > 0 && json.book.rating > 0){
748
                        $(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+"%");
749
                        $(element).show();
750
                    } else {
751
                        $(element).remove();
752
                    }
753
                });
754
            }
755
        });
756
    [% END %]
757
758
    var param1 = "";
714
    var param1 = "";
759
    [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
715
    [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
760
    param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
716
    param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
(-)a/opac/opac-detail.pl (-3 lines)
Lines 1195-1203 if (C4::Context->preference('OPACLocalCoverImages') == 1) { Link Here
1195
    $template->{VARS}->{localimages} = \@images;
1195
    $template->{VARS}->{localimages} = \@images;
1196
}
1196
}
1197
1197
1198
$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
1199
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
1200
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
1201
$template->{VARS}->{OPACPopupAuthorsSearch} = C4::Context->preference('OPACPopupAuthorsSearch');
1198
$template->{VARS}->{OPACPopupAuthorsSearch} = C4::Context->preference('OPACPopupAuthorsSearch');
1202
1199
1203
if (C4::Context->preference('OpacHighlightedWords')) {
1200
if (C4::Context->preference('OpacHighlightedWords')) {
(-)a/opac/opac-search.pl (-3 lines)
Lines 1023-1031 if (C4::Context->preference('GoogleIndicTransliteration')) { Link Here
1023
$template->{VARS}->{DidYouMean} =
1023
$template->{VARS}->{DidYouMean} =
1024
  ( defined C4::Context->preference('OPACdidyoumean')
1024
  ( defined C4::Context->preference('OPACdidyoumean')
1025
      && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
1025
      && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
1026
$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
1027
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
1028
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
1029
1026
1030
if ($offset == 0) {
1027
if ($offset == 0) {
1031
    $template->param(firstPage => 1);
1028
    $template->param(firstPage => 1);
(-)a/t/db_dependent/UsageStats.t (-4 lines)
Lines 468-476 sub mocking_systempreferences_to_a_set_value { Link Here
468
        BakerTaylorEnabled
468
        BakerTaylorEnabled
469
        GoogleJackets
469
        GoogleJackets
470
        HTML5MediaEnabled
470
        HTML5MediaEnabled
471
        IDreamBooksReadometer
472
        IDreamBooksResults
473
        IDreamBooksReviews
474
        LibraryThingForLibrariesEnabled
471
        LibraryThingForLibrariesEnabled
475
        LocalCoverImages
472
        LocalCoverImages
476
        OPACLocalCoverImages
473
        OPACLocalCoverImages
477
- 

Return to bug 24854