Minor - Plugin zoom - refactor code

pull/3425/head
Julio Montoya 6 years ago
parent 297d497149
commit 076ad55af5
  1. 21
      plugin/zoom/Entity/MeetingEntity.php
  2. 2
      plugin/zoom/Entity/RecordingEntity.php
  3. 106
      plugin/zoom/Entity/RegistrantEntity.php
  4. 32
      plugin/zoom/endpoint.php
  5. 6
      plugin/zoom/join_meeting.php
  6. 3
      plugin/zoom/lib/API/CreatedRegistration.php
  7. 3
      plugin/zoom/lib/API/CustomQuestion.php
  8. 3
      plugin/zoom/lib/API/GlobalDialInNumber.php
  9. 3
      plugin/zoom/lib/API/JWTClient.php
  10. 7
      plugin/zoom/lib/API/JsonDeserializableTrait.php
  11. 3
      plugin/zoom/lib/API/MeetingInfo.php
  12. 3
      plugin/zoom/lib/API/MeetingInstance.php
  13. 3
      plugin/zoom/lib/API/MeetingInstances.php
  14. 3
      plugin/zoom/lib/API/MeetingList.php
  15. 3
      plugin/zoom/lib/API/MeetingListItem.php
  16. 3
      plugin/zoom/lib/API/MeetingRegistrantList.php
  17. 3
      plugin/zoom/lib/API/MeetingRegistrantListItem.php
  18. 3
      plugin/zoom/lib/API/Pagination.php
  19. 3
      plugin/zoom/lib/API/PaginationToken.php
  20. 3
      plugin/zoom/lib/API/ParticipantList.php
  21. 3
      plugin/zoom/lib/API/ParticipantListItem.php
  22. 3
      plugin/zoom/lib/API/PastMeeting.php
  23. 3
      plugin/zoom/lib/API/RecordingFile.php
  24. 3
      plugin/zoom/lib/API/RecordingList.php
  25. 3
      plugin/zoom/lib/API/RecordingMeeting.php
  26. 3
      plugin/zoom/lib/API/TrackingField.php
  27. 31
      plugin/zoom/lib/ZoomPlugin.php
  28. 41
      plugin/zoom/meeting.php
  29. 13
      plugin/zoom/meeting_from_admin.php
  30. 13
      plugin/zoom/meeting_from_start.php
  31. 13
      plugin/zoom/meeting_from_user.php
  32. 4
      plugin/zoom/start.php
  33. 38
      plugin/zoom/view/admin.tpl
  34. 2
      plugin/zoom/view/start.tpl

