SetVersion ($DBversion);
}
+
$DBversion = '3.09.00.033';
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');");
) ENGINE=InnoDB DEFAULT CHARSET=utf8");
print "Upgrade to $DBversion done (creating `transport_cost` table; adding UseTransportCostMatrix systempref, in circulation)\n";
- SetVersion ($DBversion);
+ SetVersion($DBversion);
}
$DBversion ="3.09.00.038";
SetVersion ($DBversion);
}
-
$DBversion = "3.09.00.053";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do(
SetVersion($DBversion);
}
-
$DBversion = "3.09.00.057";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE aqbasket ADD deliveryplace VARCHAR(10) default NULL AFTER basketgroupid;");
SetVersion($DBversion);
}
+$DBversion = "3.11.00.006";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do(q{
+ UPDATE virtualshelves SET sortfield="copyrightdate" where sortfield="year";
+ });
+ print "Upgrade to $DBversion done (Bug 9167: Update the virtualshelves.sortfield column with 'copyrightdate' if needed)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.007";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ar', 'language', 'de', 'Arabisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hy', 'language', 'de', 'Armenisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'bg', 'language', 'de', 'Bulgarisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'zh', 'language', 'de', 'Chinesisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'cs', 'language', 'de', 'Tschechisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'da', 'language', 'de', 'Dänisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nl', 'language', 'de', 'Niederländisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'en', 'language', 'de', 'Englisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fi', 'language', 'de', 'Finnisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fr', 'language', 'de', 'Französisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'lo', 'language', 'fr', 'Laotien')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'lo', 'language', 'de', 'Laotisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'el', 'language', 'de', 'Griechisch (Nach 1453)')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'he', 'language', 'de', 'Hebräisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hi', 'language', 'de', 'Hindi')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hu', 'language', 'de', 'Ungarisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'id', 'language', 'de', 'Indonesisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'it', 'language', 'de', 'Italienisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ja', 'language', 'de', 'Japanisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ko', 'language', 'de', 'Koreanisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'la', 'language', 'de', 'Latein')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'gl', 'language', 'fr', 'Galicien')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'gl', 'language', 'de', 'Galizisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nb', 'language', 'de', 'Norwegisch bokmål')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nn', 'language', 'de', 'Norwegisch nynorsk')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fa', 'language', 'de', 'Persisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'pl', 'language', 'de', 'Polnisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'pt', 'language', 'de', 'Portugiesisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ro', 'language', 'de', 'Rumänisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ru', 'language', 'de', 'Russisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sr', 'language', 'fr', 'Serbe')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sr', 'language', 'de', 'Serbisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'es', 'language', 'de', 'Spanisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sv', 'language', 'de', 'Schwedisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tet', 'language', 'fr', 'Tétoum')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tet', 'language', 'de', 'Tetum')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'th', 'language', 'de', 'Thailändisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tr', 'language', 'de', 'Türkisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'uk', 'language', 'de', 'Ukrainisch')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ur', 'language', 'fr', 'Ourdou')");
+ $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ur', 'language', 'de', 'Urdu')");
+ print "Upgrade to $DBversion done (Bug 9056: add German and a couple of French translations to language_descriptions)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.008";
+if (CheckVersion($DBversion)) {
+ $dbh->do("
+ CREATE TABLE IF NOT EXISTS `borrower_modifications` (
+ `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `verification_token` varchar(255) NOT NULL DEFAULT '',
+ `borrowernumber` int(11) NOT NULL DEFAULT '0',
+ `cardnumber` varchar(16) DEFAULT NULL,
+ `surname` mediumtext,
+ `firstname` text,
+ `title` mediumtext,
+ `othernames` mediumtext,
+ `initials` text,
+ `streetnumber` varchar(10) DEFAULT NULL,
+ `streettype` varchar(50) DEFAULT NULL,
+ `address` mediumtext,
+ `address2` text,
+ `city` mediumtext,
+ `state` text,
+ `zipcode` varchar(25) DEFAULT NULL,
+ `country` text,
+ `email` mediumtext,
+ `phone` text,
+ `mobile` varchar(50) DEFAULT NULL,
+ `fax` mediumtext,
+ `emailpro` text,
+ `phonepro` text,
+ `B_streetnumber` varchar(10) DEFAULT NULL,
+ `B_streettype` varchar(50) DEFAULT NULL,
+ `B_address` varchar(100) DEFAULT NULL,
+ `B_address2` text,
+ `B_city` mediumtext,
+ `B_state` text,
+ `B_zipcode` varchar(25) DEFAULT NULL,
+ `B_country` text,
+ `B_email` text,
+ `B_phone` mediumtext,
+ `dateofbirth` date DEFAULT NULL,
+ `branchcode` varchar(10) DEFAULT NULL,
+ `categorycode` varchar(10) DEFAULT NULL,
+ `dateenrolled` date DEFAULT NULL,
+ `dateexpiry` date DEFAULT NULL,
+ `gonenoaddress` tinyint(1) DEFAULT NULL,
+ `lost` tinyint(1) DEFAULT NULL,
+ `debarred` date DEFAULT NULL,
+ `debarredcomment` varchar(255) DEFAULT NULL,
+ `contactname` mediumtext,
+ `contactfirstname` text,
+ `contacttitle` text,
+ `guarantorid` int(11) DEFAULT NULL,
+ `borrowernotes` mediumtext,
+ `relationship` varchar(100) DEFAULT NULL,
+ `ethnicity` varchar(50) DEFAULT NULL,
+ `ethnotes` varchar(255) DEFAULT NULL,
+ `sex` varchar(1) DEFAULT NULL,
+ `password` varchar(30) DEFAULT NULL,
+ `flags` int(11) DEFAULT NULL,
+ `userid` varchar(75) DEFAULT NULL,
+ `opacnote` mediumtext,
+ `contactnote` varchar(255) DEFAULT NULL,
+ `sort1` varchar(80) DEFAULT NULL,
+ `sort2` varchar(80) DEFAULT NULL,
+ `altcontactfirstname` varchar(255) DEFAULT NULL,
+ `altcontactsurname` varchar(255) DEFAULT NULL,
+ `altcontactaddress1` varchar(255) DEFAULT NULL,
+ `altcontactaddress2` varchar(255) DEFAULT NULL,
+ `altcontactaddress3` varchar(255) DEFAULT NULL,
+ `altcontactstate` text,
+ `altcontactzipcode` varchar(50) DEFAULT NULL,
+ `altcontactcountry` text,
+ `altcontactphone` varchar(50) DEFAULT NULL,
+ `smsalertnumber` varchar(50) DEFAULT NULL,
+ `privacy` int(11) DEFAULT NULL,
+ PRIMARY KEY (`verification_token`,`borrowernumber`),
+ KEY `verification_token` (`verification_token`),
+ KEY `borrowernumber` (`borrowernumber`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+");
+
+ $dbh->do("
+ INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
+ ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
+ ('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'),
+ ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
+ ('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
+ ('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'),
+ ('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free');
+ ");
+
+ $dbh->do("
+ INSERT INTO letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
+ VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
+
+ Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
+
+ http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
+
+ If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
+ )");
+
+ print "Upgrade to $DBversion done (Bug 7067: Add Patron Self Registration)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.009";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("
+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
+ ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'),
+ ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'),
+ ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'),
+ ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice')
+ ");
+
+ print "Upgrade to $DBversion done (Bug 7674: Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.010";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('RenewalSendNotice', '0', '', NULL, 'YesNo')");
+ $dbh->do(q{
+ INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
+ ('circulation','RENEWAL','Item Renewals','Item Renewals','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
+ });
+ print "Upgrade to $DBversion done (Bug 9151 - Renewal notice according to patron alert preferences)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.011";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaEnabled','not','Show a HTML5 media player in a tab on opac-detail.pl for media files catalogued in field 856.','not|opac|staff|both','Choice');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','Media file extensions','','free');");
+ print "Upgrade to $DBversion done (Bug 8377: Add HTML5MediaEnabled and HTML5MediaExtensions sysprefs)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.012";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',NULL,'YesNo')");
+ print "Upgrade to $DBversion done (Bug 9206: Only allow place holds in records that the patron don't have in his possession)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.013";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free')");
+ print "Upgrade to $DBversion done (Bug 9162 - Add a system preference to set which notes fields appears on title notes/description separator)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.014";
+if ( CheckVersion($DBversion) ) {
+ $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";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RentalsInNoissuesCharge', '1', 'Rental charges block checkouts (added to noissuescharge).',NULL,'YesNo');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ManInvInNoissuesCharge', '1', 'MANUAL_INV charges block checkouts (added to noissuescharge).',NULL,'YesNo');");
+ print "Upgrade to $DBversion done (Add sysprefs RentalsInNoissuesCharge and ManInvInNoissuesCharge.)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.016";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="<b>Required for staff login.</b> Staff access, allows viewing of catalogue in staff client." where flag="catalogue";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Edit Authorities" where flag="editauthorities";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Allow access to the reports module" where flag="reports";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Set library management parameters (deprecated)" where flag="management";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Manage serial subscriptions" where flag="serials";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Manage patrons fines and fees" where flag="updatecharges";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Check out and check in items" where flag="circulate";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Manage Koha system settings (Administration panel)" where flag="parameters";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Add or modify patrons" where flag="borrowers";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Use all tools (expand for granular tools permissions)" where flag="tools";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Allow staff members to modify permissions for other staff members" where flag="staffaccess";
+ });
+ $dbh->do(q{
+ UPDATE userflags SET flagdesc="Perform batch modification of patrons" where flag="edit_patrons";
+ });
+
+ print "Upgrade to $DBversion done (Bug 9382 - refresh permission descriptions to make more sense)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion ="3.11.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo');");
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo');");
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo');");
+ print "Upgrade to $DBversion done (Add IDreamBooks enhanced content)\n";
+ SetVersion($DBversion);
+}
+
+
=head1 FUNCTIONS
=head2 TableExists($table)
}
C4::Context::clear_syspref_cache(); # invalidate cached preferences
}
+
+=head2 CheckVersion
+
+Check whether a given update should be run when passed the proposed version
+number. The update will always be run if the proposed version is greater
+than the current database version and less than or equal to the version in
+kohaversion.pl. The update is also run if the version contains XXX, though
+this behavior will be changed following the adoption of non-linear updates
+as implemented in bug 7167.
+
+=cut
+
+sub CheckVersion {
+ my ($proposed_version) = @_;
+ my $version_number = TransformToNum($proposed_version);
+
+ # The following line should be deleted when bug 7167 is pushed
+ return 1 if ( $proposed_version =~ m/XXX/ );
+
+ if ( C4::Context->preference("Version") < $version_number
+ && $version_number <= TransformToNum( C4::Context->final_linear_version ) )
+ {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
exit;