|
|
|
@ -35,7 +35,7 @@ class ZoomPlugin extends Plugin |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* ZoomPlugin constructor. |
|
|
|
* ZoomPlugin constructor. |
|
|
|
* @inheritDoc |
|
|
|
* {@inheritdoc} |
|
|
|
* Initializes the API JWT client and the entity repositories. |
|
|
|
* Initializes the API JWT client and the entity repositories. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function __construct() |
|
|
|
protected function __construct() |
|
|
|
@ -95,13 +95,14 @@ class ZoomPlugin extends Plugin |
|
|
|
public static function currentUserCanCreateUserMeeting() |
|
|
|
public static function currentUserCanCreateUserMeeting() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$user = api_get_user_entity(api_get_user_id()); |
|
|
|
$user = api_get_user_entity(api_get_user_id()); |
|
|
|
return (!is_null($user) |
|
|
|
|
|
|
|
|
|
|
|
return !is_null($user) |
|
|
|
&& 'true' === api_get_plugin_setting('zoom', 'enableGlobalConferencePerUser') |
|
|
|
&& 'true' === api_get_plugin_setting('zoom', 'enableGlobalConferencePerUser') |
|
|
|
&& in_array( |
|
|
|
&& in_array( |
|
|
|
(api_is_platform_admin() ? PLATFORM_ADMIN : $user->getStatus()), |
|
|
|
(api_is_platform_admin() ? PLATFORM_ADMIN : $user->getStatus()), |
|
|
|
(array) api_get_plugin_setting('zoom', 'globalConferenceAllowRoles') |
|
|
|
(array) api_get_plugin_setting('zoom', 'globalConferenceAllowRoles') |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -179,7 +180,6 @@ class ZoomPlugin extends Plugin |
|
|
|
return Database::getManager()->getRepository(RegistrantEntity::class); |
|
|
|
return Database::getManager()->getRepository(RegistrantEntity::class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates this plugin's related tables in the internal database. |
|
|
|
* Creates this plugin's related tables in the internal database. |
|
|
|
* Installs course fields in all courses. |
|
|
|
* Installs course fields in all courses. |
|
|
|
@ -198,7 +198,7 @@ class ZoomPlugin extends Plugin |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Drops this plugins' related tables from the internal database. |
|
|
|
* Drops this plugins' related tables from the internal database. |
|
|
|
* Uninstalls course fields in all courses() |
|
|
|
* Uninstalls course fields in all courses(). |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function uninstall() |
|
|
|
public function uninstall() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -263,9 +263,9 @@ class ZoomPlugin extends Plugin |
|
|
|
* |
|
|
|
* |
|
|
|
* @param MeetingEntity $meetingEntity the meeting |
|
|
|
* @param MeetingEntity $meetingEntity the meeting |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FormValidator |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* @return FormValidator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getEditMeetingForm($meetingEntity) |
|
|
|
public function getEditMeetingForm($meetingEntity) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -324,9 +324,9 @@ class ZoomPlugin extends Plugin |
|
|
|
* @param MeetingEntity $meetingEntity |
|
|
|
* @param MeetingEntity $meetingEntity |
|
|
|
* @param string $returnURL where to redirect to on successful deletion |
|
|
|
* @param string $returnURL where to redirect to on successful deletion |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FormValidator |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* @return FormValidator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getDeleteMeetingForm($meetingEntity, $returnURL) |
|
|
|
public function getDeleteMeetingForm($meetingEntity, $returnURL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -356,9 +356,9 @@ class ZoomPlugin extends Plugin |
|
|
|
* |
|
|
|
* |
|
|
|
* @param MeetingEntity $meetingEntity |
|
|
|
* @param MeetingEntity $meetingEntity |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FormValidator |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* @return FormValidator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getRegisterParticipantForm($meetingEntity) |
|
|
|
public function getRegisterParticipantForm($meetingEntity) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -693,15 +693,7 @@ class ZoomPlugin extends Plugin |
|
|
|
$path = '/zoom_meeting_recording_file_'.$file->id.'.'.$file->file_type; |
|
|
|
$path = '/zoom_meeting_recording_file_'.$file->id.'.'.$file->file_type; |
|
|
|
$docId = DocumentManager::addCloudLink($courseInfo, $path, $file->play_url, $name); |
|
|
|
$docId = DocumentManager::addCloudLink($courseInfo, $path, $file->play_url, $name); |
|
|
|
if (!$docId) { |
|
|
|
if (!$docId) { |
|
|
|
throw new Exception( |
|
|
|
throw new Exception(get_lang(DocumentManager::cloudLinkExists($courseInfo, $path, $file->play_url) ? 'UrlAlreadyExists' : 'ErrorAddCloudLink')); |
|
|
|
get_lang( |
|
|
|
|
|
|
|
DocumentManager::cloudLinkExists( |
|
|
|
|
|
|
|
$courseInfo, |
|
|
|
|
|
|
|
$path, |
|
|
|
|
|
|
|
$file->play_url |
|
|
|
|
|
|
|
) ? 'UrlAlreadyExists' : 'ErrorAddCloudLink' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -859,9 +851,6 @@ class ZoomPlugin extends Plugin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @param DateTime $startDate |
|
|
|
|
|
|
|
* @param DateTime $endDate |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @throws OptimisticLockException |
|
|
|
* @throws OptimisticLockException |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -900,9 +889,9 @@ class ZoomPlugin extends Plugin |
|
|
|
* |
|
|
|
* |
|
|
|
* @param MeetingEntity $meeting a new, unsaved meeting with at least a type and a topic |
|
|
|
* @param MeetingEntity $meeting a new, unsaved meeting with at least a type and a topic |
|
|
|
* |
|
|
|
* |
|
|
|
* @return MeetingEntity |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* @return MeetingEntity |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private function createMeetingFromMeetingEntity($meeting) |
|
|
|
private function createMeetingFromMeetingEntity($meeting) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -918,9 +907,9 @@ class ZoomPlugin extends Plugin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return MeetingEntity |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return MeetingEntity |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private function createGlobalMeeting() |
|
|
|
private function createGlobalMeeting() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -977,8 +966,9 @@ class ZoomPlugin extends Plugin |
|
|
|
* @param string $agenda ordre du jour |
|
|
|
* @param string $agenda ordre du jour |
|
|
|
* @param string $password meeting password |
|
|
|
* @param string $password meeting password |
|
|
|
* |
|
|
|
* |
|
|
|
* @return MeetingEntity meeting |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return MeetingEntity meeting |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private function scheduleMeeting($user, $course, $session, $startTime, $duration, $topic, $agenda, $password) |
|
|
|
private function scheduleMeeting($user, $course, $session, $startTime, $duration, $topic, $agenda, $password) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -990,6 +980,7 @@ class ZoomPlugin extends Plugin |
|
|
|
$meetingInfoGet->settings->approval_type = $this->get('enableParticipantRegistration') |
|
|
|
$meetingInfoGet->settings->approval_type = $this->get('enableParticipantRegistration') |
|
|
|
? MeetingSettings::APPROVAL_TYPE_AUTOMATICALLY_APPROVE |
|
|
|
? MeetingSettings::APPROVAL_TYPE_AUTOMATICALLY_APPROVE |
|
|
|
: MeetingSettings::APPROVAL_TYPE_NO_REGISTRATION_REQUIRED; |
|
|
|
: MeetingSettings::APPROVAL_TYPE_NO_REGISTRATION_REQUIRED; |
|
|
|
|
|
|
|
|
|
|
|
return $this->createMeetingFromMeetingEntity( |
|
|
|
return $this->createMeetingFromMeetingEntity( |
|
|
|
(new MeetingEntity()) |
|
|
|
(new MeetingEntity()) |
|
|
|
->setMeetingInfoGet($meetingInfoGet) |
|
|
|
->setMeetingInfoGet($meetingInfoGet) |
|
|
|
@ -1004,10 +995,10 @@ class ZoomPlugin extends Plugin |
|
|
|
* @param User $user |
|
|
|
* @param User $user |
|
|
|
* @param bool $andFlush |
|
|
|
* @param bool $andFlush |
|
|
|
* |
|
|
|
* |
|
|
|
* @return RegistrantEntity |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @throws OptimisticLockException |
|
|
|
* @throws OptimisticLockException |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return RegistrantEntity |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private function registerUser($meetingEntity, $user, $andFlush = true) |
|
|
|
private function registerUser($meetingEntity, $user, $andFlush = true) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -1028,6 +1019,7 @@ class ZoomPlugin extends Plugin |
|
|
|
if ($andFlush) { |
|
|
|
if ($andFlush) { |
|
|
|
Database::getManager()->flush($registrantEntity); |
|
|
|
Database::getManager()->flush($registrantEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $registrantEntity; |
|
|
|
return $registrantEntity; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|