From 64e2e072294563b7c834382c2de631687f235fe8 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 24 Feb 2014 18:08:58 -0500 Subject: Improve timezone pull-request and settings page --- controllers/config.php | 4 ++-- locales/fr_FR/translations.php | 6 ++---- locales/pl_PL/translations.php | 2 +- models/config.php | 6 ++++++ models/schema.php | 5 +---- templates/config_index.php | 8 +++++--- 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 @@
- -
-
+
@@ -25,6 +23,10 @@