@@ -, +, @@
- Apply patch and run the database update
- Verify that the IDreamBooks related system preferences are gone
- Verify that opac detail pages and result lists still work
as expected
- Run t/db_dependent/UsageStats.t
---
C4/UsageStats.pm | 3 -
.../bug_24854-remove_idreambooks.perl | 6 ++
installer/data/mysql/sysprefs.sql | 3 -
.../admin/preferences/enhanced_content.pref | 19 ------
.../bootstrap/en/modules/opac-detail.tt | 61 -------------------
.../bootstrap/en/modules/opac-results.tt | 44 -------------
opac/opac-detail.pl | 3 -
opac/opac-search.pl | 3 -
t/db_dependent/UsageStats.t | 3 -
9 files changed, 6 insertions(+), 139 deletions(-)
create mode 100644 installer/data/mysql/atomicupdate/bug_24854-remove_idreambooks.perl
--- a/C4/UsageStats.pm
+++ a/C4/UsageStats.pm
@@ -207,9 +207,6 @@ sub BuildReport {
BakerTaylorEnabled
GoogleJackets
HTML5MediaEnabled
- IDreamBooksReadometer
- IDreamBooksResults
- IDreamBooksReviews
LibraryThingForLibrariesEnabled
LocalCoverImages
OPACLocalCoverImages
--- a/installer/data/mysql/atomicupdate/bug_24854-remove_idreambooks.perl
+++ a/installer/data/mysql/atomicupdate/bug_24854-remove_idreambooks.perl
@@ -0,0 +1,6 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ $dbh->do( "DELETE FROM systempreferences WHERE variable in ('IDreamBooksReadometer','IDreamBooksResults','IDreamBooksReviews')" );
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 24854 - Remove IDreamBooks* system preferences)\n";
+}
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -229,9 +229,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
-('IDreamBooksReadometer','0','','Display Readometer from IDreamBooks.com','YesNo'),
-('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'),
-('IDreamBooksReviews','0','','Display book review snippets from IDreamBooks.com','YesNo'),
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
('IllLog', 0, '', 'If ON, log information about ILL requests', 'YesNo'),
('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'),
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
@@ -184,25 +184,6 @@ Enhanced Content:
choices:
yes: in tabs.
no: in line with the bibliographic information.
- IDreamLibraries:
- -
- - pref: IDreamBooksReviews
- choices:
- yes: Add
- no: "Don't add"
- - a tab on the OPAC details with book reviews from critics aggregated by IDreamBooks.com.
- -
- - pref: IDreamBooksReadometer
- choices:
- yes: Add
- no: "Don't add"
- - a "Readometer" that summarizes the reviews gathered by IDreamBooks.com to the OPAC details page.
- -
- - pref: IDreamBooksResults
- choices:
- yes: Add
- no: "Don't add"
- - the rating from IDreamBooks.com to OPAC search results.
Syndetics:
-
- pref: SyndeticsEnabled
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
@@ -549,9 +549,6 @@
[% IF ( defaulttab == 'media' ) %]
[% ELSE %][% END %]Play media
[% END %]
- [% IF ( IDreamBooksReviews ) %]
- Book reviews by critics ( XXX )
- [% END %]
[% IF ( serialcollection ) %]
@@ -973,12 +970,6 @@
[% END # / IF OPACLocalCoverImages && localimages.size %]
- [% IF ( IDreamBooksReviews ) %]
-
- [% END %]
[% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
@@ -1682,59 +1673,7 @@
[% END # / IF ( OpacStarRatings != 'disable' )%]
-[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
- var isbn = $(".isbn:last").text().split(" ")[1];
- if (isbn) {
- isbn = isbn.replace(/\W*$/, '');
- isbn = isbn.replace(/-/, '');
-
- if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
- // Use Microsoft XDR for IE version 8 or above
- var xdr = new XDomainRequest();
- xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
- xdr.onload = function() {
- json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... };
- eval(json); // json is now a regular JSON object
- parseIDBJSON(json); // parse using same function as for jQuery's success event
- }
- xdr.send();
- } else {
- $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
- parseIDBJSON(json);
- });
- }
- }
-[% END # / IDreamBooksReviews || IDreamBooksReadometer%]
-
});
- [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
- function parseIDBJSON( json ) {
- if(json.total_results > 0 && json.book.rating > 0){
- var isbn = $(".isbn:last").text().split(" ")[1];
- isbn = isbn.replace(/\W+/g, '');
-
- [% IF ( IDreamBooksReadometer ) %]
- $(".title").append('');
- [% END %]
-
- [% IF ( IDreamBooksReviews ) %]
- //build new tab for critic reviews
- $("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count));
-
- //append happy-sad cloud review
-
- $("#catalogue_detail_biblio").append(""+json.book.rating+"% "+_("rating based on reviews at iDreamBooks.com")+"");
-
- //insert data into Book reviews tab
- $.each(json.book.critic_reviews, function(){
- $("#idb_review_snippets").append("\"..."+this.snippet+"...\"
"+_("Review date: ")+this.review_date+"
");
- });
- $("#seemoreidb").attr('href', json.book.detail_link);
- $("#tab_idb_critic_reviews").show();
- [% END %]
- }
- }
- [% END # / IF IDreamBooksReviews || IDreamBooksReadometer %]
$(document).ready(function() {
if( OPACPopupAuthorsSearch == "1" ){
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
@@ -330,17 +330,6 @@
[% END %]
[% END %]
-
- [% IF ( IDreamBooksResults && SEARCH_RESULT.normalized_isbn ) %]
-
- [% END %]
[% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
@@ -722,39 +711,6 @@ $(document).ready(function(){
e.preventDefault();
});
- [% IF ( IDreamBooksResults ) %]
- $('.idbresult').each(function() {
- var isbn = $(this).children('a').text().replace(/\s*/,'');
- var element = this;
-
- if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
- // Use Microsoft XDR for IE version 8 or above
- var xdr = new XDomainRequest();
- xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
- xdr.onload = function() {
- json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... };
- eval(json); // json is now a regular JSON object
- if(json.total_results > 0 && json.book.rating > 0){
- $(element).children('a').html(""+json.book.rating+"%");
- $(element).show();
- } else {
- $(element).remove();
- }
- }
- xdr.send();
- } else {
- $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
- if(json.total_results > 0 && json.book.rating > 0){
- $(element).children('a').html(""+json.book.rating+"%");
- $(element).show();
- } else {
- $(element).remove();
- }
- });
- }
- });
- [% END %]
-
var param1 = "";
[% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
param1 += ""+_("Select titles to: ")+"";
--- a/opac/opac-detail.pl
+++ a/opac/opac-detail.pl
@@ -1195,9 +1195,6 @@ if (C4::Context->preference('OPACLocalCoverImages') == 1) {
$template->{VARS}->{localimages} = \@images;
}
-$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
-$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
-$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
$template->{VARS}->{OPACPopupAuthorsSearch} = C4::Context->preference('OPACPopupAuthorsSearch');
if (C4::Context->preference('OpacHighlightedWords')) {
--- a/opac/opac-search.pl
+++ a/opac/opac-search.pl
@@ -1023,9 +1023,6 @@ if (C4::Context->preference('GoogleIndicTransliteration')) {
$template->{VARS}->{DidYouMean} =
( defined C4::Context->preference('OPACdidyoumean')
&& C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
-$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
-$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
-$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
if ($offset == 0) {
$template->param(firstPage => 1);
--- a/t/db_dependent/UsageStats.t
+++ a/t/db_dependent/UsageStats.t
@@ -468,9 +468,6 @@ sub mocking_systempreferences_to_a_set_value {
BakerTaylorEnabled
GoogleJackets
HTML5MediaEnabled
- IDreamBooksReadometer
- IDreamBooksResults
- IDreamBooksReviews
LibraryThingForLibrariesEnabled
LocalCoverImages
OPACLocalCoverImages
--