From d8e892f7cf9cddb7471d436216d63331e0e8fdb9 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 30 Apr 2021 15:17:05 +0200 Subject: [PATCH] Don't show calendar integrated videoconference action if videoconference is disabled or BBB is not configured --- calendar/inc/class.calendar_uiviews.inc.php | 30 ++++++++++++--------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index 69adc819e5..3cd9e6a963 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -377,20 +377,24 @@ class calendar_uiviews extends calendar_ui ), ); - // Add toggle for video calls - $status_config = Api\Config::read("status"); - if($status_config["status_cat_videocall"]) + // Don't show videoconference action if videoconference is disabled or BBB is not configured + if (\EGroupware\Status\Hooks::isVCRecordingSupported() && !EGroupware\Status\Hooks::isVideoconferenceDisabled()) { - $actions['video_toggle'] = array( - 'caption' => 'Video call', - 'iconUrl' => Image::find('status', 'videoconference_call'), - 'checkbox' => true, - 'hint' => lang("video call"), - 'group' => 'integration', - 'onExecute' => 'javaScript:app.calendar.toolbar_videocall_toggle_action', - 'checked' => in_array('video_toggle', (array)$this->cal_prefs['integration_toggle']), - 'data' => array('toggle_off' => '0', 'toggle_on' => '1') - ); + // Add toggle for video calls + $status_config = Api\Config::read("status"); + if($status_config["status_cat_videocall"]) + { + $actions['video_toggle'] = array( + 'caption' => 'Video call', + 'iconUrl' => Image::find('status', 'videoconference_call'), + 'checkbox' => true, + 'hint' => lang("video call"), + 'group' => 'integration', + 'onExecute' => 'javaScript:app.calendar.toolbar_videocall_toggle_action', + 'checked' => in_array('video_toggle', (array)$this->cal_prefs['integration_toggle']), + 'data' => array('toggle_off' => '0', 'toggle_on' => '1') + ); + } } // Add integrated app options