From b9c43464e8c4a50aadbdfd274174fb4a673b8eb7 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Wed, 30 Jul 2008 11:18:02 -0500 Subject: [PATCH] bug 2335: adding SMSSendDriver system preference - DB update to version 3.00.00.105 Previously, the SMSSendDriver system preference was set as a local use system preference. This patch makes it an official system preference under the "Patron" tab. This system preference determines which SMS::Send driver is used to send SMS messages. I have attempted to take care to not overwrite this system preference if it has already been set. Signed-off-by: Joshua Ferraro --- admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 16 ++++++++++++++++ kohaversion.pl | 2 +- 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 670a55cc5a..c81146e4f9 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -184,6 +184,7 @@ my %tabsysprefs; $tabsysprefs{AutoEmailOpacUser}="Patrons"; $tabsysprefs{AutoEmailPrimaryAddress}="Patrons"; $tabsysprefs{EnhancedMessagingPreferences}="Patrons"; + $tabsysprefs{'SMSSendDriver'} = 'Patrons'; # I18N/L10N $tabsysprefs{dateformat}="I18N/L10N"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index f9139a93fb..a579169bbf 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -210,3 +210,5 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); -- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ? +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'); + diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index a059cf2788..59d9930e3f 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -210,4 +210,5 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Détermine le pilote utilisé par SMS::Send pour envoyer des SMS.','free'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 07685ce8d3..989b0ed973 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1903,6 +1903,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.00.00.105'; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + + # it is possible that this syspref is already defined since the feature was added some time ago. + unless ( $dbh->do(q(SELECT variable FROM systempreferences WHERE variable = 'SMSSendDriver')) ) { + $dbh->do(<<'END_SQL'); +INSERT INTO `systempreferences` + (variable,value,explanation,options,type) +VALUES +('SMSSendDriver','','Sets which SMS::Send driver is used to send SMS messages.','','free') +END_SQL + } + print "Upgrade to $DBversion done (added SMSSendDriver system preference)\n"; + SetVersion($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index c73df3aaee..69e1628f9e 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.00.104'; + our $VERSION = '3.00.00.105'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.2