$dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserCSS', '', 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free' )");
$dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserJS', '', 'Define custom javascript for inclusion in the SCO module', 'free' )");
print "Upgrade to $DBversion done (Bug 9009: Add SCOUserCSS and SCOUserJS sysprefs)\n";
- SetVersion ($DBversion);
}
$DBversion = "3.11.00.015";
SetVersion($DBversion);
}
-
$DBversion = "3.11.00.026";
if ( CheckVersion($DBversion) ) {
$dbh->do(qq{
SetVersion ($DBversion);
}
+$DBversion = "3.11.00.030";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');");
+ print "Upgrade to $DBversion done (Add system preference FinesIncludeGracePeriod)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.100";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ print "Upgrade to $DBversion done (3.12-alpha release)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.101";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short')");
+ print "Upgrade to $DBversion done (Bug 9341: Problem with UNIMARC authors facets)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.102";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ DELETE FROM systempreferences WHERE variable='NoZebra'
+ });
+ $dbh->do(q{
+ DELETE FROM systempreferences WHERE variable='QueryRemoveStopwords'
+ });
+ print "Upgrade to $DBversion done (Remove deprecated NoZebra and QueryRemoveStopwords sysprefs)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.103";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("DELETE FROM systempreferences WHERE variable = 'insecure';");
+ print "Upgrade to $DBversion done (Bug 9827 - Remove 'insecure' system preference)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');");
+ print "Upgrade to $DBversion done (Bug 9403: Add DisplayIconsXSLT)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.104";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ print "Upgrade to $DBversion done (3.12-alpha2 release)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.105";
+if ( CheckVersion($DBversion) ) {
+ if ( C4::Context->preference("marcflavour") eq 'MARC21' ) {
+ $sth = $dbh->prepare(
+"SELECT frameworkcode FROM marc_tag_structure WHERE tagfield = '029'"
+ );
+ $sth->execute;
+ my $frameworkcodes = $sth->fetchall_hashref('frameworkcode');
+
+ for my $frameworkcode ( keys %$frameworkcodes ) {
+ $dbh->do( "
+ INSERT IGNORE INTO marc_subfield_structure (tagfield, tagsubfield, liblibrarian,
+ libopac, repeatable, mandatory, kohafield, tab, authorised_value, authtypecode,
+ value_builder, isurl, hidden, frameworkcode, seealso, link, defaultvalue) VALUES
+ ('029', 'a', 'OCLC library identifier', 'OCLC library identifier', 0, 0, '', 0, '', '', '', 0, -6, '$frameworkcode', '', '', NULL),
+ ('029', 'b', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, -6, '$frameworkcode', '', '', NULL),
+ ('029', 'c', 'OAI set name', 'OAI set name', 0, 0, '', 0, '', '', '', 0, -6, '$frameworkcode', '', '', NULL),
+ ('029', 't', 'Content type identifier', 'Content type identifier', 0, 0, '', 0, '', '', '', 0, -6, '$frameworkcode', '', '', NULL)
+ " );
+ }
+
+ for my $tag ( '863', '864', '865' ) {
+ $sth = $dbh->prepare(
+"SELECT frameworkcode FROM marc_tag_structure WHERE tagfield = '$tag'"
+ );
+ $sth->execute;
+ my $frameworkcodes = $sth->fetchall_hashref('frameworkcode');
+
+ for my $frameworkcode ( keys %$frameworkcodes ) {
+ $dbh->do( "
+ INSERT IGNORE INTO marc_subfield_structure (tagfield, tagsubfield, liblibrarian,
+ libopac, repeatable, mandatory, kohafield, tab, authorised_value, authtypecode,
+ value_builder, isurl, hidden, frameworkcode, seealso, link, defaultvalue) VALUES
+ ('$tag', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL),
+ ('$tag', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 5, '$frameworkcode', '', '', NULL)
+ " );
+ }
+ }
+ }
+ print "Upgrade to $DBversion done (Bug 9353: Missing subfields on MARC21 frameworks)\n";
+ SetVersion($DBversion);
+}
+
+
+$DBversion = "3.11.00.106";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES ('19', 'plugins', 'Koha plugins', '0')");
+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES
+ ('19', 'manage', 'Manage plugins ( install / uninstall )'),
+ ('19', 'tool', 'Use tool plugins'),
+ ('19', 'report', 'Use report plugins'),
+ ('19', 'configure', 'Configure plugins')
+ ");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo')");
+
+ $dbh->do("
+ CREATE TABLE IF NOT EXISTS plugin_data (
+ plugin_class varchar(255) NOT NULL,
+ plugin_key varchar(255) NOT NULL,
+ plugin_value text,
+ PRIMARY KEY (plugin_class,plugin_key)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ ");
+
+ print "Upgrade to $DBversion done (Bug 7804: Added plugin system.)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.107";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice')");
+ print "Upgrade to $DBversion done (Bug 9014: Add syspref TimeFormat)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.108";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("ALTER TABLE action_logs CHANGE timestamp timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;");
+ $dbh->do("UPDATE action_logs SET info=(SELECT itemnumber FROM items WHERE biblionumber= action_logs.info LIMIT 1) WHERE module='CIRCULATION' AND action in ('ISSUE','RETURN');");
+ $dbh->do("ALTER TABLE action_logs CHANGE timestamp timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;");
+ print "Upgrade to $DBversion done (Bug 7241: Fix on circulation logs)\n";
+ print "WARNING about bug 7241: to partially correct the broken logs, the log history is filled with the first found item for each biblio.\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
Drop all foreign keys of the table $table
=cut
+
sub DropAllForeignKeys {
my ($table) = @_;
# get the table description