parent
296db4e016
commit
189ac597da
@ -0,0 +1,13 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom\API; |
||||
|
||||
class CustomQuestion |
||||
{ |
||||
/** @var string */ |
||||
public $title; |
||||
|
||||
/** @var string */ |
||||
public $value; |
||||
} |
||||
@ -0,0 +1,34 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom\API; |
||||
|
||||
use Exception; |
||||
|
||||
class GlobalDialInNumber |
||||
{ |
||||
use JsonDeserializableTrait; |
||||
|
||||
/** @var string Country code. For example, BR. */ |
||||
public $country; |
||||
|
||||
/** @var string Full name of country. For example, Brazil. */ |
||||
public $country_name; |
||||
|
||||
/** @var string City of the number, if any. For example, Chicago. */ |
||||
public $city; |
||||
|
||||
/** @var string Phone number. For example, +1 2332357613. */ |
||||
public $number; |
||||
|
||||
/** @var string Type of number. Either "toll" or "tollfree". */ |
||||
public $type; |
||||
|
||||
/** |
||||
* @inheritDoc |
||||
*/ |
||||
public function itemClass($propertyName) |
||||
{ |
||||
throw new Exception("No such array property $propertyName"); |
||||
} |
||||
} |
||||
@ -0,0 +1,25 @@ |
||||
<?php |
||||
|
||||
|
||||
namespace Chamilo\PluginBundle\Zoom\API; |
||||
|
||||
use Exception; |
||||
|
||||
class TrackingField |
||||
{ |
||||
use JsonDeserializableTrait; |
||||
|
||||
/** @var string Tracking fields type */ |
||||
public $field; |
||||
|
||||
/** @var string Tracking fields value */ |
||||
public $value; |
||||
|
||||
/** |
||||
* @inheritDoc |
||||
*/ |
||||
public function itemClass($propertyName) |
||||
{ |
||||
throw new Exception("no such array property $propertyName"); |
||||
} |
||||
} |
||||
@ -0,0 +1,46 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom; |
||||
|
||||
use Chamilo\UserBundle\Entity\User; |
||||
use Exception; |
||||
|
||||
class UserMeetingRegistrant extends API\MeetingRegistrant |
||||
{ |
||||
use UserMeetingRegistrantTrait; |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public static function fromJson($json) |
||||
{ |
||||
$instance = parent::fromJson($json); |
||||
$instance->decodeAndRemoveTag(); |
||||
$instance->computeFullName(); |
||||
|
||||
return $instance; |
||||
} |
||||
|
||||
/** |
||||
* Creates a UserMeetingRegistrant instance from a user |
||||
* |
||||
* @param User $user |
||||
* |
||||
* @throws Exception |
||||
* |
||||
* @return static |
||||
*/ |
||||
public static function fromUser($user) |
||||
{ |
||||
$instance = new static(); |
||||
$instance->email = $user->getEmail(); |
||||
$instance->first_name = $user->getFirstname(); |
||||
$instance->last_name = $user->getLastname(); |
||||
$instance->userId = $user->getId(); |
||||
$instance->user = $user; |
||||
$instance->computeFullName(); |
||||
|
||||
return $instance; |
||||
} |
||||
} |
||||
@ -0,0 +1,19 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom; |
||||
|
||||
class UserMeetingRegistrantList extends API\MeetingRegistrantList |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function itemClass($propertyName) |
||||
{ |
||||
if ('meetings' === $propertyName) { |
||||
return UserMeetingRegistrantListItem::class; |
||||
} |
||||
|
||||
return parent::itemClass($propertyName); |
||||
} |
||||
} |
||||
@ -0,0 +1,42 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom; |
||||
|
||||
use Exception; |
||||
|
||||
class UserMeetingRegistrantListItem extends API\MeetingRegistrantListItem |
||||
{ |
||||
use UserMeetingRegistrantTrait; |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public static function fromJson($json) |
||||
{ |
||||
$instance = parent::fromJson($json); |
||||
$instance->decodeAndRemoveTag(); |
||||
$instance->computeFullName(); |
||||
|
||||
return $instance; |
||||
} |
||||
|
||||
/** |
||||
* UserMeetingRegistrantListItem constructor. |
||||
* |
||||
* @param API\MeetingRegistrantListItem $meetingRegistrantListItem |
||||
* |
||||
* @throws Exception |
||||
* |
||||
* @return static |
||||
*/ |
||||
public static function fromMeetingRegistrantListItem($meetingRegistrantListItem) |
||||
{ |
||||
$instance = new static(); |
||||
self::recursivelyCopyObjectProperties($meetingRegistrantListItem, $instance); |
||||
$instance->decodeAndRemoveTag(); |
||||
$instance->computeFullName(); |
||||
|
||||
return $instance; |
||||
} |
||||
} |
||||
@ -0,0 +1,82 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\Zoom; |
||||
|
||||
use Chamilo\UserBundle\Entity\User; |
||||
use Database; |
||||
|
||||
trait UserMeetingRegistrantTrait |
||||
{ |
||||
/** @var bool whether the remote zoom record contains a local user's identifier */ |
||||
public $isTaggedWithUserId; |
||||
|
||||
/** @var int */ |
||||
public $userId; |
||||
|
||||
/** @var User */ |
||||
public $user; |
||||
|
||||
/** @var string */ |
||||
public $fullName; |
||||
|
||||
public function loadUser() |
||||
{ |
||||
$this->user = Database::getManager()->getRepository('ChamiloUserBundle:User')->find($this->userId); |
||||
} |
||||
|
||||
public function setUserId($userId) |
||||
{ |
||||
$this->userId = $userId; |
||||
} |
||||
|
||||
public function tagEmail() |
||||
{ |
||||
$this->email = str_replace('@', $this->getTag(), $this->getUntaggedEmail()); |
||||
} |
||||
|
||||
public function untagEmail() |
||||
{ |
||||
$this->email = $this->getUntaggedEmail(); |
||||
} |
||||
|
||||
public function matches($userId) |
||||
{ |
||||
return $userId == $this->userId; |
||||
} |
||||
|
||||
public function computeFullName() |
||||
{ |
||||
$this->fullName = api_get_person_name($this->first_name, $this->last_name); |
||||
} |
||||
|
||||
protected function decodeAndRemoveTag() |
||||
{ |
||||
$this->isTaggedWithUserId = preg_match(self::getTagPattern(), $this->email, $matches); |
||||
if ($this->isTaggedWithUserId) { |
||||
$this->setUserId($matches['userId']); |
||||
$this->untagEmail(); |
||||
} else { |
||||
$this->setUserId(0); |
||||
} |
||||
$this->user = null; |
||||
} |
||||
|
||||
protected function getUntaggedEmail() |
||||
{ |
||||
return str_replace($this->getTag(), '@', $this->email); |
||||
} |
||||
|
||||
/** |
||||
* @return string a tag to append to a registrant comments so to link it to a user |
||||
*/ |
||||
private function getTag() |
||||
{ |
||||
return "+user_$this->userId@"; |
||||
} |
||||
|
||||
private static function getTagPattern() |
||||
{ |
||||
return '/\+user_(?P<userId>\d+)@/m'; |
||||
} |
||||
} |
||||
@ -1,85 +1,134 @@ |
||||
<div class="page-header"> |
||||
<h2>{{ 'Meeting'|get_lang }}</h2> |
||||
</div> |
||||
<style> |
||||
dl.meeting_properties dt { |
||||
margin-top: 1em; |
||||
font-size: smaller; |
||||
} |
||||
</style> |
||||
<dl class="meeting_properties"> |
||||
<dt>{{ 'Course'|get_lang }}</dt> |
||||
<dd> |
||||
{% if meeting.course %} |
||||
<a href="{{ meeting.course.course_public_url }}"> |
||||
{{ meeting.course.title }} |
||||
</a> |
||||
{% else %} |
||||
- |
||||
{% endif %} |
||||
</dd> |
||||
<dt>{{ 'Session'|get_lang }}</dt> |
||||
<dd>{{ meeting.session ? meeting.session.name : '-' }}</dd> |
||||
|
||||
<dt>{{ 'Status'|get_lang }}</dt> |
||||
<dd>{{ meeting.status }}</dd> |
||||
|
||||
<dt>{{ 'Topic'|get_lang }}</dt> |
||||
<dd>{{ meeting.topic }}</dd> |
||||
|
||||
<dt>{{ 'Agenda'|get_lang }}</dt> |
||||
<dd>{{ meeting.agenda| nl2br }}</dd> |
||||
<p>{{ meeting.typeName }} {{ meeting.id }} ({{ meeting.statusName }})</p> |
||||
<h2>{{ meeting.topic }}</h2> |
||||
{% if meeting.agenda %} |
||||
<blockquote>{{ meeting.agenda| nl2br }}</blockquote> |
||||
{% endif %} |
||||
|
||||
<dt>{{ 'Type'|get_lang }}</dt> |
||||
<dd>{{meeting.typeName}}</dd> |
||||
|
||||
{% if meeting.type == 2 or meeting.type == 8 %} |
||||
<dl class="meeting_properties"> |
||||
<dt>{{ 'StartTime'|get_lang }}</dt> |
||||
<dd>{{ meeting.formattedStartTime }}</dd> |
||||
|
||||
<dt>{{ 'Duration'|get_lang }}</dt> |
||||
<dd>{{ meeting.formattedDuration }}</dd> |
||||
</dl> |
||||
{% endif %} |
||||
|
||||
{% if isConferenceManager %} |
||||
|
||||
<dt>{{ 'StartURLNotToBeShared'|get_lang }}</dt> |
||||
<dd><a class="btn" href="{{meeting.start_url}}">Start</a></dd> |
||||
|
||||
<dt>{{ 'JoinURLToSendToParticipants'|get_lang }}</dt> |
||||
<dd>{{meeting.join_url}}</dd> |
||||
|
||||
<!-- {{ meeting.settings| var_dump }} --> |
||||
{% if isConferenceManager and meeting.status == 'waiting' %} |
||||
<p> |
||||
<a class="btn" href="{{ meeting.start_url }}"> |
||||
{{ 'StartMeeting'|get_lang }} |
||||
</a> |
||||
</p> |
||||
{% endif %} |
||||
|
||||
{% else %} |
||||
{% if currentUserJoinURL %} |
||||
<p> |
||||
<a href="{{ currentUserJoinURL }}"> |
||||
{{ 'JoinMeeting'|get_lang }} |
||||
</a> |
||||
</p> |
||||
{% endif %} |
||||
|
||||
<dt>{{ 'JoinURL'|get_lang }}</dt> |
||||
<dd><a href="{{meeting.join_url}}">{{meeting.join_url}}</a></dd> |
||||
{% if meeting.settings.approval_type == 2 %} |
||||
<p> |
||||
<label> |
||||
{{ 'JoinURLToShare'|get_lang }} |
||||
<input readonly value="{{ meeting.join_url }}"/> |
||||
</label> |
||||
</p> |
||||
{% endif %} |
||||
|
||||
{% endif %} |
||||
</dl> |
||||
{% if recordings %} |
||||
<h3>{{ 'Recordings'|get_lang }}</h3> |
||||
<ul> |
||||
{% for recording in recordings %} |
||||
<li> |
||||
<a href="{{recording.share_url}}">{{recording.share_url}}</a> |
||||
</li> |
||||
{% if instances %} |
||||
<h3>{{ 'InstancesAndRecordings'|get_lang }}</h3> |
||||
{% for instance in instances %} |
||||
<div> |
||||
<h4>{{ instance.start_time }} ({{ instance.recordings.duration }} minutes)</h4> |
||||
<a href="{{ instance.recordings.share_url }}"> |
||||
{{ instance.recordings.recording_count }} recordings |
||||
{{ instance.deleteRecordingsForm }} |
||||
</a> |
||||
<table class="table"> |
||||
{% for file in instance.recordings.recording_files %} |
||||
<tr> |
||||
<th>{{ file.file_type }}<th> |
||||
<td> |
||||
<a href="{{file.play_url}}" target="_blank"> |
||||
Play {{file.recording_type}} |
||||
</a> |
||||
</td> |
||||
<td class="right"> |
||||
<a href="{{file.download_url}}">Download {{ file.file_size }} bytes</a> |
||||
</td> |
||||
<td> |
||||
{{ file.copyToCourseForm }} |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
<tr> |
||||
<th colspan="4" class="right"> |
||||
{{ 'TotalSize'|get_lang }} {{ instance.recordings.total_size }} bytes |
||||
</th> |
||||
<td> |
||||
{{ instance.copyAllRecordingsToCourseForm }} |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
{% if instance.participants %} |
||||
<h4>{{ 'InstanceParticipants'|get_lang }}</h4> |
||||
<ul> |
||||
{% for participant in instance.participants %} |
||||
<li> |
||||
{{ participant.name }} |
||||
</li> |
||||
{% endfor %} |
||||
</ul> |
||||
</ul> |
||||
{% endif %} |
||||
</div> |
||||
{% endfor %} |
||||
{% endif %} |
||||
|
||||
{% if participants %} |
||||
<h3>{{ 'Participants'|get_lang }}</h3> |
||||
{{ participants| var_dump }} |
||||
<ul> |
||||
{% for participant in participants %} |
||||
<li> |
||||
<a href="{{recording.share_url}}">{{recording.share_url}}</a> |
||||
</li> |
||||
{% if registrants and isConferenceManager %} |
||||
<script> |
||||
function copyJoinURL(event, url) { |
||||
event.target.textContent = '{{ 'CopyingJoinURL'|get_lang|escape }}'; |
||||
navigator.clipboard.writeText(url).then(function() { |
||||
event.target.textContent = '{{ 'JoinURLCopied'|get_lang|escape }}'; |
||||
}, function() { |
||||
event.target.textContent = '{{ 'CouldNotCopyJoinURL'|get_lang|escape }}' + ' ' + url; |
||||
}); |
||||
} |
||||
</script> |
||||
<table class="table"> |
||||
<tr> |
||||
<th>{{ 'RegisteredUsers'|get_lang }}</th> |
||||
<th>{{ 'JoinURL'|get_lang }}</th> |
||||
</tr> |
||||
{% for registrant in registrants %} |
||||
<tr> |
||||
<td> |
||||
{{ registrant.fullName }} |
||||
</td> |
||||
<td> |
||||
<a onclick="copyJoinURL(event, '{{ registrant.join_url }}')"> |
||||
{{ 'CopyJoinURL'|get_lang }} |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</ul> |
||||
</table> |
||||
{% else %} |
||||
<p> |
||||
{{ 'JoinURLToSendToParticipants'|get_lang }} |
||||
{{meeting.join_url}} |
||||
</p> |
||||
{% endif %} |
||||
|
||||
{% if isConferenceManager %} |
||||
{{ editMeetingForm }} |
||||
{{ deleteMeetingForm }} |
||||
{% if enableParticipantRegistration %} |
||||
{{ registerParticipantForm }} |
||||
{% endif %} |
||||
{% endif %} |
||||
|
||||
Loading…
Reference in new issue