@ -55,7 +55,7 @@ class MeetingEntity
public $statusName;
/**
* @var int the remote zoom meeting identifier
* @var int
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue()
@ -216,10 +216,10 @@ class MeetingEntity
*/
public function postLoad()
{
if (!is_null($this->meetingListItemJson)) {
if (null !== $this->meetingListItemJson) {
$this->meetingListItem = MeetingListItem::fromJson($this->meetingListItemJson);
}
if (!is_null($this->meetingInfoGetJson)) {
if (null !== $this->meetingInfoGetJson) {
$this->meetingInfoGet = MeetingInfoGet::fromJson($this->meetingInfoGetJson);
}
$this->initializeDisplayableProperties();
@ -240,10 +240,10 @@ class MeetingEntity
*/
public function preFlush()
{
if (!is_null($this->meetingListItem)) {
if (null !== $this->meetingListItem) {
$this->meetingListItemJson = json_encode($this->meetingListItem);
}
if (!is_null($this->meetingInfoGet)) {
if (null !== $this->meetingInfoGet) {
$this->meetingInfoGetJson = json_encode($this->meetingInfoGet);
}
}
@ -501,18 +501,21 @@ class MeetingEntity
private function initializeDisplayableProperties()
{
$zoomPlugin = new \ZoomPlugin();
$this->typeName = [
$typeList = [
API\Meeting::TYPE_INSTANT => $zoomPlugin->get_lang('InstantMeeting'),
API\Meeting::TYPE_SCHEDULED => $zoomPlugin->get_lang('ScheduledMeeting'),
API\Meeting::TYPE_RECURRING_WITH_NO_FIXED_TIME => $zoomPlugin->get_lang('RecurringWithNoFixedTime'),
API\Meeting::TYPE_RECURRING_WITH_FIXED_TIME => $zoomPlugin->get_lang('RecurringWithFixedTime'),
][$this->meetingInfoGet->type];
];
$this->typeName = $typeList[$this->meetingInfoGet->type];
if (property_exists($this, 'status')) {
$this->statusName = [
$statusList = [
'waiting' => $zoomPlugin->get_lang('Waiting'),
'started' => $zoomPlugin->get_lang('Started'),
'finished' => $zoomPlugin->get_lang('Finished'),
][$this->meetingInfoGet->status];
];
$this->statusName = $statusList[$this->meetingInfoGet->status];
}
$this->startDateTime = null;
$this->formattedStartTime = '';

@ -158,7 +158,7 @@ class RecordingEntity
*/
public function postLoad()
{
if (!is_null($this->recordingMeetingJson)) {
if (null !== $this->recordingMeetingJson) {
$this->recordingMeeting = RecordingMeeting::fromJson($this->recordingMeetingJson);
}
$this->initializeExtraProperties();

@ -98,74 +98,54 @@ class RegistrantEntity
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @throws Exception
* @param MeetingEntity $meeting
*
* @return MeetingRegistrantListItem
* @return $this
*/
public function getMeetingRegistrantListItem()
public function setMeeting($meeting)
{
return $this->meetingRegistrantListItem;
}
$this->meeting = $meeting;
$this->meeting->getRegistrants()->add($this);
/**
* @throws Exception
*
* @return CreatedRegistration
*/
public function getCreatedRegistration()
{
return $this->createdRegistration;
return $this;
}
/**
* @throws Exception
*
* @return MeetingRegistrant
* @return User
*/
public function getMeetingRegistrant()
public function getUser()
{
return $this->meetingRegistrant;
return $this->user;
}
/**
* @param MeetingEntity $meeting
* @param User $user
*
* @return $this
*/
public function setMeeting($meeting)
public function setUser($user)
{
$this->meeting = $meeting;
$this->meeting->getRegistrants()->add($this);
$this->user = $user;
return $this;
}
/**
* @param User $user
* @return MeetingRegistrantListItem
* @throws Exception
*
* @return $this
*/
public function setUser($user)
public function getMeetingRegistrantListItem()
{
$this->user = $user;
return $this;
return $this->meetingRegistrantListItem;
}
/**
* @param MeetingRegistrantListItem $meetingRegistrantListItem
*
* @return $this
* @throws Exception
*
* @return $this
*/
public function setMeetingRegistrantListItem($meetingRegistrantListItem)
{
@ -178,12 +158,30 @@ class RegistrantEntity
return $this;
}
public function computeFullName()
{
$this->fullName = api_get_person_name(
$this->meetingRegistrant->first_name,
$this->meetingRegistrant->last_name
);
}
/**
* @return CreatedRegistration
* @throws Exception
*
*/
public function getCreatedRegistration()
{
return $this->createdRegistration;
}
/**
* @param CreatedRegistration $createdRegistration
*
* @return $this
* @throws Exception
*
* @return $this
*/
public function setCreatedRegistration($createdRegistration)
{
@ -197,12 +195,22 @@ class RegistrantEntity
return $this;
}
/**
* @return MeetingRegistrant
* @throws Exception
*
*/
public function getMeetingRegistrant()
{
return $this->meetingRegistrant;
}
/**
* @param MeetingRegistrant $meetingRegistrant
*
* @return $this
* @throws Exception
*
* @return $this
*/
public function setMeetingRegistrant($meetingRegistrant)
{
@ -219,13 +227,13 @@ class RegistrantEntity
*/
public function postLoad()
{
if (!is_null($this->meetingRegistrantJson)) {
if (null !== $this->meetingRegistrantJson) {
$this->meetingRegistrant = MeetingRegistrant::fromJson($this->meetingRegistrantJson);
}
if (!is_null($this->createdRegistrationJson)) {
if (null !== $this->createdRegistrationJson) {
$this->createdRegistration = CreatedRegistration::fromJson($this->createdRegistrationJson);
}
if (!is_null($this->meetingRegistrantListItemJson)) {
if (null !== $this->meetingRegistrantListItemJson) {
$this->meetingRegistrantListItem = MeetingRegistrantListItem::fromJson(
$this->meetingRegistrantListItemJson
);
@ -238,22 +246,14 @@ class RegistrantEntity
*/
public function preFlush()
{
if (!is_null($this->meetingRegistrant)) {
if (null !== $this->meetingRegistrant) {
$this->meetingRegistrantJson = json_encode($this->meetingRegistrant);
}
if (!is_null($this->createdRegistration)) {
if (null !== $this->createdRegistration) {
$this->createdRegistrationJson = json_encode($this->createdRegistration);
}
if (!is_null($this->meetingRegistrantListItem)) {
if (null !== $this->meetingRegistrantListItem) {
$this->meetingRegistrantListItemJson = json_encode($this->meetingRegistrantListItem);
}
}
public function computeFullName()
{
$this->fullName = api_get_person_name(
$this->meetingRegistrant->first_name,
$this->meetingRegistrant->last_name
);
}
}

@ -45,36 +45,38 @@ switch ($objectType) {
$meetingEntity = null;
if ($object->id) {
/** @var MeetingEntity $meetingEntity */
$meetingEntity = $meetingRepository->findBy(['meetingId' => $object->id]);
$meetingEntity = $meetingRepository->findOneBy(['meetingId' => $object->id]);
}
error_log("Meeting: $action");
error_log('Meeting '.$action.' - '.$meetingEntity->getId());
if (null == $meetingEntity) {
exit;
}
switch ($action) {
case 'deleted':
if (null !== $meetingEntity) {
error_log('Meeting deleted '.$meetingEntity->getId());
$em->remove($meetingEntity);
}
$em->remove($meetingEntity);
$em->flush();
break;
case 'ended':
case 'started':
error_log("Meeting $action #".$meetingEntity->getId());
$em->persist(
(
$meetingEntity->setStatus($action)
?: (new MeetingEntity())->setMeetingInfoGet(MeetingInfoGet::fromObject($object))
)
);
$meetingEntity->setStatus($action);
$em->persist($meetingEntity);
$em->flush();
break;
case 'registration_created':
$registrantRepository->findOneBy(['meeting' => $meetingEntity, '' => $object->participant->id]);
break;
case 'participant_joined':
case 'participant_left':
// @todo check find
$registrant = $registrantRepository->find($object->participant->id);
error_log('Participant: #'.$object->participant->id);
error_log(print_r($object->participant, 1));
$registrant = $registrantRepository->findOneBy(['meeting' => $meetingEntity, '' => $object->participant->id]);
if (null === $registrant) {
exit;
}
// TODO log attendance
break;
default:

@ -9,8 +9,6 @@ require_once __DIR__.'/config.php';
api_block_anonymous_users();
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables
$meetingId = isset($_REQUEST['meetingId']) ? (int) $_REQUEST['meetingId'] : 0;
if (empty($meetingId)) {
api_not_allowed(true);
@ -21,7 +19,7 @@ $plugin = ZoomPlugin::create();
Display::display_header($plugin->get_title());
echo $plugin->getToolbar();
/** @var MeetingEntity $meeting */
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]);
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]);
try {
if (null === $meeting) {
throw new Exception($plugin->get_lang('Meeting not found'));
@ -39,7 +37,7 @@ try {
if ($plugin->userIsConferenceManager($meeting)) {
echo ' '.Display::url(
get_lang('Details'),
api_get_path(WEB_PLUGIN_PATH).'zoom/meeting_from_admin.php?meetingId='.$meeting->getMeetingId(),
api_get_path(WEB_PLUGIN_PATH).'zoom/meeting.php?type=admin&meetingId='.$meeting->getMeetingId(),
['class' => 'btn btn-default']
);
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -8,8 +9,6 @@ use Exception;
/**
* Class CreatedRegistration.
* An instance of this class is returned by the Zoom serveur upon recording a registrant to a meeting.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class CreatedRegistration
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -6,8 +7,6 @@ namespace Chamilo\PluginBundle\Zoom\API;
/**
* Class CustomQuestion.
* A list of instances of this class is included in a MeetingRegistrant instance.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class CustomQuestion
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -8,8 +9,6 @@ use Exception;
/**
* Class GlobalDialInNumber.
* A list of these is included in a meeting settings.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class GlobalDialInNumber
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -10,8 +11,6 @@ use Firebase\JWT\JWT;
* Class JWTClient.
*
* @see https://marketplace.zoom.us/docs/guides/auth/jwt
*
* @package Chamilo\PluginBundle\Zoom
*/
class JWTClient extends Client
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -7,9 +8,7 @@ use Exception;
/**
* Trait JsonDeserializableTrait.
* Utility fonctions to help convert server-generated JSON to API class instances.
*
* @package Chamilo\PluginBundle\Zoom\API
* Utility functions to help convert server-generated JSON to API class instances.
*/
trait JsonDeserializableTrait
{
@ -28,7 +27,7 @@ trait JsonDeserializableTrait
throw new Exception('Cannot JSON-decode empty string');
}
$object = json_decode($json);
if (is_null($object)) {
if (null === $object) {
throw new Exception('Could not decode JSON: '.$json);
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -7,8 +8,6 @@ namespace Chamilo\PluginBundle\Zoom\API;
* Class MeetingInfo
* Used to define MeetingInfoGet
* Does not seem to be used directly.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingInfo extends Meeting
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -12,8 +13,6 @@ use Exception;
*
* @see MeetingInstances
* @see PastMeeting for the full record
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingInstance
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Class MeetingInstances. The list of one meeting's ended instances.
*
* @see MeetingInstance
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingInstances
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Class MeetingList. Lists Meetings.
*
* @see MeetingListItem
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingList
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Class MeetingListItem. Item of a list of meetings.
*
* @see MeetingList
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingListItem
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Class MeetingRegistrantList. List of meeting registrants.
*
* @see MeetingRegistrantListItem
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingRegistrantList
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -7,8 +8,6 @@ namespace Chamilo\PluginBundle\Zoom\API;
* Class MeetingRegistrantListItem. Item in a list of meeting registrants.
*
* @see MeetingRegistrantList
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class MeetingRegistrantListItem extends MeetingRegistrant
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Trait Pagination
* properties for Pagination objects, which are paginated lists of items,
* retrieved in chunks from the server over one or several API calls, one per page.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
trait Pagination
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Trait PaginationToken
* properties for PaginationToken objects, which are paginated lists of items,
* retrieved in chunks from the server over one or several API calls, one per page.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
trait PaginationToken
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -10,8 +11,6 @@ use Exception;
* List of past meeting instance participants.
*
* @see ParticipantListItem;
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class ParticipantList
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -7,8 +8,6 @@ namespace Chamilo\PluginBundle\Zoom\API;
* Class ParticipantListItem. Item in a list of past meeting instance participants.
*
* @see ParticipantList
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class ParticipantListItem
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -12,8 +13,6 @@ use Exception;
* Each past meeting instance is identified by its own UUID.
* Many past meeting instances can be part of the same meeting, identified by property 'id'.
* Each instance has its own start time, participants and recording files.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class PastMeeting extends Meeting
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -9,8 +10,6 @@ use Exception;
* Class RecordingFile. A video, audio or text file, part of a past meeting instance recording.
*
* @see RecordingMeeting
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class RecordingFile
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -10,8 +11,6 @@ use Exception;
* Class RecordingList. A list of past meeting instance recordings generated between two dates.
*
* @see RecordingMeeting
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class RecordingList
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -12,8 +13,6 @@ use Exception;
*
* @see PastMeeting
* @see RecordingFile
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class RecordingMeeting
{

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\Zoom\API;
@ -7,8 +8,6 @@ use Exception;
/**
* Class TrackingField. Instances of this class can be listed in a meeting object.
*
* @package Chamilo\PluginBundle\Zoom\API
*/
class TrackingField
{

@ -674,9 +674,9 @@ class ZoomPlugin extends Plugin
Display::return_message($this->get_lang('GroupUsersWereRegistered'))
);
}
api_location('meeting_from_start.php?meetingId='.$newMeeting->getMeetingId());
api_location('meeting.php?type=start&meetingId='.$newMeeting->getMeetingId());
} elseif (null !== $user) {
api_location('meeting_from_user.php?meetingId='.$newMeeting->getMeetingId());
api_location('meeting.php?type=user&meetingId='.$newMeeting->getMeetingId());
}
} catch (Exception $exception) {
Display::addFlash(
@ -899,32 +899,37 @@ class ZoomPlugin extends Plugin
*/
public function reloadPeriodRecordings($startDate, $endDate)
{
foreach (RecordingList::loadPeriodRecordings($startDate, $endDate) as $recordingMeeting) {
$recordingEntity = $this->getRecordingRepository()->find($recordingMeeting->uuid);
$em = Database::getManager();
$recordingRepo = $this->getRecordingRepository();
$meetingRepo = $this->getMeetingRepository();
$recordings = RecordingList::loadPeriodRecordings($startDate, $endDate);
foreach ($recordings as $recordingMeeting) {
$recordingEntity = $recordingRepo->findOneBy(['uuid' => $recordingMeeting->uuid]);
if (null === $recordingEntity) {
$recordingEntity = new RecordingEntity();
$meetingEntity = $this->getMeetingRepository()->find($recordingMeeting->id);
$meetingEntity = $meetingRepo->findOneBy(['meetingId' => $recordingMeeting->id]);
if (null === $meetingEntity) {
try {
$meetingInfoGet = MeetingInfoGet::fromId($recordingMeeting->id);
} catch (Exception $exception) {
$meetingInfoGet = null; // deleted meeting with recordings
}
if (!is_null($meetingInfoGet)) {
if (null !== $meetingInfoGet) {
$meetingEntity = $this->createMeetingFromMeetingEntity(
(new MeetingEntity())->setMeetingInfoGet($meetingInfoGet)
);
Database::getManager()->persist($meetingEntity);
$em->persist($meetingEntity);
}
}
if (!is_null($meetingEntity)) {
if (null !== $meetingEntity) {
$recordingEntity->setMeeting($meetingEntity);
}
}
$recordingEntity->setRecordingMeeting($recordingMeeting);
Database::getManager()->persist($recordingEntity);
$em->persist($recordingEntity);
}
Database::getManager()->flush();
$em->flush();
}
public function getToolbar($returnUrl = '')
@ -988,7 +993,6 @@ class ZoomPlugin extends Plugin
: 'local';
$meeting->getMeetingInfoGet()->settings->registrants_email_notification = false;
$meeting->setMeetingInfoGet($meeting->getMeetingInfoGet()->create());
$meeting->getMeetingInfoGet()->settings->approval_type = $approvalType;
Database::getManager()->persist($meeting);
@ -1169,10 +1173,11 @@ class ZoomPlugin extends Plugin
$meetingRegistrants[] = $registrant->getMeetingRegistrant();
}
$meetingEntity->getMeetingInfoGet()->removeRegistrants($meetingRegistrants);
$em = Database::getManager();
foreach ($registrants as $registrant) {
Database::getManager()->remove($registrant);
$em->remove($registrant);
}
Database::getManager()->flush();
$em->flush();
}
/**

@ -4,16 +4,39 @@
use Chamilo\PluginBundle\Zoom\MeetingEntity;
if (!isset($returnURL)) {
exit;
$meetingId = isset($_REQUEST['meetingId']) ? (int) $_REQUEST['meetingId'] : 0;
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
if (empty($type) || empty($meetingId)) {
api_not_allowed(true);
}
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables
$returnURL = null;
switch ($type) {
case 'admin':
$returnURL = 'admin.php';
$this_section = SECTION_PLATFORM_ADMIN;
break;
case 'user':
$returnURL = 'user.php';
$this_section = SECTION_MYPROFILE;
break;
case 'start':
api_protect_course_script(true);
$returnURL = 'start.php?cId='.api_get_course_id().'&sessionId='.api_get_session_id();
$this_section = SECTION_COURSES;
break;
}
if (empty($returnURL)) {
api_not_allowed(true);
}
$logInfo = [
'tool' => 'Videoconference Zoom',
];
Event::registerLog($logInfo);
$plugin = ZoomPlugin::create();
@ -22,18 +45,14 @@ $interbreadcrumb[] = [ // used in templates
'name' => $plugin->get_lang('ZoomVideoConferences'),
];
if (!array_key_exists('meetingId', $_REQUEST)) {
throw new Exception('MeetingNotFound');
}
/** @var MeetingEntity $meeting */
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]);
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]);
if (null === $meeting) {
throw new Exception($plugin->get_lang('MeetingNotFound'));
}
$tpl = new Template($meeting->getId());
$tpl = new Template($meeting->getMeetingId());
if ($plugin->userIsConferenceManager($meeting)) {
// user can edit, start and delete meeting
@ -46,8 +65,8 @@ if ($plugin->userIsConferenceManager($meeting)) {
$tpl->assign('registrants', $meeting->getRegistrants());
}
if ('true' === $plugin->get('enableCloudRecording')
&& $meeting->hasCloudAutoRecordingEnabled()
if ('true' === $plugin->get('enableCloudRecording') &&
$meeting->hasCloudAutoRecordingEnabled()
// && 'finished' === $meeting->status
) {
$tpl->assign('fileForm', $plugin->getFileForm($meeting)->returnForm());

@ -1,13 +0,0 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/config.php';
api_protect_admin_script();
$returnURL = 'admin.php';
// the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
include "meeting.php";

@ -1,13 +0,0 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/config.php';
api_protect_course_script(true);
$returnURL = 'start.php?cId='.api_get_course_id().'&sessionId='.api_get_session_id();
// the section (for the tabs)
$this_section = SECTION_COURSES;
include "meeting.php";

@ -1,13 +0,0 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/config.php';
api_protect_admin_script();
$returnURL = 'user.php';
// the section (for the tabs)
$this_section = SECTION_MYPROFILE;
include "meeting.php";

@ -10,11 +10,9 @@ api_protect_course_script(true);
// the section (for the tabs)
$this_section = SECTION_COURSES;
$logInfo = [
'tool' => 'Videoconference Zoom',
];
Event::registerLog($logInfo);
$plugin = ZoomPlugin::create();
@ -27,7 +25,7 @@ $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if ($plugin->userIsCourseConferenceManager($course)) {
switch ($action) {
case 'delete':
$meeting = $plugin->getMeetingRepository()->find($_REQUEST['meetingId']);
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]);
$plugin->deleteMeeting($meeting, api_get_self().'?'.api_get_cidreq());
break;

@ -30,29 +30,29 @@
{% if recordings %}
<td>
{% for recording in recordings %}
{% if recording.recordingMeeting.id == meeting.id %}
<dl>
<dt>
{{ recording.formattedStartTime }}
({{ recording.formattedDuration }})
</dt>
<dd>
<ul>
{% for file in recording.recordingMeeting.recording_files %}
<li>
{{ file.recording_type }}.{{ file.file_type }}
({{ file.file_size }})
</li>
{% endfor %}
</ul>
</dd>
</dl>
{% endif %}
{% if recording.recordingMeeting.id == meeting.id %}
<dl>
<dt>
{{ recording.formattedStartTime }}
({{ recording.formattedDuration }})
</dt>
<dd>
<ul>
{% for file in recording.recordingMeeting.recording_files %}
<li>
{{ file.recording_type }}.{{ file.file_type }}
({{ file.file_size }})
</li>
{% endfor %}
</ul>
</dd>
</dl>
{% endif %}
{% endfor %}
</td>
{% endif %}
<td>
<a class="btn btn-primary" href="meeting_from_admin.php?meetingId={{ meeting.meetingId }}">
<a class="btn btn-primary" href="meeting.php?type=admin&meetingId={{ meeting.meetingId }}">
{{ 'Details'|get_lang }}
</a>
</td>

@ -29,7 +29,7 @@
{{ 'Join'|get_plugin_lang('ZoomPlugin') }}
</a>
<a class="btn btn-default" href="meeting_from_start.php?meetingId={{ meeting.meetingId }}">
<a class="btn btn-default" href="meeting.php?type=start&meetingId={{ meeting.meetingId }}">
{{ 'Edit'|get_lang }}
</a>

Loading…
Cancel
Save