From 1aac411c7f33433979e33166a2d8d010d94f8833 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 26 Jul 2022 16:38:29 +0300 Subject: [PATCH] Create new "Integrations" page for managing 3rd party integrations --- application/controllers/Integrations.php | 75 +++++++++++ .../views/components/backend_header.php | 3 + application/views/pages/integrations.php | 118 ++++++++++++++++++ assets/css/pages/integrations.scss | 7 ++ 4 files changed, 203 insertions(+) create mode 100644 application/controllers/Integrations.php create mode 100755 application/views/pages/integrations.php create mode 100644 assets/css/pages/integrations.scss diff --git a/application/controllers/Integrations.php b/application/controllers/Integrations.php new file mode 100644 index 00000000..af4b696c --- /dev/null +++ b/application/controllers/Integrations.php @@ -0,0 +1,75 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.5.0 + * ---------------------------------------------------------------------------- */ + +/** + * Integrations controller. + * + * Displays the integrations page. + * + * @package Controllers + */ +class Integrations extends EA_Controller { + /** + * Calendar constructor. + */ + public function __construct() + { + parent::__construct(); + + $this->load->model('appointments_model'); + $this->load->model('customers_model'); + $this->load->model('services_model'); + $this->load->model('providers_model'); + $this->load->model('roles_model'); + $this->load->model('settings_model'); + + $this->load->library('accounts'); + $this->load->library('google_sync'); + $this->load->library('notifications'); + $this->load->library('synchronization'); + $this->load->library('timezones'); + } + + /** + * Render the settings page. + */ + public function index() + { + session(['dest_url' => site_url('about')]); + + $user_id = session('user_id'); + + if (cannot('view', PRIV_SYSTEM_SETTINGS)) + { + if ($user_id) + { + abort(403, 'Forbidden'); + } + + redirect('login'); + + return; + } + + $role_slug = session('role_slug'); + + html_vars([ + 'page_title' => lang('integrations'), + 'active_menu' => PRIV_SYSTEM_SETTINGS, + 'user_display_name' => $this->accounts->get_user_display_name($user_id), + 'privileges' => $this->roles_model->get_permissions_by_slug($role_slug), + ]); + + $this->load->view('pages/integrations'); + } +} diff --git a/application/views/components/backend_header.php b/application/views/components/backend_header.php index 982e4e7f..3b6acda8 100755 --- a/application/views/components/backend_header.php +++ b/application/views/components/backend_header.php @@ -102,6 +102,9 @@ + + + diff --git a/application/views/pages/integrations.php b/application/views/pages/integrations.php new file mode 100755 index 00000000..65b90417 --- /dev/null +++ b/application/views/pages/integrations.php @@ -0,0 +1,118 @@ + + + + +
+
+ +

+ +

+ +

+ +

+ +
+ + +
+
+
+ + + +
+
+
+ + + +
+ + + + + +
+
+
+ +
+
+
+ + + +
+
+
+ + + +
+ + + + + +
+
+
+ +
+
+
+ + + +
+
+
+ + + +
+ + + + + +
+
+
+
+ +
+
+ + + + + + + + + + + diff --git a/assets/css/pages/integrations.scss b/assets/css/pages/integrations.scss new file mode 100644 index 00000000..58a06306 --- /dev/null +++ b/assets/css/pages/integrations.scss @@ -0,0 +1,7 @@ +#integrations-page { + .card-body { + .integration-info { + min-height: 150px; + } + } +}