6 my $dbh=C4::Context->dbh;
12 # validate systempreferences.Coce and save the config for OpacCoce
13 my $current_coce_pref = C4::Context->preference('Coce') || 0;
15 # add two new systempreferences in order to have distinct behavior between intranet and OPAC
16 $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES
17 ('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff intranet', 'YesNo'),
18 ('OpacCoce','$current_coce_pref', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo')
19 ;") or die "Error applying Bug 18421: error inserting new values into database: ". $dbh->errstr . "\n";
21 $dbh->do("DELETE IGNORE FROM systempreferences WHERE variable = 'Coce';")
22 or die "Error applying Bug 18421: error deleting the old syspref 'Coce': ". $dbh->errstr . "\n";
24 print "Upgrade to XX.XX done (Bug 18421: Add Coce image cache to the Intranet)\n";