Fixed timezone warning by adding timezone config option
This commit is contained in:
@@ -67,6 +67,10 @@ abstract class Base
|
|||||||
$language = $this->config->get('language', 'en_US');
|
$language = $this->config->get('language', 'en_US');
|
||||||
if ($language !== 'en_US') \Translator\load($language);
|
if ($language !== 'en_US') \Translator\load($language);
|
||||||
|
|
||||||
|
//set timezone
|
||||||
|
$timezone = $this->config->get('timezone', 'UTC');
|
||||||
|
date_default_timezone_set($timezone);
|
||||||
|
|
||||||
$this->response->csp();
|
$this->response->csp();
|
||||||
$this->response->nosniff();
|
$this->response->nosniff();
|
||||||
$this->response->xss();
|
$this->response->xss();
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class Config extends Base
|
|||||||
'values' => $this->config->getAll(),
|
'values' => $this->config->getAll(),
|
||||||
'errors' => array(),
|
'errors' => array(),
|
||||||
'menu' => 'config',
|
'menu' => 'config',
|
||||||
'title' => t('Settings')
|
'title' => t('Settings'),
|
||||||
|
'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +33,7 @@ class Config extends Base
|
|||||||
if ($this->config->save($values)) {
|
if ($this->config->save($values)) {
|
||||||
$this->config->reload();
|
$this->config->reload();
|
||||||
$this->session->flash(t('Settings saved successfully.'));
|
$this->session->flash(t('Settings saved successfully.'));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$this->session->flashError(t('Unable to save your settings.'));
|
$this->session->flashError(t('Unable to save your settings.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,8 @@ class Config extends Base
|
|||||||
'values' => $values,
|
'values' => $values,
|
||||||
'errors' => $errors,
|
'errors' => $errors,
|
||||||
'menu' => 'config',
|
'menu' => 'config',
|
||||||
'title' => t('Settings')
|
'title' => t('Settings'),
|
||||||
|
'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,4 +183,7 @@ return array(
|
|||||||
'There is no column in your project!' => 'Il n\'y a aucune colonne dans votre projet !',
|
'There is no column in your project!' => 'Il n\'y a aucune colonne dans votre projet !',
|
||||||
'Change assignee' => 'Changer la personne assignée',
|
'Change assignee' => 'Changer la personne assignée',
|
||||||
'Change assignee for the task "%s"' => 'Changer la personne assignée pour la tâche « %s »',
|
'Change assignee for the task "%s"' => 'Changer la personne assignée pour la tâche « %s »',
|
||||||
|
/* missing
|
||||||
|
'Timezone' => ''
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -183,4 +183,5 @@ return array(
|
|||||||
'There is no column in your project!' => 'Brak kolumnt w Twoim projekcie',
|
'There is no column in your project!' => 'Brak kolumnt w Twoim projekcie',
|
||||||
'Change assignee' => 'Zmień odpowiedzialną osobę',
|
'Change assignee' => 'Zmień odpowiedzialną osobę',
|
||||||
'Change assignee for the task "%s"' => 'Zmień odpowiedzialną osobę dla zadania "%s"',
|
'Change assignee for the task "%s"' => 'Zmień odpowiedzialną osobę dla zadania "%s"',
|
||||||
|
'Timezone' => 'Strefa czasowa'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ require __DIR__.'/schema.php';
|
|||||||
abstract class Base
|
abstract class Base
|
||||||
{
|
{
|
||||||
const APP_VERSION = 'master';
|
const APP_VERSION = 'master';
|
||||||
const DB_VERSION = 3;
|
const DB_VERSION = 4;
|
||||||
const DB_FILENAME = 'data/db.sqlite';
|
const DB_FILENAME = 'data/db.sqlite';
|
||||||
|
|
||||||
private static $dbInstance = null;
|
private static $dbInstance = null;
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
namespace Schema;
|
namespace Schema;
|
||||||
|
|
||||||
|
function version_4($pdo)
|
||||||
|
{
|
||||||
|
$pdo->exec('ALTER TABLE config ADD column timezone TEXT');
|
||||||
|
|
||||||
|
//set default timezone to UTC
|
||||||
|
$pdo->exec('UPDATE config SET timezone = \'UTC\'');
|
||||||
|
}
|
||||||
|
|
||||||
function version_3($pdo)
|
function version_3($pdo)
|
||||||
{
|
{
|
||||||
$pdo->exec('ALTER TABLE projects ADD column token TEXT');
|
$pdo->exec('ALTER TABLE projects ADD column token TEXT');
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<?= Helper\form_label(t('Webhooks token'), 'webhooks_token') ?>
|
<?= Helper\form_label(t('Webhooks token'), 'webhooks_token') ?>
|
||||||
<?= Helper\form_text('webhooks_token', $values, $errors, array('readonly')) ?><br/>
|
<?= Helper\form_text('webhooks_token', $values, $errors, array('readonly')) ?><br/>
|
||||||
|
|
||||||
|
<?= Helper\form_label(t('Timezone'), 'timezone') ?>
|
||||||
|
<?= Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user