All the backend pages have the timezone information.
This commit is contained in:
parent
26442a1e17
commit
b639318dac
7 changed files with 36 additions and 22 deletions
|
@ -63,6 +63,7 @@ class Backend extends CI_Controller {
|
||||||
$this->load->model('roles_model');
|
$this->load->model('roles_model');
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
$this->load->model('secretaries_model');
|
$this->load->model('secretaries_model');
|
||||||
|
$this->load->model('timezones_model');
|
||||||
|
|
||||||
$view['base_url'] = $this->config->item('base_url');
|
$view['base_url'] = $this->config->item('base_url');
|
||||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||||
|
@ -77,6 +78,7 @@ class Backend extends CI_Controller {
|
||||||
$view['customers'] = $this->customers_model->get_batch();
|
$view['customers'] = $this->customers_model->get_batch();
|
||||||
$user = $this->user_model->get_settings($this->session->userdata('user_id'));
|
$user = $this->user_model->get_settings($this->session->userdata('user_id'));
|
||||||
$view['calendar_view'] = $user['settings']['calendar_view'];
|
$view['calendar_view'] = $user['settings']['calendar_view'];
|
||||||
|
$view['timezones'] = $this->timezones_model->to_array();
|
||||||
$this->set_user_data($view);
|
$this->set_user_data($view);
|
||||||
|
|
||||||
if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
|
if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
|
||||||
|
@ -127,6 +129,7 @@ class Backend extends CI_Controller {
|
||||||
$this->load->model('services_model');
|
$this->load->model('services_model');
|
||||||
$this->load->model('settings_model');
|
$this->load->model('settings_model');
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
$this->load->model('timezones_model');
|
||||||
|
|
||||||
$view['base_url'] = $this->config->item('base_url');
|
$view['base_url'] = $this->config->item('base_url');
|
||||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||||
|
@ -139,6 +142,7 @@ class Backend extends CI_Controller {
|
||||||
$view['customers'] = $this->customers_model->get_batch();
|
$view['customers'] = $this->customers_model->get_batch();
|
||||||
$view['available_providers'] = $this->providers_model->get_available_providers();
|
$view['available_providers'] = $this->providers_model->get_available_providers();
|
||||||
$view['available_services'] = $this->services_model->get_available_services();
|
$view['available_services'] = $this->services_model->get_available_services();
|
||||||
|
$view['timezones'] = $this->timezones_model->to_array();
|
||||||
|
|
||||||
if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
|
if ($this->session->userdata('role_slug') === DB_SLUG_SECRETARY)
|
||||||
{
|
{
|
||||||
|
@ -178,6 +182,7 @@ class Backend extends CI_Controller {
|
||||||
$this->load->model('services_model');
|
$this->load->model('services_model');
|
||||||
$this->load->model('settings_model');
|
$this->load->model('settings_model');
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
$this->load->model('timezones_model');
|
||||||
|
|
||||||
$view['base_url'] = $this->config->item('base_url');
|
$view['base_url'] = $this->config->item('base_url');
|
||||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||||
|
@ -188,6 +193,7 @@ class Backend extends CI_Controller {
|
||||||
$view['first_weekday'] = $this->settings_model->get_setting('first_weekday');
|
$view['first_weekday'] = $this->settings_model->get_setting('first_weekday');
|
||||||
$view['services'] = $this->services_model->get_batch();
|
$view['services'] = $this->services_model->get_batch();
|
||||||
$view['categories'] = $this->services_model->get_all_categories();
|
$view['categories'] = $this->services_model->get_all_categories();
|
||||||
|
$view['timezones'] = $this->timezones_model->to_array();
|
||||||
$this->set_user_data($view);
|
$this->set_user_data($view);
|
||||||
|
|
||||||
$this->load->view('backend/header', $view);
|
$this->load->view('backend/header', $view);
|
||||||
|
@ -216,6 +222,7 @@ class Backend extends CI_Controller {
|
||||||
$this->load->model('services_model');
|
$this->load->model('services_model');
|
||||||
$this->load->model('settings_model');
|
$this->load->model('settings_model');
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
$this->load->model('timezones_model');
|
||||||
|
|
||||||
$view['base_url'] = $this->config->item('base_url');
|
$view['base_url'] = $this->config->item('base_url');
|
||||||
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
$view['user_display_name'] = $this->user_model->get_user_display_name($this->session->userdata('user_id'));
|
||||||
|
@ -229,7 +236,8 @@ class Backend extends CI_Controller {
|
||||||
$view['secretaries'] = $this->secretaries_model->get_batch();
|
$view['secretaries'] = $this->secretaries_model->get_batch();
|
||||||
$view['services'] = $this->services_model->get_batch();
|
$view['services'] = $this->services_model->get_batch();
|
||||||
$view['working_plan'] = $this->settings_model->get_setting('company_working_plan');
|
$view['working_plan'] = $this->settings_model->get_setting('company_working_plan');
|
||||||
$view['extra_working_plan'] = "{}";
|
$view['timezones'] = $this->timezones_model->to_array();
|
||||||
|
$view['extra_working_plan'] = '{}';
|
||||||
$this->set_user_data($view);
|
$this->set_user_data($view);
|
||||||
|
|
||||||
$this->load->view('backend/header', $view);
|
$this->load->view('backend/header', $view);
|
||||||
|
@ -255,6 +263,7 @@ class Backend extends CI_Controller {
|
||||||
|
|
||||||
$this->load->model('settings_model');
|
$this->load->model('settings_model');
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
$this->load->model('timezones_model');
|
||||||
|
|
||||||
$this->load->library('session');
|
$this->load->library('session');
|
||||||
$user_id = $this->session->userdata('user_id');
|
$user_id = $this->session->userdata('user_id');
|
||||||
|
@ -269,6 +278,7 @@ class Backend extends CI_Controller {
|
||||||
$view['role_slug'] = $this->session->userdata('role_slug');
|
$view['role_slug'] = $this->session->userdata('role_slug');
|
||||||
$view['system_settings'] = $this->settings_model->get_settings();
|
$view['system_settings'] = $this->settings_model->get_settings();
|
||||||
$view['user_settings'] = $this->user_model->get_settings($user_id);
|
$view['user_settings'] = $this->user_model->get_settings($user_id);
|
||||||
|
$view['timezones'] = $this->timezones_model->to_array();
|
||||||
$this->set_user_data($view);
|
$this->set_user_data($view);
|
||||||
|
|
||||||
$this->load->view('backend/header', $view);
|
$this->load->view('backend/header', $view);
|
||||||
|
@ -369,6 +379,7 @@ class Backend extends CI_Controller {
|
||||||
// Get privileges
|
// Get privileges
|
||||||
$view['user_id'] = $this->session->userdata('user_id');
|
$view['user_id'] = $this->session->userdata('user_id');
|
||||||
$view['user_email'] = $this->session->userdata('user_email');
|
$view['user_email'] = $this->session->userdata('user_email');
|
||||||
|
$view['timezone'] = $this->session->userdata('timezone');
|
||||||
$view['role_slug'] = $this->session->userdata('role_slug');
|
$view['role_slug'] = $this->session->userdata('role_slug');
|
||||||
$view['privileges'] = $this->roles_model->get_privileges($this->session->userdata('role_slug'));
|
$view['privileges'] = $this->roles_model->get_privileges($this->session->userdata('role_slug'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,14 +461,7 @@ class Timezones_Model extends CI_Model {
|
||||||
*/
|
*/
|
||||||
public function to_array()
|
public function to_array()
|
||||||
{
|
{
|
||||||
$continents = [];
|
return array_merge(...array_values($this->timezones));
|
||||||
|
|
||||||
foreach ($this->timezones as $continent => $timezones)
|
|
||||||
{
|
|
||||||
$continents[] = $timezones;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_merge($continents);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,11 +26,13 @@
|
||||||
'customers' : <?= json_encode($customers) ?>,
|
'customers' : <?= json_encode($customers) ?>,
|
||||||
'secretaryProviders' : <?= json_encode($secretary_providers) ?>,
|
'secretaryProviders' : <?= json_encode($secretary_providers) ?>,
|
||||||
'calendarView' : <?= json_encode($calendar_view) ?>,
|
'calendarView' : <?= json_encode($calendar_view) ?>,
|
||||||
|
'timezones' : <?= json_encode($timezones) ?>,
|
||||||
'user' : {
|
'user' : {
|
||||||
'id' : <?= $user_id ?>,
|
'id' : <?= $user_id ?>,
|
||||||
'email' : <?= json_encode($user_email) ?>,
|
'email' : <?= json_encode($user_email) ?>,
|
||||||
|
'timezone' : <?= json_encode($timezone) ?>,
|
||||||
'role_slug' : <?= json_encode($role_slug) ?>,
|
'role_slug' : <?= json_encode($role_slug) ?>,
|
||||||
'privileges': <?= json_encode($privileges) ?>
|
'privileges': <?= json_encode($privileges) ?>,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui-timepicker-addon.js') ?>"></script>
|
<script src="<?= asset_url('assets/ext/jquery-ui/jquery-ui-timepicker-addon.min.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/backend_customers_helper.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/backend_customers_helper.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/backend_customers.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/backend_customers.js') ?>"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@ -11,9 +11,11 @@
|
||||||
timeFormat : <?= json_encode($time_format) ?>,
|
timeFormat : <?= json_encode($time_format) ?>,
|
||||||
baseUrl : <?= json_encode($base_url) ?>,
|
baseUrl : <?= json_encode($base_url) ?>,
|
||||||
customers : <?= json_encode($customers) ?>,
|
customers : <?= json_encode($customers) ?>,
|
||||||
|
timezones : <?= json_encode($timezones) ?>,
|
||||||
user : {
|
user : {
|
||||||
id : <?= $user_id ?>,
|
id : <?= $user_id ?>,
|
||||||
email : <?= json_encode($user_email) ?>,
|
email : <?= json_encode($user_email) ?>,
|
||||||
|
timezone : <?= json_encode($timezone) ?>,
|
||||||
role_slug : <?= json_encode($role_slug) ?>,
|
role_slug : <?= json_encode($role_slug) ?>,
|
||||||
privileges : <?= json_encode($privileges) ?>
|
privileges : <?= json_encode($privileges) ?>
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
timeFormat : <?= json_encode($time_format) ?>,
|
timeFormat : <?= json_encode($time_format) ?>,
|
||||||
services : <?= json_encode($services) ?>,
|
services : <?= json_encode($services) ?>,
|
||||||
categories : <?= json_encode($categories) ?>,
|
categories : <?= json_encode($categories) ?>,
|
||||||
|
timezones : <?= json_encode($timezones) ?>,
|
||||||
user : {
|
user : {
|
||||||
id : <?= $user_id ?>,
|
id : <?= $user_id ?>,
|
||||||
email : <?= json_encode($user_email) ?>,
|
email : <?= json_encode($user_email) ?>,
|
||||||
|
timezone : <?= json_encode($timezone) ?>,
|
||||||
role_slug : <?= json_encode($role_slug) ?>,
|
role_slug : <?= json_encode($role_slug) ?>,
|
||||||
privileges: <?= json_encode($privileges) ?>
|
privileges: <?= json_encode($privileges) ?>
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
'firstWeekday' : <?= json_encode($first_weekday); ?>,
|
'firstWeekday' : <?= json_encode($first_weekday); ?>,
|
||||||
'timeFormat' : <?= json_encode($time_format) ?>,
|
'timeFormat' : <?= json_encode($time_format) ?>,
|
||||||
'userSlug' : <?= json_encode($role_slug) ?>,
|
'userSlug' : <?= json_encode($role_slug) ?>,
|
||||||
|
'timezones' : <?= json_encode($timezones) ?>,
|
||||||
'settings' : {
|
'settings' : {
|
||||||
'system' : <?= json_encode($system_settings) ?>,
|
'system' : <?= json_encode($system_settings) ?>,
|
||||||
'user' : <?= json_encode($user_settings) ?>
|
'user' : <?= json_encode($user_settings) ?>
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
'user' : {
|
'user' : {
|
||||||
'id' : <?= $user_id ?>,
|
'id' : <?= $user_id ?>,
|
||||||
'email' : <?= json_encode($user_email) ?>,
|
'email' : <?= json_encode($user_email) ?>,
|
||||||
|
'timezone' : <?= json_encode($timezone) ?>,
|
||||||
'role_slug' : <?= json_encode($role_slug) ?>,
|
'role_slug' : <?= json_encode($role_slug) ?>,
|
||||||
'privileges': <?= json_encode($privileges) ?>
|
'privileges': <?= json_encode($privileges) ?>
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,20 +7,22 @@
|
||||||
<script src="<?= asset_url('assets/ext/jquery-jeditable/jquery.jeditable.min.js') ?>"></script>
|
<script src="<?= asset_url('assets/ext/jquery-jeditable/jquery.jeditable.min.js') ?>"></script>
|
||||||
<script>
|
<script>
|
||||||
var GlobalVariables = {
|
var GlobalVariables = {
|
||||||
csrfToken : <?= json_encode($this->security->get_csrf_hash()) ?>,
|
csrfToken : <?= json_encode($this->security->get_csrf_hash()) ?>,
|
||||||
baseUrl : <?= json_encode($base_url) ?>,
|
baseUrl : <?= json_encode($base_url) ?>,
|
||||||
dateFormat : <?= json_encode($date_format) ?>,
|
dateFormat : <?= json_encode($date_format) ?>,
|
||||||
firstWeekday : <?= json_encode($first_weekday); ?>,
|
firstWeekday : <?= json_encode($first_weekday); ?>,
|
||||||
timeFormat : <?= json_encode($time_format) ?>,
|
timeFormat : <?= json_encode($time_format) ?>,
|
||||||
admins : <?= json_encode($admins) ?>,
|
admins : <?= json_encode($admins) ?>,
|
||||||
providers : <?= json_encode($providers) ?>,
|
providers : <?= json_encode($providers) ?>,
|
||||||
secretaries : <?= json_encode($secretaries) ?>,
|
secretaries : <?= json_encode($secretaries) ?>,
|
||||||
services : <?= json_encode($services) ?>,
|
services : <?= json_encode($services) ?>,
|
||||||
workingPlan : <?= json_encode(json_decode($working_plan)) ?>,
|
timezones : <?= json_encode($timezones) ?>,
|
||||||
extraWorkingPlan : <?= json_encode(json_decode($extra_working_plan)) ?>,
|
workingPlan : <?= json_encode(json_decode($working_plan)) ?>,
|
||||||
|
extraWorkingPlan : <?= json_encode(json_decode($extra_working_plan)) ?>,
|
||||||
user : {
|
user : {
|
||||||
id : <?= $user_id ?>,
|
id : <?= $user_id ?>,
|
||||||
email : <?= json_encode($user_email) ?>,
|
email : <?= json_encode($user_email) ?>,
|
||||||
|
timezone : <?= json_encode($timezone) ?>,
|
||||||
role_slug : <?= json_encode($role_slug) ?>,
|
role_slug : <?= json_encode($role_slug) ?>,
|
||||||
privileges : <?= json_encode($privileges) ?>
|
privileges : <?= json_encode($privileges) ?>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue