diff --git a/application/controllers/Backend.php b/application/controllers/Backend.php
index 77ffa9d0..ae9e705f 100755
--- a/application/controllers/Backend.php
+++ b/application/controllers/Backend.php
@@ -63,6 +63,7 @@ class Backend extends CI_Controller {
$this->load->model('roles_model');
$this->load->model('user_model');
$this->load->model('secretaries_model');
+ $this->load->model('timezones_model');
$view['base_url'] = $this->config->item('base_url');
$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();
$user = $this->user_model->get_settings($this->session->userdata('user_id'));
$view['calendar_view'] = $user['settings']['calendar_view'];
+ $view['timezones'] = $this->timezones_model->to_array();
$this->set_user_data($view);
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('settings_model');
$this->load->model('user_model');
+ $this->load->model('timezones_model');
$view['base_url'] = $this->config->item('base_url');
$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['available_providers'] = $this->providers_model->get_available_providers();
$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)
{
@@ -178,6 +182,7 @@ class Backend extends CI_Controller {
$this->load->model('services_model');
$this->load->model('settings_model');
$this->load->model('user_model');
+ $this->load->model('timezones_model');
$view['base_url'] = $this->config->item('base_url');
$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['services'] = $this->services_model->get_batch();
$view['categories'] = $this->services_model->get_all_categories();
+ $view['timezones'] = $this->timezones_model->to_array();
$this->set_user_data($view);
$this->load->view('backend/header', $view);
@@ -216,6 +222,7 @@ class Backend extends CI_Controller {
$this->load->model('services_model');
$this->load->model('settings_model');
$this->load->model('user_model');
+ $this->load->model('timezones_model');
$view['base_url'] = $this->config->item('base_url');
$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['services'] = $this->services_model->get_batch();
$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->load->view('backend/header', $view);
@@ -255,6 +263,7 @@ class Backend extends CI_Controller {
$this->load->model('settings_model');
$this->load->model('user_model');
+ $this->load->model('timezones_model');
$this->load->library('session');
$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['system_settings'] = $this->settings_model->get_settings();
$view['user_settings'] = $this->user_model->get_settings($user_id);
+ $view['timezones'] = $this->timezones_model->to_array();
$this->set_user_data($view);
$this->load->view('backend/header', $view);
@@ -369,6 +379,7 @@ class Backend extends CI_Controller {
// Get privileges
$view['user_id'] = $this->session->userdata('user_id');
$view['user_email'] = $this->session->userdata('user_email');
+ $view['timezone'] = $this->session->userdata('timezone');
$view['role_slug'] = $this->session->userdata('role_slug');
$view['privileges'] = $this->roles_model->get_privileges($this->session->userdata('role_slug'));
}
diff --git a/application/models/Timezones_model.php b/application/models/Timezones_model.php
index 4a9f2091..d19833a9 100644
--- a/application/models/Timezones_model.php
+++ b/application/models/Timezones_model.php
@@ -461,14 +461,7 @@ class Timezones_Model extends CI_Model {
*/
public function to_array()
{
- $continents = [];
-
- foreach ($this->timezones as $continent => $timezones)
- {
- $continents[] = $timezones;
- }
-
- return array_merge($continents);
+ return array_merge(...array_values($this->timezones));
}
/**
diff --git a/application/views/backend/calendar.php b/application/views/backend/calendar.php
index 23051ae7..04a81b87 100755
--- a/application/views/backend/calendar.php
+++ b/application/views/backend/calendar.php
@@ -26,11 +26,13 @@
'customers' : = json_encode($customers) ?>,
'secretaryProviders' : = json_encode($secretary_providers) ?>,
'calendarView' : = json_encode($calendar_view) ?>,
+ 'timezones' : = json_encode($timezones) ?>,
'user' : {
'id' : = $user_id ?>,
'email' : = json_encode($user_email) ?>,
+ 'timezone' : = json_encode($timezone) ?>,
'role_slug' : = json_encode($role_slug) ?>,
- 'privileges': = json_encode($privileges) ?>
+ 'privileges': = json_encode($privileges) ?>,
}
};
diff --git a/application/views/backend/customers.php b/application/views/backend/customers.php
index f4109f24..3f1d527f 100755
--- a/application/views/backend/customers.php
+++ b/application/views/backend/customers.php
@@ -1,4 +1,4 @@
-
+