Disable videoconference features in Calendar when it's set to disabled

This commit is contained in:
Hadi Nategh 2020-11-19 12:38:03 +01:00
parent ac6f7de9bf
commit 5ee323dd71
4 changed files with 13 additions and 3 deletions

View File

@ -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),

View File

@ -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(

View File

@ -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)
{

View File

@ -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,
]
]