From 287476e8560d5c3d41968d2f49cc5f3972ee14b7 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 22 Dec 2014 01:02:35 -0500 Subject: [PATCH] Bug 11431 [7] - Add new table for audio alerts --- Koha/Schema/Result/AudioAlert.pm | 81 ++++++++++++++++++++ .../data/mysql/de-DE/optional/audio_alerts.sql | 4 + .../data/mysql/de-DE/optional/audio_alerts.txt | 1 + installer/data/mysql/en/optional/audio_alerts.sql | 4 + installer/data/mysql/en/optional/audio_alerts.txt | 1 + .../data/mysql/es-ES/optional/audio_alerts.sql | 4 + .../data/mysql/es-ES/optional/audio_alerts.txt | 1 + .../data/mysql/fr-FR/2-Optionel/audio_alerts.sql | 4 + .../data/mysql/fr-FR/2-Optionel/audio_alerts.txt | 1 + installer/data/mysql/kohastructure.sql | 14 ++++ .../data/mysql/nb-NO/2-Valgfritt/audio_alerts.sql | 4 + .../data/mysql/nb-NO/2-Valgfritt/audio_alerts.txt | 1 + .../data/mysql/pl-PL/optional/audio_alerts.sql | 4 + .../data/mysql/pl-PL/optional/audio_alerts.txt | 1 + .../data/mysql/ru-RU/optional/audio_alerts.sql | 4 + .../data/mysql/ru-RU/optional/audio_alerts.txt | 1 + installer/data/mysql/sysprefs.sql | 7 -- .../data/mysql/uk-UA/optional/audio_alerts.sql | 4 + .../data/mysql/uk-UA/optional/audio_alerts.txt | 1 + installer/data/mysql/updatedatabase.pl | 23 ++++-- 20 files changed, 150 insertions(+), 15 deletions(-) create mode 100644 Koha/Schema/Result/AudioAlert.pm create mode 100644 installer/data/mysql/de-DE/optional/audio_alerts.sql create mode 100644 installer/data/mysql/de-DE/optional/audio_alerts.txt create mode 100644 installer/data/mysql/en/optional/audio_alerts.sql create mode 100644 installer/data/mysql/en/optional/audio_alerts.txt create mode 100644 installer/data/mysql/es-ES/optional/audio_alerts.sql create mode 100644 installer/data/mysql/es-ES/optional/audio_alerts.txt create mode 100644 installer/data/mysql/fr-FR/2-Optionel/audio_alerts.sql create mode 100644 installer/data/mysql/fr-FR/2-Optionel/audio_alerts.txt create mode 100644 installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.sql create mode 100644 installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.txt create mode 100644 installer/data/mysql/pl-PL/optional/audio_alerts.sql create mode 100644 installer/data/mysql/pl-PL/optional/audio_alerts.txt create mode 100644 installer/data/mysql/ru-RU/optional/audio_alerts.sql create mode 100644 installer/data/mysql/ru-RU/optional/audio_alerts.txt create mode 100644 installer/data/mysql/uk-UA/optional/audio_alerts.sql create mode 100644 installer/data/mysql/uk-UA/optional/audio_alerts.txt diff --git a/Koha/Schema/Result/AudioAlert.pm b/Koha/Schema/Result/AudioAlert.pm new file mode 100644 index 0000000..696040b --- /dev/null +++ b/Koha/Schema/Result/AudioAlert.pm @@ -0,0 +1,81 @@ +use utf8; +package Koha::Schema::Result::AudioAlert; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::AudioAlert + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("audio_alerts"); + +=head1 ACCESSORS + +=head2 audio_alert_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 precedence + + data_type: 'smallint' + extra: {unsigned => 1} + is_nullable: 0 + +=head2 selector + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 sound + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=cut + +__PACKAGE__->add_columns( + "audio_alert_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "precedence", + { data_type => "smallint", extra => { unsigned => 1 }, is_nullable => 0 }, + "selector", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "sound", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("audio_alert_id"); + + +# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-12-22 01:04:21 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yIXpJMcpovBDl3bBVrwLqg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/installer/data/mysql/de-DE/optional/audio_alerts.sql b/installer/data/mysql/de-DE/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/de-DE/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/de-DE/optional/audio_alerts.txt b/installer/data/mysql/de-DE/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/de-DE/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/en/optional/audio_alerts.sql b/installer/data/mysql/en/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/en/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/en/optional/audio_alerts.txt b/installer/data/mysql/en/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/en/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/es-ES/optional/audio_alerts.sql b/installer/data/mysql/es-ES/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/es-ES/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/es-ES/optional/audio_alerts.txt b/installer/data/mysql/es-ES/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/es-ES/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.sql b/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.txt b/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4ffbbf2..c9dafe6 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3502,6 +3502,20 @@ CREATE TABLE items_search_fields ( ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- 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; + /*!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/nb-NO/2-Valgfritt/audio_alerts.sql b/installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.txt b/installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/nb-NO/2-Valgfritt/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/pl-PL/optional/audio_alerts.sql b/installer/data/mysql/pl-PL/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/pl-PL/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/pl-PL/optional/audio_alerts.txt b/installer/data/mysql/pl-PL/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/pl-PL/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/ru-RU/optional/audio_alerts.sql b/installer/data/mysql/ru-RU/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/ru-RU/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/ru-RU/optional/audio_alerts.txt b/installer/data/mysql/ru-RU/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/ru-RU/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 5249728..2bb831a 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -42,10 +42,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), -( 'AudioAlertsCustom', '', NULL, 'Custom audio alert triggers in json associative array format', 'free' ), -( 'AudioAlertSelectorWarning', '.audio-alert-warning', NULL, 'List of jQuery selectors that should trigger warning alert', 'free' ), -( 'AudioAlertSelectorAction', '.audio-alert-action', NULL, 'List of jQuery selectors that should trigger action alert', 'free' ), -( 'AudioAlertSelectorSuccess', '.audio-alert-success', NULL, 'List of jQuery selectors that should trigger successs alert', 'free' ), ('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'), @@ -331,9 +327,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OverdueNoticeBcc','','','Email address to bcc outgoing overdue notices sent by email','free'), ('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'), ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), -( 'OverrideAudioAlertWarning', '', NULL, 'URL to an audio file to replace the default warning sound.', 'free' ), -( 'OverrideAudioAlertAction', '', NULL, 'URL to an audio file to replace the default "action required" sound.', 'free' ), -( 'OverrideAudioAlertSuccess', '', NULL, 'URL to an audio file to replace the default success sound.', 'free' ), ('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'), ('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'), ('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'), diff --git a/installer/data/mysql/uk-UA/optional/audio_alerts.sql b/installer/data/mysql/uk-UA/optional/audio_alerts.sql new file mode 100644 index 0000000..0c413a5 --- /dev/null +++ b/installer/data/mysql/uk-UA/optional/audio_alerts.sql @@ -0,0 +1,4 @@ +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'); diff --git a/installer/data/mysql/uk-UA/optional/audio_alerts.txt b/installer/data/mysql/uk-UA/optional/audio_alerts.txt new file mode 100644 index 0000000..da9fdfd --- /dev/null +++ b/installer/data/mysql/uk-UA/optional/audio_alerts.txt @@ -0,0 +1 @@ +Audio alerts diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b6a3c1..690c796 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9613,14 +9613,21 @@ if ( CheckVersion($DBversion) ) { $dbh->do(q{UPDATE systempreferences SET variable = 'AudioAlerts' WHERE variable = 'soundon'}); $dbh->do(q{ - INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES - ( 'AudioAlertsCustom', '', NULL, 'Custom audio alert triggers in json associative array format', 'free' ), - ( 'OverrideAudioAlertWarning', '', NULL, 'URL to an audio file to replace the default warning sound.', 'free' ), - ( 'OverrideAudioAlertAction', '', NULL, 'URL to an audio file to replace the default "action required" sound.', 'free' ), - ( 'OverrideAudioAlertSuccess', '', NULL, 'URL to an audio file to replace the default success sound.', 'free' ), - ( 'AudioAlertSelectorWarning', '.audio-alert-warning', NULL, 'List of jQuery selectors that should trigger warning alert', 'free' ), - ( 'AudioAlertSelectorAction', '.audio-alert-action', NULL, 'List of jQuery selectors that should trigger action alert', 'free' ), - ( 'AudioAlertSelectorSuccess', '.audio-alert-success', NULL, 'List of jQuery selectors that should trigger successs alert', 'free' ) + 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"; -- 1.7.2.5