Minor - Plugin zoom - refactor code

pull/3425/head
Julio Montoya 6 years ago
parent 0e30d7a63a
commit 97ce9951ca
  1. 6
      plugin/zoom/Entity/RegistrantEntity.php
  2. 3
      plugin/zoom/admin.php
  3. 8
      plugin/zoom/lib/ZoomPlugin.php
  4. 2
      plugin/zoom/meeting.php
  5. 4
      plugin/zoom/user.php
  6. 46
      plugin/zoom/view/list.tpl

@ -168,7 +168,11 @@ class RegistrantEntity
public function joinUrl()
{
return $this->createdRegistration->join_url;
if (!$this->createdRegistration) {
return '';
}
return $this->createdRegistration->join_url;
}
/**

@ -25,5 +25,6 @@ if ('true' === $plugin->get('enableCloudRecording')) {
}
$tpl->assign('actions', $plugin->getToolbar());
$tpl->assign('search_form', $form->returnForm());
$tpl->assign('content', $tpl->fetch('zoom/view/admin.tpl'));
$tpl->assign('type', 'admin');
$tpl->assign('content', $tpl->fetch('zoom/view/list.tpl'));
$tpl->display_one_col_template();

@ -350,14 +350,18 @@ class ZoomPlugin extends Plugin
*
* @param MeetingEntity $meetingEntity
* @param string $returnURL where to redirect to on successful deletion
* @param string
*
* @throws Exception
*
* @return FormValidator
*/
public function getDeleteMeetingForm($meetingEntity, $returnURL)
public function getDeleteMeetingForm($meetingEntity, $returnURL, $type)
{
$form = new FormValidator('delete', 'post', Security::remove_XSS($_SERVER['REQUEST_URI']));
$id = $meetingEntity->getMeetingId();
$type = Security::remove_XSS($type);
$form = new FormValidator('delete', 'post', api_get_self().'?type='.$type.'&meetingId='.$id);
$form->addButtonDelete($this->get_lang('DeleteMeeting'));
if ($form->validate()) {
$this->deleteMeeting($meetingEntity, $returnURL);

@ -60,7 +60,7 @@ if ($plugin->userIsConferenceManager($meeting)) {
// user can edit, start and delete meeting
$tpl->assign('isConferenceManager', true);
$tpl->assign('editMeetingForm', $plugin->getEditMeetingForm($meeting)->returnForm());
$tpl->assign('deleteMeetingForm', $plugin->getDeleteMeetingForm($meeting, $returnURL)->returnForm());
$tpl->assign('deleteMeetingForm', $plugin->getDeleteMeetingForm($meeting, $returnURL, $type)->returnForm());
if ('true' === $plugin->get('enableParticipantRegistration') && $meeting->requiresRegistration()) {
$tpl->assign('registerParticipantForm', $plugin->getRegisterParticipantForm($meeting)->returnForm());

@ -12,7 +12,6 @@ if (!ZoomPlugin::currentUserCanCreateUserMeeting()) {
}
$plugin = ZoomPlugin::create();
$user = api_get_user_entity(api_get_user_id());
$form = $plugin->getAdminSearchForm();
@ -31,5 +30,6 @@ if ('true' === $plugin->get('enableCloudRecording')) {
$tpl->assign('actions', $plugin->getToolbar());
$tpl->assign('search_form', $form->returnForm());
$tpl->assign('schedule_form', $plugin->getScheduleMeetingForm($user)->returnForm());
$tpl->assign('content', $tpl->fetch('zoom/view/admin.tpl'));
$tpl->assign('type', 'user');
$tpl->assign('content', $tpl->fetch('zoom/view/list.tpl'));
$tpl->display_one_col_template();

@ -28,31 +28,31 @@
<td>{{ meeting.session ? meeting.session : '-' }}</td>
{% 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 %}
{% endfor %}
</td>
<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 %}
{% endfor %}
</td>
{% endif %}
<td>
<a class="btn btn-primary" href="meeting.php?type=admin&meetingId={{ meeting.meetingId }}">
<a class="btn btn-primary" href="meeting.php?type={{ type }}&meetingId={{ meeting.meetingId }}">
{{ 'Details'|get_lang }}
</a>
</td>
Loading…
Cancel
Save