|
8 | 8 |
|
9 | 9 | api_protect_course_script(true); |
10 | 10 |
|
11 | | -// the section (for the tabs) |
12 | 11 | $this_section = SECTION_COURSES; |
13 | 12 | $logInfo = [ |
14 | 13 | 'tool' => 'Videoconference Zoom', |
|
24 | 23 | $session = api_get_session_entity(); |
25 | 24 | $plugin = ZoomPlugin::create(); |
26 | 25 |
|
27 | | -if (api_is_in_group()) { |
| 26 | +if (null !== $group) { |
28 | 27 | $interbreadcrumb[] = [ |
29 | 28 | 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), |
30 | 29 | 'name' => get_lang('Groups'), |
|
35 | 34 | ]; |
36 | 35 | } |
37 | 36 |
|
| 37 | +$url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq='; |
| 38 | +$htmlHeadXtra[] = '<script> |
| 39 | + $(function() { |
| 40 | + $("#group_select").on("change", function() { |
| 41 | + var groupId = $(this).find("option:selected").val(); |
| 42 | + var url = "'.$url.'"; |
| 43 | + window.location.replace(url+groupId); |
| 44 | + }); |
| 45 | +}); |
| 46 | +</script>'; |
| 47 | + |
38 | 48 | $tool_name = $plugin->get_lang('ZoomVideoConferences'); |
39 | 49 | $tpl = new Template($tool_name); |
40 | 50 |
|
41 | 51 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; |
42 | 52 |
|
43 | 53 | $isManager = $plugin->userIsCourseConferenceManager(); |
44 | 54 | if ($isManager) { |
| 55 | + $groupId = api_get_group_id(); |
| 56 | + $groups = GroupManager::get_groups(); |
| 57 | + if (!empty($groups)) { |
| 58 | + |
| 59 | + $form = new FormValidator('group_filter'); |
| 60 | + $groupList[0] = get_lang('Select'); |
| 61 | + foreach ($groups as $groupData) { |
| 62 | + $itemGroupId = $groupData['iid']; |
| 63 | + /*if (isset($meetingsGroup[$itemGroupId]) && $meetingsGroup[$itemGroupId] == 1) { |
| 64 | + $groupData['name'] .= ' ('.get_lang('Active').')'; |
| 65 | + }*/ |
| 66 | + $groupList[$itemGroupId] = $groupData['name']; |
| 67 | + } |
| 68 | + $form->addSelect('group_id', get_lang('Groups'), $groupList, ['id' => 'group_select']); |
| 69 | + $form->setDefaults(['group_id' => $groupId]); |
| 70 | + $formToString = $form->returnForm(); |
| 71 | + |
| 72 | + $tpl->assign('group_form', $formToString); |
| 73 | + } |
| 74 | + |
45 | 75 | switch ($action) { |
46 | 76 | case 'delete': |
47 | 77 | $meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $_REQUEST['meetingId']]); |
|
52 | 82 | } |
53 | 83 |
|
54 | 84 | $user = api_get_user_entity(api_get_user_id()); |
55 | | - // user can create a new meeting |
| 85 | + |
56 | 86 | $tpl->assign( |
57 | | - 'createInstantMeetingForm', |
| 87 | + 'instant_meeting_form', |
58 | 88 | $plugin->getCreateInstantMeetingForm( |
59 | 89 | $user, |
60 | 90 | $course, |
|
63 | 93 | )->returnForm() |
64 | 94 | ); |
65 | 95 | $tpl->assign( |
66 | | - 'scheduleMeetingForm', |
| 96 | + 'schedule_meeting_form', |
67 | 97 | $plugin->getScheduleMeetingForm( |
68 | 98 | $user, |
69 | 99 | $course, |
|
75 | 105 |
|
76 | 106 | try { |
77 | 107 | $tpl->assign( |
78 | | - 'scheduledMeetings', |
| 108 | + 'meetings', |
79 | 109 | $plugin->getMeetingRepository()->courseMeetings($course, $group, $session) |
80 | 110 | ); |
81 | 111 | } catch (Exception $exception) { |
|
0 commit comments