1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3 my $opaclang = C4::Context->preference("opaclanguages");
5 push @langs, split ( '\,', $opaclang );
6 # Get any existing value from the opacheader system preference
7 my ($opacheader) = $dbh->selectrow_array( q|
8 SELECT value FROM systempreferences WHERE variable='opacheader';
11 foreach my $lang ( @langs ) {
12 print "Inserting opacheader contents into $lang news item...\n";
13 # If there is a value in the opacheader preference, insert it into opac_news
14 $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, 'opacheader $lang', ?)", undef, "opacheader_$lang", $opacheader);
17 # Remove the opacheader system preference
18 $dbh->do("DELETE FROM systempreferences WHERE variable='opacheader'");
19 SetVersion ($DBversion);
20 print "Upgrade to $DBversion done (Bug 22880: Move contents of opacheader preference to Koha news system)\n";