mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 10:02:33 +03:00
Install: Admin Add Language selector + set timezone by server
This commit is contained in:
parent
c81ba8da21
commit
556b77c08d
3 changed files with 19 additions and 1 deletions
|
@ -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'],
|
||||
]);
|
||||
|
|
|
@ -101,6 +101,21 @@
|
|||
<input type="password" id="password-confirm" class="form-control required" maxlength="512">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="language">
|
||||
<?= lang('language') ?>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<select id="language" class="form-control required">
|
||||
<?php $config_lang = config('language');
|
||||
foreach (vars('available_languages') as $lang): ?>
|
||||
<option value="<?= $lang ?>"<?= ($lang == $config_lang ?' selected':'') ?>>
|
||||
<?= ucfirst($lang) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="company-settings col-12 col-sm-5">
|
||||
|
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue