From 0a8b0f44ba54af021ba7be24279dddeba5176f77 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 24 Apr 2009 06:05:09 -0500 Subject: [PATCH] bug 3155 followup: tweak OPACAmazonReviews syspref * add to enhanced content tab of syspref editor * during upgrade, if database has OPACAmazonEnabled turned on, ensure that OPACAmazonReviews is on as well. Signed-off-by: Galen Charlton --- admin/systempreferences.pl | 1 + installer/data/mysql/updatedatabase.pl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index efc90e25e1..63937a9aeb 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -224,6 +224,7 @@ $tabsysprefs{AmazonLocale} = "EnhancedContent"; $tabsysprefs{AmazonAssocTag} = "EnhancedContent"; $tabsysprefs{AmazonSimilarItems} = "EnhancedContent"; $tabsysprefs{OPACAmazonSimilarItems} = "EnhancedContent"; +$tabsysprefs{OPACAmazonReviews} = "EnhancedContent"; # Babelthèque $tabsysprefs{Babeltheque} = "EnhancedContent"; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e2aa358bbc..2d51d77155 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2321,7 +2321,8 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.01.00.021"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonReviews', '0', 'Display Amazon readers reviews on OPAC','','YesNo'); + my $enable_reviews = C4::Context->preference('OPACAmazonEnabled') ? '1' : '0'; + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonReviews', '$enable_reviews', 'Display Amazon readers reviews on OPAC','','YesNo'); "); SetVersion ($DBversion); } -- 2.39.5