From 6cda484e1da48efaeb1a3d4a47e60a0294c6dab1 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 17 Jul 2016 13:04:44 +0200 Subject: [PATCH] The calendar view setting will be available to javascript through GlobalVariables.calendarView (#182). --- src/application/config/constants.php | 4 ++++ src/application/controllers/Backend.php | 2 ++ src/application/views/backend/calendar.php | 13 ++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/application/config/constants.php b/src/application/config/constants.php index 5a0bf60e..d9265a83 100644 --- a/src/application/config/constants.php +++ b/src/application/config/constants.php @@ -77,5 +77,9 @@ define('DATE_FORMAT_YMD', 'YMD'); define('MIN_PASSWORD_LENGTH', 7); define('ANY_PROVIDER', 'any-provider'); + +define('CALENDAR_VIEW_DEFAULT', 'default'); +define('CALENDAR_VIEW_TABLE', 'table'); + /* End of file constants.php */ /* Location: ./application/config/constants.php */ diff --git a/src/application/controllers/Backend.php b/src/application/controllers/Backend.php index 0ae8be0e..fe6f1a2d 100644 --- a/src/application/controllers/Backend.php +++ b/src/application/controllers/Backend.php @@ -66,6 +66,8 @@ class Backend extends CI_Controller { $view['available_providers'] = $this->providers_model->get_available_providers(); $view['available_services'] = $this->services_model->get_available_services(); $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']; $this->set_user_data($view); if ($this->session->userdata('role_slug') == DB_SLUG_SECRETARY) { diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php index 7f46a2c8..8ac14f51 100644 --- a/src/application/views/backend/calendar.php +++ b/src/application/views/backend/calendar.php @@ -10,21 +10,28 @@ + + + +