summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-24 18:08:58 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-24 18:08:58 -0500
commit64e2e072294563b7c834382c2de631687f235fe8 (patch)
treecdfc0e7ae9b72e2d6166376a8c757a0325152c30
parente374a6fd6499b50d4587d136490ced7444f8bc2b (diff)
Improve timezone pull-request and settings page
-rw-r--r--controllers/config.php4
-rw-r--r--locales/fr_FR/translations.php6
-rw-r--r--locales/pl_PL/translations.php2
-rw-r--r--models/config.php6
-rw-r--r--models/schema.php5
-rw-r--r--templates/config_index.php8
6 files changed, 17 insertions, 14 deletions
diff --git a/controllers/config.php b/controllers/config.php
index 51a04079..5dfa828b 100644
--- a/controllers/config.php
+++ b/controllers/config.php
@@ -16,7 +16,7 @@ class Config extends Base
'errors' => array(),
'menu' => 'config',
'title' => t('Settings'),
- 'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
+ 'timezones' => $this->config->getTimezones()
)));
}
@@ -49,7 +49,7 @@ class Config extends Base
'errors' => $errors,
'menu' => 'config',
'title' => t('Settings'),
- 'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
+ 'timezones' => $this->config->getTimezones()
)));
}
diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php
index 044b5b3e..6d7f70ce 100644
--- a/locales/fr_FR/translations.php
+++ b/locales/fr_FR/translations.php
@@ -85,7 +85,7 @@ return array(
'settings' => 'préférences',
'Application Settings' => 'Paramètres de l\'application',
'Language' => 'Langue',
- 'Webhooks token' => 'Jeton de securité pour les webhooks',
+ 'Webhooks token:' => 'Jeton de securité pour les webhooks :',
'More information' => 'Plus d\'informations',
'Database size:' => 'Taille de la base de données :',
'Download the database' => 'Télécharger la base de données',
@@ -183,7 +183,5 @@ return array(
'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 for the task "%s"' => 'Changer la personne assignée pour la tâche « %s »',
- /* missing
- 'Timezone' => ''
- */
+ 'Timezone' => 'Fuseau horaire',
);
diff --git a/locales/pl_PL/translations.php b/locales/pl_PL/translations.php
index ee0c6894..99fd8297 100644
--- a/locales/pl_PL/translations.php
+++ b/locales/pl_PL/translations.php
@@ -85,7 +85,7 @@ return array(
'settings' => 'ustawienia',
'Application Settings' => 'Ustawienia aplikacji',
'Language' => 'Język',
- 'Webhooks token' => 'Token',
+ 'Webhooks token:' => 'Token :',
'More information' => 'Więcej informacji',
'Database size:' => 'Rozmiar bazy danych :',
'Download the database' => 'Pobierz bazę danych',
diff --git a/models/config.php b/models/config.php
index f4d34986..a00d0b7e 100644
--- a/models/config.php
+++ b/models/config.php
@@ -9,6 +9,12 @@ class Config extends Base
{
const TABLE = 'config';
+ public function getTimezones()
+ {
+ $timezones = \timezone_identifiers_list();
+ return array_combine(array_values($timezones), $timezones);
+ }
+
public function getLanguages()
{
$languages = array(
diff --git a/models/schema.php b/models/schema.php
index 3704aad1..66571bbe 100644
--- a/models/schema.php
+++ b/models/schema.php
@@ -4,10 +4,7 @@ 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\'');
+ $pdo->exec("ALTER TABLE config ADD column timezone TEXT DEFAULT 'UTC'");
}
function version_3($pdo)
diff --git a/templates/config_index.php b/templates/config_index.php
index 6e55e4f2..5012538a 100644
--- a/templates/config_index.php
+++ b/templates/config_index.php
@@ -10,11 +10,9 @@
<?= Helper\form_label(t('Language'), 'language') ?>
<?= Helper\form_select('language', $languages, $values, $errors) ?><br/>
- <?= Helper\form_label(t('Webhooks token'), 'webhooks_token') ?>
- <?= 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">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
@@ -25,6 +23,10 @@
</div>
<section class="settings">
<ul>
+ <li>
+ <?= t('Webhooks token:') ?>
+ <strong><?= Helper\escape($values['webhooks_token']) ?></strong>
+ </li>
<li><?= t('Database size:') ?> <strong><?= Helper\format_bytes($db_size) ?></strong></li>
<li>
<a href="?controller=config&amp;action=downloadDb"><?= t('Download the database') ?></a>