From 88bf1a75dbb3ac20b75a025eb711292c207d525c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 22 Dec 2014 05:56:33 -0500 Subject: [PATCH] Bug 11431: Update database Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/kohastructure.sql | 14 ++++++++++++++ installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 12b7924ce3..6cc013387f 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3581,6 +3581,20 @@ CREATE TABLE `localization` ( UNIQUE KEY `entity_code_lang` (`entity`,`code`,`lang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Table structure for table 'audio_alerts' +-- + +DROP TABLE IF EXISTS audio_alerts; +CREATE TABLE audio_alerts ( + audio_alert_id int(11) NOT NULL AUTO_INCREMENT, + precedence smallint(5) unsigned NOT NULL, + selector varchar(255) NOT NULL, + sound varchar(255) NOT NULL, + PRIMARY KEY (audio_alert_id), + KEY precedence (precedence) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index cb77b7d0e1..2e4a01924b 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -40,6 +40,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AmazonLocale','US','US|CA|DE|FR|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'), ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'), ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''), +('AudioAlerts','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), ('AuthDisplayHierarchy','0','','Display authority hierarchies','YesNo'), ('AuthoritiesLog','1',NULL,'If ON, log edit/create/delete actions on authorities.','YesNo'), ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'), @@ -410,7 +411,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'), ('SMSSendUsername', '', '', 'Username/Login used to send SMS messages', 'free'), ('SocialNetworks','0','','Enable/Disable social networks links in opac detail pages','YesNo'), -('soundon','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), ('SpecifyDueDate','1','','Define whether to display \"Specify Due Date\" form in Circulation','YesNo'), ('SpecifyReturnDate',1,'','Define whether to display \"Specify Return Date\" form in Circulation','YesNo'), ('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 5e1bff483d..b5301284fc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9669,7 +9669,32 @@ if ( CheckVersion($DBversion) ) { }); print "Upgrade to $DBversion done (Bug 1861: Unique patrons logins not (totally) enforced)\n"; } + SetVersion ($DBversion); +} + +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{UPDATE systempreferences SET variable = 'AudioAlerts' WHERE variable = 'soundon'}); + + $dbh->do(q{ + CREATE TABLE audio_alerts ( + audio_alert_id int(11) NOT NULL AUTO_INCREMENT, + precedence smallint(5) unsigned NOT NULL, + selector varchar(255) NOT NULL, + sound varchar(255) NOT NULL, + PRIMARY KEY (audio_alert_id), + KEY precedence (precedence) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + }); + + $dbh->do(q{ + INSERT INTO audio_alerts VALUES + (1, 1, '.audio-alert-action', 'opening.ogg'), + (2, 2, '.audio-alert-warning', 'critical.ogg'), + (3, 3, '.audio-alert-success', 'beep.ogg'); + }); + print "Upgrade to $DBversion done (Bug 11431 - Add additional sound options for warnings)\n"; SetVersion($DBversion); } -- 2.39.5