diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 1dee6c403b..dde699fad9 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -248,7 +248,8 @@ class calendar_boupdate extends calendar_bo } // generate a video-room-url, if we need one and not already have one - if ($event['videoconference'] && empty($event['##videoconference']) && class_exists('EGroupware\\Status\\Videoconference\\Call')) + if ($event['videoconference'] && empty($event['##videoconference']) && class_exists('EGroupware\\Status\\Videoconference\\Call') + && !EGroupware\Status\Hooks::isVideoconferenceDisabled()) { $event['##videoconference'] = EGroupware\Status\Videoconference\Call::genUniqueRoomID(); } @@ -1066,7 +1067,8 @@ class calendar_boupdate extends calendar_bo $details['olddate'] = $olddate->format($timeformat); } // generate a personal videoconference url, if we need one - if (!empty($event['##videoconference']) && class_exists('EGroupware\\Status\\Videoconference\\Call')) + if (!empty($event['##videoconference']) && class_exists('EGroupware\\Status\\Videoconference\\Call') + && !EGroupware\Status\Hooks::isVideoconferenceDisabled()) { $avatar = new Api\Contacts\Photo(is_numeric($userid) ? "account:$userid" : (isset($res_info) && $res_info['type'] === 'c' ? $res_info['res_id'] : $userid), diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 3681b3786c..935672ebc5 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -903,7 +903,8 @@ END:VALARM'; // do not set actions for alarm type if ($params['data']['type'] == 6) { - if (!empty($params['data']['videoconference'])) + if (!empty($params['data']['videoconference']) + && $GLOBALS['egw_info']['user']['apps']['status'] && !EGroupware\Status\Hooks::isVideoconferenceDisabled()) { return [ array( diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 3497142461..9a293679fd 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -2023,6 +2023,12 @@ class calendar_uiforms extends calendar_ui if (!empty($preserved['lock_token'])) $content['lock_token'] = $preserved['lock_token']; + //Disable videoconference if the module is not enabled + if ($GLOBALS['egw_info']['user']['apps']['status'] && EGroupware\Status\Hooks::isVideoconferenceDisabled()) + { + $readonlys['videoconference'] = true; + } + // non_interactive==true from $_GET calls immediate save action without displaying the edit form if(isset($_GET['non_interactive']) && (bool)$_GET['non_interactive'] === true) { diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 1026c0b638..e398d0c810 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -989,6 +989,7 @@ class calendar_uilist extends calendar_ui 'caption' => 'Join', 'icon' => 'status/videoconference_join', 'onExecute' => 'javaScript:app.calendar.joinVideoConferenceAction', + 'enabled' => !EGroupware\Status\Hooks::isVideoconferenceDisabled(), 'allowOnMultiple' => false, ] ]