From 2bc5c5a36094085d052a676020826cdbba840047 Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 03:43:35 +0200 Subject: [PATCH 1/4] Installation labels translated in browser lang Administrator from Account page Company from General Settings page --- application/views/pages/installation.php | 95 ++++++++++++++++++------ 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/application/views/pages/installation.php b/application/views/pages/installation.php index 917e23eb..a1529d69 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -24,7 +24,7 @@

Welcome to the Easy!Appointments installation page.

-

+

This page will help you set the main settings of your Easy!Appointments installation. You will be able to edit these settings and many more in the backend session of your system. Remember to use the URL to connect to the backend section @@ -36,68 +36,115 @@ submit new issues on GitHub Issues in order to help our development process. -

+

-

Administrator

+

Administrator

- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
+
-

Company

+

- - + + +
+ + + +
- - + + +
+ + + +
- - + + +
+ + + +
+
From c81ba8da21222c9441eb2cb39fceee2fc8b1f627 Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 14:25:25 +0200 Subject: [PATCH 2/4] Fix install alert msg not showed, pw confirm id + js errors lang js #retype-password to #password-confirm --- application/views/pages/installation.php | 2 +- assets/js/pages/installation.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/views/pages/installation.php b/application/views/pages/installation.php index a1529d69..0a7f9e49 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -39,7 +39,7 @@

-
+
diff --git a/assets/js/pages/installation.js b/assets/js/pages/installation.js index 34708551..28ba50af 100644 --- a/assets/js/pages/installation.js +++ b/assets/js/pages/installation.js @@ -25,7 +25,7 @@ App.Pages.Installation = (function () { const $phoneNumber = $('#phone-number'); const $username = $('#username'); const $password = $('#password'); - const $retypePassword = $('#retype-password'); + const $passwordConfirm = $('#password-confirm'); const $companyName = $('#company-name'); const $companyEmail = $('#company-email'); const $companyLink = $('#company-link'); @@ -97,31 +97,31 @@ App.Pages.Installation = (function () { }); if (missingRequired) { - throw new Error('All the page fields are required.'); + throw new Error(lang('fields_are_required')); } // Validate Passwords - if ($password.val() !== $retypePassword.val()) { + if ($password.val() !== $passwordConfirm.val()) { $password.addClass('is-invalid'); - $retypePassword.addClass('is-invalid'); - throw new Error('Passwords do not match!'); + $passwordConfirm.addClass('is-invalid'); + throw new Error(lang('passwords_mismatch')); } if ($password.val().length < MIN_PASSWORD_LENGTH) { $password.addClass('is-invalid'); - $retypePassword.addClass('is-invalid'); - throw new Error(`The password must be at least ${MIN_PASSWORD_LENGTH} characters long.`); + $passwordConfirm.addClass('is-invalid'); + throw new Error(lang('password_length_notice').replace('$number', MIN_PASSWORD_LENGTH)); } // Validate Email if (!App.Utils.Validation.email($email.val())) { $email.addClass('is-invalid'); - throw new Error('The email address is invalid!'); + throw new Error(lang('invalid_email')); } if (!App.Utils.Validation.email($companyEmail.val())) { $companyEmail.addClass('is-invalid'); - throw new Error('The email address is invalid!'); + throw new Error(lang('invalid_email')); } return true; From 556b77c08d1aed99eea22342c35f4f04eefb557c Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 17:21:20 +0200 Subject: [PATCH 3/4] 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(), }; } From 174856f8e31bb424c6329c0b4a485193830e667c Mon Sep 17 00:00:00 2001 From: Thomas Ingles Date: Tue, 30 Apr 2024 20:49:27 +0200 Subject: [PATCH 4/4] Install: html lang + language & timezone provider same as admin --- application/controllers/Installation.php | 2 ++ application/views/pages/installation.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php index cb2f6624..bc4e43c7 100644 --- a/application/controllers/Installation.php +++ b/application/controllers/Installation.php @@ -108,6 +108,8 @@ class Installation extends EA_Controller 'email' => 'jane@example.org', 'phone_number' => '+1 (000) 000-0000', 'services' => [$service_id], + 'language' => $admin['language'], + 'timezone' => $admin['timezone'], 'settings' => [ 'username' => 'janedoe', 'password' => random_string(), diff --git a/application/views/pages/installation.php b/application/views/pages/installation.php index 08265f07..0ccb71ec 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -1,5 +1,5 @@ - +