Minor - Plugins: Zoom - add user in activity (WIP)

BT#17288
pull/3433/head
Julio Montoya 5 years ago
parent 81419bda24
commit 855efbff25
  1. 27
      plugin/zoom/Entity/MeetingActivity.php
  2. 4
      plugin/zoom/Entity/Recording.php
  3. 1
      plugin/zoom/endpoint.php
  4. 2
      plugin/zoom/meeting.php
  5. 10
      plugin/zoom/view/activity.tpl

@ -31,6 +31,13 @@ class MeetingActivity
*/ */
protected $meeting; protected $meeting;
/**
* @var Meeting
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
/** /**
* @var string * @var string
* @ORM\Column(type="string", name="name", length=255, nullable=false) * @ORM\Column(type="string", name="name", length=255, nullable=false)
@ -153,6 +160,26 @@ class MeetingActivity
return $this->event; return $this->event;
} }
/**
* @return Meeting
*/
public function getUser()
{
return $this->user;
}
/**
* @param Meeting $user
*
* @return MeetingActivity
*/
public function setUser($user)
{
$this->user = $user;
return $this;
}
public function getEventDecoded() public function getEventDecoded()
{ {
if (!empty($this->event)) { if (!empty($this->event)) {

@ -126,9 +126,9 @@ class Recording
/** /**
* @param RecordingMeeting $recordingMeeting * @param RecordingMeeting $recordingMeeting
* *
* @return Recording * @throws Exception
*@throws Exception
* *
* @return Recording
*/ */
public function setRecordingMeeting($recordingMeeting) public function setRecordingMeeting($recordingMeeting)
{ {

@ -50,6 +50,7 @@ if ($meeting) {
$activity->setName($action); $activity->setName($action);
$activity->setType($objectType); $activity->setType($objectType);
$activity->setEvent(json_encode($object)); $activity->setEvent(json_encode($object));
$activity->setUser(api_get_user_entity(api_get_user_id()));
} }
switch ($objectType) { switch ($objectType) {

@ -16,7 +16,7 @@ $plugin = ZoomPlugin::create();
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]); $meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]);
if (null === $meeting) { if (null === $meeting) {
throw new Exception($plugin->get_lang('MeetingNotFound')); api_not_allowed(true, $plugin->get_lang('MeetingNotFound'));
} }
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables $course_plugin = 'zoom'; // needed in order to load the plugin lang variables

@ -11,6 +11,7 @@
<tr> <tr>
<th>{{ 'Type'|get_lang }}</th> <th>{{ 'Type'|get_lang }}</th>
<th>{{ 'Action'|get_plugin_lang('ZoomPlugin') }}</th> <th>{{ 'Action'|get_plugin_lang('ZoomPlugin') }}</th>
<th>{{ 'User'|get_lang }}</th>
<th>{{ 'Date'|get_lang }}</th> <th>{{ 'Date'|get_lang }}</th>
<th>{{ 'Details'|get_lang }} </th> <th>{{ 'Details'|get_lang }} </th>
</tr> </tr>
@ -27,6 +28,15 @@
<td> <td>
{{ activity.createdAt | api_convert_and_format_date(3)}} {{ activity.createdAt | api_convert_and_format_date(3)}}
</td> </td>
<td>
{% if _u.is_admin %}
<a href="{{ _p.web_main }}admin/user_information.php?user_id="{{ activity.user.id }}>
{{ activity.user.firstname }} {{ activity.user.lastname }} {{ activity.user.username }}
</a>
{% else %}
{{ activity.user.firstname }} {{ activity.user.lastname }} ({{ activity.user.username }})
{% endif %}
</td>
<td> <td>
{% if activity.eventDecoded.registrant %} {% if activity.eventDecoded.registrant %}
{{ 'User' | get_lang }} : {{ 'User' | get_lang }} :

Loading…
Cancel
Save