$PAGE->navbar->add($strtitle); $PAGE->set_title("{$course->shortname}: {$strname}"); $PAGE->set_heading($course->fullname); $PAGE->set_pagelayout('incourse'); /* Cached structure: class->sessions[hostid][meetingid][starttime] * ->reqfrom * ->reqto * ->resfrom */ $cache = cache::make('mod_zoom', 'sessions'); if (!($todisplay = $cache->get($zoom->host_id)) || empty($todisplay->sessions[$zoom->meeting_id][$session])) { $reqdate = getdate($session); $reqdate['month'] = $reqdate['mon']; $reqdate['day'] = $reqdate['mday']; $fdate = sprintf('%u-%u-%u', $reqdate['year'], $reqdate['month'], $reqdate['day']); $todisplay = zoom_get_sessions_for_display($zoom, $fdate, $fdate); $cache->set(strval($zoom->host_id), $todisplay); } echo $OUTPUT->header(); echo $OUTPUT->heading($strname); echo $OUTPUT->heading($strtitle, 4); $participants = $todisplay->sessions[$zoom->meeting_id][$session]->participants; if (empty($participants)) { notice(get_string('noparticipants', 'mod_zoom'), new moodle_url('/mod/zoom/report.php', array('id' => $cm->id))); } $table = new html_table(); $table->head = array(get_string('name'), get_string('jointime', 'mod_zoom'), get_string('leavetime', 'mod_zoom'), get_string('duration', 'mod_zoom')); $numcolumns = 4; foreach ($participants as $p) { $row = array(); $row[] = $p->name;
$now = getdate(); $now['month'] = $now['mon']; $now['day'] = $now['mday']; $from = optional_param_array('from', $created, PARAM_INT); $to = optional_param_array('to', $now, PARAM_INT); $ffrom = sprintf('%u-%u-%u', $from['year'], $from['month'], $from['day']); $fto = sprintf('%u-%u-%u', $to['year'], $to['month'], $to['day']); /* Cached structure: class->sessions[hostid][meetingid][starttime] * ->reqfrom * ->reqto * ->resfrom */ $cache = cache::make('mod_zoom', 'sessions'); if (!($todisplay = $cache->get(strval($zoom->host_id))) || $ffrom != $todisplay->reqfrom || $fto != $todisplay->reqto || empty($todisplay->resfrom)) { // Send a new request if the from and to fields change from what we cached, or if the response is empty. $todisplay = zoom_get_sessions_for_display($zoom, $ffrom, $fto); $cache->set(strval($zoom->host_id), $todisplay); } echo $OUTPUT->header(); echo $OUTPUT->heading($strname); echo $OUTPUT->heading($strtitle, 4); if (!empty($todisplay)) { // If the time period is longer than a month, Zoom will only return the latest month in range. $resfrom = $todisplay->resfrom; // From field in zoom's response. if ($resfrom[0] != $from['year'] || $resfrom[1] != $from['month'] || $resfrom[2] != $from['day']) { echo $OUTPUT->notification(get_string('err_long_timeframe', 'mod_zoom'), 'notifymessage'); } if (isset($todisplay->sessions[$zoom->meeting_id])) { $meetsessions = $todisplay->sessions[$zoom->meeting_id]; $table = new html_table();