1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of the Zoom plugin for Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* List all zoom meetings.
|
|
|
19 |
*
|
|
|
20 |
* @package mod_zoom
|
|
|
21 |
* @copyright 2015 UC Regents
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
require(__DIR__ . '/../../config.php');
|
|
|
26 |
require_once(__DIR__ . '/lib.php');
|
|
|
27 |
require_once(__DIR__ . '/locallib.php');
|
|
|
28 |
require_once(__DIR__ . '/mod_form.php');
|
|
|
29 |
require_once($CFG->libdir . '/moodlelib.php');
|
|
|
30 |
|
|
|
31 |
require_login();
|
|
|
32 |
// Additional access checks in zoom_get_instance_setup().
|
|
|
33 |
[$course, $cm, $zoom] = zoom_get_instance_setup();
|
|
|
34 |
|
|
|
35 |
// Check capability.
|
|
|
36 |
$context = context_module::instance($cm->id);
|
|
|
37 |
require_capability('mod/zoom:addinstance', $context);
|
|
|
38 |
|
|
|
39 |
$PAGE->set_url('/mod/zoom/report.php', ['id' => $cm->id]);
|
|
|
40 |
|
|
|
41 |
$strname = $zoom->name;
|
|
|
42 |
$strtitle = get_string('sessions', 'mod_zoom');
|
|
|
43 |
$PAGE->navbar->add($strtitle);
|
|
|
44 |
$PAGE->set_title("$course->shortname: $strname");
|
|
|
45 |
$PAGE->set_heading($course->fullname);
|
|
|
46 |
$PAGE->set_pagelayout('incourse');
|
|
|
47 |
|
|
|
48 |
echo $OUTPUT->header();
|
|
|
49 |
echo $OUTPUT->heading($strname);
|
|
|
50 |
echo $OUTPUT->heading($strtitle, 4);
|
|
|
51 |
|
|
|
52 |
$sessions = zoom_get_sessions_for_display($zoom->id);
|
|
|
53 |
if (!empty($sessions)) {
|
|
|
54 |
$maskparticipantdata = get_config('zoom', 'maskparticipantdata');
|
|
|
55 |
$table = new html_table();
|
|
|
56 |
$table->head = [
|
|
|
57 |
get_string('title', 'mod_zoom'),
|
|
|
58 |
get_string('starttime', 'mod_zoom'),
|
|
|
59 |
get_string('endtime', 'mod_zoom'),
|
|
|
60 |
get_string('duration', 'mod_zoom'),
|
|
|
61 |
get_string('participants', 'mod_zoom'),
|
|
|
62 |
];
|
|
|
63 |
$table->align = ['left', 'left', 'left', 'left', 'left'];
|
|
|
64 |
$format = get_string('strftimedatetimeshort', 'langconfig');
|
|
|
65 |
|
|
|
66 |
foreach ($sessions as $uuid => $meet) {
|
|
|
67 |
$row = [];
|
|
|
68 |
$row[] = $meet['topic'];
|
|
|
69 |
$row[] = $meet['starttime'];
|
|
|
70 |
$row[] = $meet['endtime'];
|
|
|
71 |
$row[] = $meet['duration'];
|
|
|
72 |
|
|
|
73 |
if ($meet['count'] > 0) {
|
|
|
74 |
if ($maskparticipantdata) {
|
|
|
75 |
$row[] = $meet['count']
|
|
|
76 |
. ' ['
|
|
|
77 |
. get_string('participantdatanotavailable', 'mod_zoom')
|
|
|
78 |
. '] '
|
|
|
79 |
. $OUTPUT->help_icon('participantdatanotavailable', 'mod_zoom');
|
|
|
80 |
} else {
|
|
|
81 |
$url = new moodle_url('/mod/zoom/participants.php', ['id' => $cm->id, 'uuid' => $uuid]);
|
|
|
82 |
$row[] = html_writer::link($url, $meet['count']);
|
|
|
83 |
}
|
|
|
84 |
} else {
|
|
|
85 |
$row[] = 0;
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
$table->data[] = $row;
|
|
|
89 |
}
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
if (!empty($table->data)) {
|
|
|
93 |
echo html_writer::table($table);
|
|
|
94 |
} else {
|
|
|
95 |
echo $OUTPUT->notification(get_string('nomeetinginstances', 'mod_zoom'), 'notifymessage');
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
echo $OUTPUT->footer();
|