From 0b90dc60f6e17fdbdaa359582a2dd68d22a21a80 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 18 Jun 2012 13:53:59 +0200 Subject: [PATCH] 8263 Make OPAC stylesheet preferences more consistent (dbrev) Content-Type: text/plain; charset="utf-8" This patch handles the dbrev for this report. It optionally saves the value of the former opacstylesheet pref into opaclayoutstylesheet. June 21, 2012: Rebased. --- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d06a188..19e0f72 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5392,6 +5392,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion ="3.09.00.XXX"; +if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { + my $query = "SELECT value FROM systempreferences WHERE variable='opacstylesheet'"; + my $remote= $dbh->selectrow_arrayref($query); + $dbh->do("DELETE from systempreferences WHERE variable='opacstylesheet'"); + if($remote && $remote->[0]) { + $query="UPDATE systempreferences SET value=? WHERE variable='opaclayoutstylesheet'"; + $dbh->do($query,undef,$remote->[0]); + print "NOTE: The URL of your remote opac css file has been moved to preference opaclayoutstylesheet.\n"; + } + print "Upgrade to $DBversion done (BZ 8263: Make OPAC stylesheet preferences more consistent)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.7.6