Minor - Plugin zoom, add debug, format code

pull/3425/head
Julio Montoya 5 years ago
parent e0d749c9c6
commit b55e7992c3
  1. 5
      plugin/zoom/Entity/RegistrantEntity.php
  2. 21
      plugin/zoom/endpoint.php
  3. 2
      plugin/zoom/meeting.php
  4. 6
      plugin/zoom/view/meeting.tpl

@ -166,6 +166,11 @@ class RegistrantEntity
);
}
public function joinUrl()
{
return $this->meetingRegistrant->join_url;
}
/**
* @return CreatedRegistration
* @throws Exception

@ -2,7 +2,6 @@
/* For license terms, see /license.txt */
use Chamilo\PluginBundle\Zoom\API\MeetingInfoGet;
use Chamilo\PluginBundle\Zoom\API\RecordingMeeting;
use Chamilo\PluginBundle\Zoom\MeetingEntity;
use Chamilo\PluginBundle\Zoom\RecordingEntity;
@ -17,7 +16,7 @@ if ('POST' !== $_SERVER['REQUEST_METHOD']) {
// @todo handle non-apache installations
$authorizationHeaderValue = apache_request_headers()['Authorization'];
require __DIR__.'/config.php';
require_once __DIR__.'/config.php';
if (api_get_plugin_setting('zoom', 'verificationToken') !== $authorizationHeaderValue) {
http_response_code(Response::HTTP_UNAUTHORIZED);
@ -48,12 +47,13 @@ switch ($objectType) {
$meetingEntity = $meetingRepository->findOneBy(['meetingId' => $object->id]);
}
error_log('Meeting '.$action.' - '.$meetingEntity->getId());
if (null == $meetingEntity) {
if (null === $meetingEntity) {
exit;
}
error_log('Meeting '.$action.' - '.$meetingEntity->getId());
error_log(print_r($object, 1));
switch ($action) {
case 'deleted':
$em->remove($meetingEntity);
@ -65,19 +65,14 @@ switch ($objectType) {
$em->persist($meetingEntity);
$em->flush();
break;
case 'registration_created':
$registrantRepository->findOneBy(['meeting' => $meetingEntity, '' => $object->participant->id]);
break;
case 'participant_joined':
case 'participant_left':
error_log('Participant: #'.$object->participant->id);
error_log(print_r($object->participant, 1));
$registrant = $registrantRepository->findOneBy(['meeting' => $meetingEntity, '' => $object->participant->id]);
/*$registrant = $registrantRepository->findOneBy(['meeting' => $meetingEntity, '' => $object->participant->id]);
if (null === $registrant) {
exit;
}
// TODO log attendance
}*/
break;
default:
error_log(sprintf('Event "%s" on %s was unhandled: %s', $action, $objectType, $body));
@ -94,6 +89,8 @@ switch ($objectType) {
}
error_log("Recording: $action");
error_log(print_r($object, 1));
switch ($action) {
case 'completed':
$em->persist(

@ -4,6 +4,8 @@
use Chamilo\PluginBundle\Zoom\MeetingEntity;
require_once __DIR__.'/config.php';
$meetingId = isset($_REQUEST['meetingId']) ? (int) $_REQUEST['meetingId'] : 0;
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';

@ -32,7 +32,9 @@
</label>
<div class="form-inline">
<div class="form-group">
<input class="form-control" type="text" style="width:300px" readonly value="{{ meeting.meetingInfoGet.join_url }}" />
<input
class="form-control" type="text" style="width:300px" readonly
value="{{ meeting.meetingInfoGet.join_url }}" />
</div>
</div>
{% endif %}
@ -67,7 +69,7 @@
</td>
<td>
{% if registrant.join_url %}
<a class="btn btn-primary" onclick="copyJoinURL(event, '{{ registrant.join_url }}')">
<a class="btn btn-primary" onclick="copyJoinURL(event, '{{ registrant.joinUrl }}')">
{{ 'CopyJoinAsURL'|get_plugin_lang('ZoomPlugin') }}
</a>
{% else %}

Loading…
Cancel
Save