Minor - Plugin zoom - fix UI, improve code

pull/3420/head
Julio Montoya 5 years ago
parent 128f4ef877
commit 5ff24181fa
  1. 2
      plugin/zoom/lib/zoom_plugin.class.php
  2. 22
      plugin/zoom/start.php
  3. 31
      plugin/zoom/view/start.tpl

@ -549,7 +549,7 @@ class ZoomPlugin extends Plugin
public function getCreateInstantMeetingForm($user, $course, $session) public function getCreateInstantMeetingForm($user, $course, $session)
{ {
$form = new FormValidator('createInstantMeetingForm', 'post', '', '_blank'); $form = new FormValidator('createInstantMeetingForm', 'post', '', '_blank');
$form->addButton('startButton', $this->get_lang('StartInstantMeeting')); $form->addButton('startButton', $this->get_lang('StartInstantMeeting'), 'video-camera', 'primary');
if ($form->validate()) { if ($form->validate()) {
try { try {
$this->startInstantMeeting($this->get_lang('InstantMeeting'), $user, $course, $session); $this->startInstantMeeting($this->get_lang('InstantMeeting'), $user, $course, $session);

@ -1,4 +1,5 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables $course_plugin = 'zoom'; // needed in order to load the plugin lang variables
@ -17,30 +18,33 @@ $logInfo = [
Event::registerLog($logInfo); Event::registerLog($logInfo);
$plugin = ZoomPlugin::create(); $plugin = ZoomPlugin::create();
$tool_name = $plugin->get_lang('ZoomVideoconferences'); $tool_name = $plugin->get_lang('ZoomVideoConferences');
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$course = api_get_course_entity();
$session = api_get_session_entity();
if ($plugin->userIsCourseConferenceManager(api_get_course_entity())) { if ($plugin->userIsCourseConferenceManager($course)) {
$user = api_get_user_entity(api_get_user_id());
// user can create a new meeting // user can create a new meeting
$tpl->assign( $tpl->assign(
'createInstantMeetingForm', 'createInstantMeetingForm',
$plugin->getCreateInstantMeetingForm( $plugin->getCreateInstantMeetingForm(
api_get_user_entity(api_get_user_id()), $user,
api_get_course_entity(), $course,
api_get_session_entity() $session
)->returnForm() )->returnForm()
); );
$tpl->assign('scheduleMeetingForm', $plugin->getScheduleMeetingForm( $tpl->assign('scheduleMeetingForm', $plugin->getScheduleMeetingForm(
api_get_user_entity(api_get_user_id()), $user,
api_get_course_entity(), $course,
api_get_session_entity() $session
)->returnForm()); )->returnForm());
} }
try { try {
$tpl->assign( $tpl->assign(
'scheduledMeetings', 'scheduledMeetings',
$plugin->getMeetingRepository()->courseMeetings(api_get_course_entity(), api_get_session_entity()) $plugin->getMeetingRepository()->courseMeetings($course, $session)
); );
} catch (Exception $exception) { } catch (Exception $exception) {
Display::addFlash( Display::addFlash(

@ -2,36 +2,36 @@
{{ createInstantMeetingForm }} {{ createInstantMeetingForm }}
{% endif %} {% endif %}
{% if scheduledMeetings %} {% if scheduledMeetings.count %}
<div class="page-header"> <div class="page-header">
<h2>{{ 'ScheduledMeetings'|get_lang }}</h2> <h2>{{ 'ScheduledMeetings'|get_lang }}</h2>
</div> </div>
<table class="table"> <table class="table">
<tr> <tr>
<!-- th>{{ 'CreatedAt'|get_lang }}</th --> <th>{{ 'Topic'|get_plugin_lang('ZoomPlugin') }}</th>
<th>{{ 'Agenda'|get_plugin_lang('ZoomPlugin') }}</th>
<th>{{ 'StartTime'|get_lang }}</th> <th>{{ 'StartTime'|get_lang }}</th>
<th>{{ 'Duration'|get_lang }}</th> <th>{{ 'Duration'|get_lang }}</th>
<!-- th>{{ 'Type'|get_lang }}</th --> <th>{{ 'Actions'|get_lang }}</th>
<th>{{ 'TopicAndAgenda'|get_plugin_lang('ZoomPlugin') }}</th>
<th></th>
</tr> </tr>
{% for meeting in scheduledMeetings %} {% for meeting in scheduledMeetings %}
<tr> <tr>
<!-- td>{{ meeting.created_at }}</td -->
<td>{{ meeting.formattedStartTime }}</td>
<td>{{ meeting.formattedDuration }}</td>
<!-- td>{{ meeting.typeName }}</td -->
<td> <td>
<strong>{{ meeting.meetingInfoGet.topic }}</strong> {{ meeting.meetingInfoGet.topic }}
<p class="small">{{ meeting.meetingInfoGet.agenda|nl2br }}</p>
</td> </td>
<td> <td>
<a class="btn" href="meeting_from_start.php?meetingId={{ meeting.id }}"> {{ meeting.meetingInfoGet.agenda|nl2br }}
{{ 'Details'|get_lang }} </td>
</a> <td>{{ meeting.formattedStartTime }}</td>
<a class="btn" href="{{ meeting.meetingInfoGet.join_url }}"> <td>{{ meeting.formattedDuration }}</td>
<td>
<a class="btn btn-primary" href="{{ meeting.meetingInfoGet.join_url }}">
{{ 'Join'|get_plugin_lang('ZoomPlugin') }} {{ 'Join'|get_plugin_lang('ZoomPlugin') }}
</a> </a>
<a class="btn btn-default" href="meeting_from_start.php?meetingId={{ meeting.id }}">
{{ 'Details'|get_lang }}
</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -41,6 +41,5 @@
{% endif %} {% endif %}
{% if scheduleMeetingForm %} {% if scheduleMeetingForm %}
<h3>{{ 'ScheduleAMeeting'|get_plugin_lang('ZoomPlugin') }}</h3>
{{ scheduleMeetingForm }} {{ scheduleMeetingForm }}
{% endif %} {% endif %}
Loading…
Cancel
Save