From 556b77c08d1aed99eea22342c35f4f04eefb557c Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 17:21:20 +0200 Subject: [PATCH] Install: Admin Add Language selector + set timezone by server --- application/controllers/Installation.php | 3 ++- application/views/pages/installation.php | 15 +++++++++++++++ assets/js/pages/installation.js | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php index 3cb571c9..cb2f6624 100644 --- a/application/controllers/Installation.php +++ b/application/controllers/Installation.php @@ -67,7 +67,7 @@ class Installation extends EA_Controller $this->instance->migrate(); // Insert admin - $admin['timezone'] = 'UTC'; + $admin['timezone'] = date_default_timezone_get(); $admin['settings']['username'] = $admin['username']; $admin['settings']['password'] = $admin['password']; $admin['settings']['notifications'] = true; @@ -79,6 +79,7 @@ class Installation extends EA_Controller 'user_id' => $admin['id'], 'user_email' => $admin['email'], 'role_slug' => DB_SLUG_ADMIN, + 'language' => $admin['language'], 'timezone' => $admin['timezone'], 'username' => $admin['settings']['username'], ]); diff --git a/application/views/pages/installation.php b/application/views/pages/installation.php index 0a7f9e49..08265f07 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -101,6 +101,21 @@ +
+ + +
+
diff --git a/assets/js/pages/installation.js b/assets/js/pages/installation.js index 28ba50af..6a4f2f83 100644 --- a/assets/js/pages/installation.js +++ b/assets/js/pages/installation.js @@ -26,6 +26,7 @@ App.Pages.Installation = (function () { const $username = $('#username'); const $password = $('#password'); const $passwordConfirm = $('#password-confirm'); + const $language = $('#language'); const $companyName = $('#company-name'); const $companyEmail = $('#company-email'); const $companyLink = $('#company-link'); @@ -145,6 +146,7 @@ App.Pages.Installation = (function () { phone_number: $phoneNumber.val(), username: $username.val(), password: $password.val(), + language: $language.val(), }; }