Minor - Plugins - Zoom - Add group filter - WIP - BT#17288

pull/3446/head
Julio Montoya 5 years ago
parent 5ca88d8011
commit 2daf03204d
  1. 2
      plugin/bbb/listing.php
  2. 42
      plugin/zoom/start.php
  3. 16
      plugin/zoom/view/start.tpl

@ -353,7 +353,7 @@ if ($bbb->isGlobalConference() === false &&
) { ) {
$url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq='; $url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq=';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("#group_select").on("change", function() { $("#group_select").on("change", function() {
var groupId = $(this).find("option:selected").val(); var groupId = $(this).find("option:selected").val();
var url = "'.$url.'"; var url = "'.$url.'";

@ -8,7 +8,6 @@ require_once __DIR__.'/config.php';
api_protect_course_script(true); api_protect_course_script(true);
// the section (for the tabs)
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$logInfo = [ $logInfo = [
'tool' => 'Videoconference Zoom', 'tool' => 'Videoconference Zoom',
@ -24,7 +23,7 @@ $group = api_get_group_entity();
$session = api_get_session_entity(); $session = api_get_session_entity();
$plugin = ZoomPlugin::create(); $plugin = ZoomPlugin::create();
if (api_is_in_group()) { if (null !== $group) {
$interbreadcrumb[] = [ $interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
'name' => get_lang('Groups'), 'name' => get_lang('Groups'),
@ -35,6 +34,17 @@ if (api_is_in_group()) {
]; ];
} }
$url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq=';
$htmlHeadXtra[] = '<script>
$(function() {
$("#group_select").on("change", function() {
var groupId = $(this).find("option:selected").val();
var url = "'.$url.'";
window.location.replace(url+groupId);
});
});
</script>';
$tool_name = $plugin->get_lang('ZoomVideoConferences'); $tool_name = $plugin->get_lang('ZoomVideoConferences');
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
@ -42,6 +52,26 @@ $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$isManager = $plugin->userIsCourseConferenceManager(); $isManager = $plugin->userIsCourseConferenceManager();
if ($isManager) { if ($isManager) {
$groupId = api_get_group_id();
$groups = GroupManager::get_groups();
if (!empty($groups)) {
$form = new FormValidator('group_filter');
$groupList[0] = get_lang('Select');
foreach ($groups as $groupData) {
$itemGroupId = $groupData['iid'];
/*if (isset($meetingsGroup[$itemGroupId]) && $meetingsGroup[$itemGroupId] == 1) {
$groupData['name'] .= ' ('.get_lang('Active').')';
}*/
$groupList[$itemGroupId] = $groupData['name'];
}
$form->addSelect('group_id', get_lang('Groups'), $groupList, ['id' => 'group_select']);
$form->setDefaults(['group_id' => $groupId]);
$formToString = $form->returnForm();
$tpl->assign('group_form', $formToString);
}
switch ($action) { switch ($action) {
case 'delete': case 'delete':
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]); $meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]);
@ -52,9 +82,9 @@ if ($isManager) {
} }
$user = api_get_user_entity(api_get_user_id()); $user = api_get_user_entity(api_get_user_id());
// user can create a new meeting
$tpl->assign( $tpl->assign(
'createInstantMeetingForm', 'instant_meeting_form',
$plugin->getCreateInstantMeetingForm( $plugin->getCreateInstantMeetingForm(
$user, $user,
$course, $course,
@ -63,7 +93,7 @@ if ($isManager) {
)->returnForm() )->returnForm()
); );
$tpl->assign( $tpl->assign(
'scheduleMeetingForm', 'schedule_meeting_form',
$plugin->getScheduleMeetingForm( $plugin->getScheduleMeetingForm(
$user, $user,
$course, $course,
@ -75,7 +105,7 @@ if ($isManager) {
try { try {
$tpl->assign( $tpl->assign(
'scheduledMeetings', 'meetings',
$plugin->getMeetingRepository()->courseMeetings($course, $group, $session) $plugin->getMeetingRepository()->courseMeetings($course, $group, $session)
); );
} catch (Exception $exception) { } catch (Exception $exception) {

@ -1,8 +1,12 @@
{% if createInstantMeetingForm %} {% if instant_meeting_form %}
{{ createInstantMeetingForm }} {{ instant_meeting_form }}
{% endif %} {% endif %}
{% if scheduledMeetings.count %} {% if group_form %}
{{ group_form }}
{% endif %}
{% if meetings.count %}
<div class="page-header"> <div class="page-header">
<h2>{{ 'ScheduledMeetings'|get_lang }}</h2> <h2>{{ 'ScheduledMeetings'|get_lang }}</h2>
</div> </div>
@ -14,7 +18,7 @@
<th>{{ 'Duration'|get_lang }}</th> <th>{{ 'Duration'|get_lang }}</th>
<th>{{ 'Actions'|get_lang }}</th> <th>{{ 'Actions'|get_lang }}</th>
</tr> </tr>
{% for meeting in scheduledMeetings %} {% for meeting in meetings %}
<tr> <tr>
<td> <td>
{{ meeting.meetingInfoGet.topic }} {{ meeting.meetingInfoGet.topic }}
@ -47,6 +51,6 @@
</table> </table>
{% endif %} {% endif %}
{% if scheduleMeetingForm %} {% if schedule_meeting_form %}
{{ scheduleMeetingForm }} {{ schedule_meeting_form }}
{% endif %} {% endif %}
Loading…
Cancel
Save