diff --git a/CHANGELOG b/CHANGELOG index b0d879ac..9364b74b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ CREATE TABLE `questionnaire_timeslot` ( PRIMARY KEY ( `questionnaire_id` , `availability_group_id` ) ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci; +INSERT INTO `setting` (`setting_id`,`field`,`value`) +VALUES (NULL , 'DEFAULT_TIME_ZONE', 's:18:"Australia/Victoria";'); queXS 1.10.4 - Changes since 1.10.3 diff --git a/admin/clients.php b/admin/clients.php index 68f46f2c..ef450b1b 100644 --- a/admin/clients.php +++ b/admin/clients.php @@ -111,7 +111,7 @@ if ($a)

-

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",DEFAULT_TIME_ZONE)); ?>

+

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",get_setting("DEFAULT_TIME_ZONE"))); ?>

" />

diff --git a/admin/operators.php b/admin/operators.php index d56054db..9e7c1886 100644 --- a/admin/operators.php +++ b/admin/operators.php @@ -211,7 +211,7 @@ $ers = $db->GetAll($sql);

-

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",DEFAULT_TIME_ZONE)); ?>

+

"; display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,false,array("value",get_setting("DEFAULT_TIME_ZONE"))); ?>

"; display_chooser($ers,"extension_id","extension_id",true,false,false,false); ?>

diff --git a/admin/timezonetemplate.php b/admin/timezonetemplate.php index 2cd472be..963de5bd 100644 --- a/admin/timezonetemplate.php +++ b/admin/timezonetemplate.php @@ -58,6 +58,11 @@ include("../functions/functions.input.php"); global $db; +if (isset($_POST['dtime_zone'])) +{ + set_setting('DEFAULT_TIME_ZONE', $_POST['dtime_zone']); +} + if (isset($_GET['time_zone'])) { //need to add sample to questionnaire @@ -86,8 +91,10 @@ if (isset($_GET['tz'])) xhtml_head(T_("Add/Remove Timezones"),true,array("../css/shifts.css"),array("../js/window.js")); +$dtz = get_setting("DEFAULT_TIME_ZONE"); + $sql = "SELECT name as value, name as description, - CASE WHEN name LIKE '" . DEFAULT_TIME_ZONE . "' THEN 'selected=\'selected\'' ELSE '' END AS selected + CASE WHEN name LIKE '$dtz' THEN 'selected=\'selected\'' ELSE '' END AS selected FROM mysql.time_zone_name"; $tzl = $db->GetAll($sql); @@ -97,6 +104,13 @@ if (empty($tzl) || !$tzl) print "
" . T_("Your database does not have timezones installed, please see here for details") . "
"; } +print "

" . T_("Set default timezone") . ":

"; + ?> +

+ + "/>

+
+ " . T_("Click to remove a Timezone from the default list") . ""; diff --git a/config.default.php b/config.default.php index 9bae7b71..61317e0b 100644 --- a/config.default.php +++ b/config.default.php @@ -40,12 +40,6 @@ */ -/** - * The default time zone - */ -if (!defined('DEFAULT_TIME_ZONE')) define('DEFAULT_TIME_ZONE', 'Australia/Victoria'); - - /** * Date time format for displaying * diff --git a/config.inc.local.php.example b/config.inc.local.php.example index 542ab098..bd8ef41b 100644 --- a/config.inc.local.php.example +++ b/config.inc.local.php.example @@ -38,11 +38,6 @@ * */ -/** - * The default time zone - */ -define('DEFAULT_TIME_ZONE', 'Australia/Victoria'); - /** * Flag for VoIP with Asterisk to be enabled or not */ diff --git a/database/quexs.sql b/database/quexs.sql index 9bf132ac..1e443b29 100644 --- a/database/quexs.sql +++ b/database/quexs.sql @@ -1787,6 +1787,10 @@ CREATE TABLE `setting` ( -- Dumping data for table `setting` -- +INSERT INTO `setting` (`setting_id`, `field`, `value`) VALUES +(1, 'DEFAULT_TIME_ZONE', 's:18:"Australia/Victoria";'), +(2, 'systemsort', 'b:0;'); + -- -------------------------------------------------------- diff --git a/functions/functions.calendar.php b/functions/functions.calendar.php index 057ac75c..5c3f3de3 100644 --- a/functions/functions.calendar.php +++ b/functions/functions.calendar.php @@ -232,7 +232,7 @@ function display_respondent_form($respondent_id = false,$case_id = false) /** * Use the default time zone if none other to work with */ - $rzone = DEFAULT_TIME_ZONE; + $rzone = get_setting("DEFAULT_TIME_ZONE"); $fn = ""; $ln = ""; diff --git a/functions/functions.import.php b/functions/functions.import.php index 92fe97cb..60514330 100644 --- a/functions/functions.import.php +++ b/functions/functions.import.php @@ -270,7 +270,7 @@ function import_file($file, $description, $fields, $firstrow = 2) //first find the timezone - $tzone = DEFAULT_TIME_ZONE; //set this to default + $tzone = get_setting("DEFAULT_TIME_ZONE"); //set this to default /** * Determine time zone from all possible sources in sample_var_type table diff --git a/referral.php b/referral.php index 4cb99cf2..7f08adfe 100644 --- a/referral.php +++ b/referral.php @@ -101,7 +101,7 @@ if (isset($_POST['submit'])) $rs = $db->GetAll($sql); - $tzone = DEFAULT_TIME_ZONE; //set this to default + $tzone = get_setting("DEFAULT_TIME_ZONE"); //set this to default //Get the timezone foreach($rs as $r)