diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php index 3cb571c9..bc4e43c7 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'], ]); @@ -107,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 917e23eb..0ccb71ec 100755 --- a/application/views/pages/installation.php +++ b/application/views/pages/installation.php @@ -1,5 +1,5 @@ - + @@ -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,130 @@ submit new issues on GitHub Issues in order to help our development process. -

+

-
+
-

Administrator

+

Administrator

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

Company

+

- - + + +
+ + + +
- - + + +
+ + + +
- - + + +
+ + + +
+
diff --git a/assets/js/pages/installation.js b/assets/js/pages/installation.js index 34708551..6a4f2f83 100644 --- a/assets/js/pages/installation.js +++ b/assets/js/pages/installation.js @@ -25,7 +25,8 @@ App.Pages.Installation = (function () { const $phoneNumber = $('#phone-number'); const $username = $('#username'); const $password = $('#password'); - const $retypePassword = $('#retype-password'); + const $passwordConfirm = $('#password-confirm'); + const $language = $('#language'); const $companyName = $('#company-name'); const $companyEmail = $('#company-email'); const $companyLink = $('#company-link'); @@ -97,31 +98,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; @@ -145,6 +146,7 @@ App.Pages.Installation = (function () { phone_number: $phoneNumber.val(), username: $username.val(), password: $password.val(), + language: $language.val(), }; }