Make sure the user ID and role slug are available on all backend pages.

This commit is contained in:
Alex Tselegidis 2022-01-10 09:36:11 +01:00
parent e2bffc5e95
commit d574a3b981
8 changed files with 23 additions and 4 deletions

View file

@ -56,6 +56,11 @@ class About extends EA_Controller {
$role_slug = session('role_slug');
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
]);
html_vars([
'page_title' => lang('settings'),
'active_menu' => PRIV_SYSTEM_SETTINGS,

View file

@ -53,9 +53,9 @@ class Admins extends EA_Controller {
$role_slug = session('role_slug');
script_vars([
'timezones' => $this->timezones->to_array(),
'user_id' => $user_id,
'role_slug' => $role_slug,
'timezones' => $this->timezones->to_array(),
'min_password_length' => MIN_PASSWORD_LENGTH,
]);

View file

@ -53,8 +53,12 @@ class Booking_settings extends EA_Controller {
}
$user_id = session('user_id');
$role_slug = session('role_slug');
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
'booking_settings' => $this->settings_model->get_batch()
]);

View file

@ -53,8 +53,12 @@ class Business_settings extends EA_Controller {
}
$user_id = session('user_id');
$role_slug = session('role_slug');
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
'business_settings' => $this->settings_model->get(),
'first_weekday' => setting('first_weekday'),
'time_format' => setting('time_format'),

View file

@ -72,11 +72,11 @@ class Customers extends EA_Controller {
}
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
'date_format' => $date_format,
'time_format' => $time_format,
'timezones' => $this->timezones->to_array(),
'user_id' => $user_id,
'role_slug' => $role_slug,
'secretary_providers' => $secretary_providers,
]);

View file

@ -46,6 +46,8 @@ class General_settings extends EA_Controller {
$user_id = session('user_id');
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
'general_settings' => $this->settings_model->get(),
]);

View file

@ -44,8 +44,12 @@ class Legal_settings extends EA_Controller {
}
$user_id = session('user_id');
$role_slug = session('role_slug');
script_vars([
'user_id' => $user_id,
'role_slug' => $role_slug,
'legal_settings' => $this->settings_model->get(),
]);

View file

@ -65,9 +65,9 @@ class Secretaries extends EA_Controller {
}
script_vars([
'timezones' => $this->timezones->to_array(),
'user_id' => $user_id,
'role_slug' => $role_slug,
'timezones' => $this->timezones->to_array(),
'min_password_length' => MIN_PASSWORD_LENGTH,
'providers' => $providers,
]);