From e2be38b90db7cfe477afbe3bee5154a2387a805a Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Fri, 21 Sep 2018 09:46:10 -0700 Subject: [PATCH] Fixing coding issues. Also, removing "Add to calendar" since it gives error for non-hosts. --- classes/privacy/provider.php | 2 +- classes/task/get_meeting_reports.php | 4 +++- db/services.php | 3 ++- jwt/BeforeValidException.php | 1 + jwt/ExpiredException.php | 1 + jwt/JWT.php | 2 +- jwt/SignatureInvalidException.php | 7 +++--- loadmeeting.php | 2 -- participants.php | 2 +- view.php | 34 ++++++++++++---------------- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 0ec89f08..3683b257 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements */ public static function get_metadata(\core_privacy\local\metadata\collection $collection): \core_privacy\local\metadata\collection { - // Add all user data fields to the collection. + // Add all user data fields to the collection. $collection->add_database_table('mdl_zoom_meeting_participants', [ 'name' => 'privacy:metadata:mdl_zoom_meeting_participants:name', diff --git a/classes/task/get_meeting_reports.php b/classes/task/get_meeting_reports.php index e77adef3..8a97b700 100644 --- a/classes/task/get_meeting_reports.php +++ b/classes/task/get_meeting_reports.php @@ -69,7 +69,9 @@ private function format_participant($participant, $detailsid, $names, $emails) { $name = $names[$moodleuserid]; } else if (!empty($participant->name) && ($moodleuserid = array_search($participant->name, $names))) { $name = $names[$moodleuserid]; - } else if (!empty($participant->user_email) && ($moodleuser = $DB->get_record('user', array('email' => $participant->user_email, 'deleted' => 0, 'suspended' => 0), '*', IGNORE_MULTIPLE))) { + } else if (!empty($participant->user_email) && + ($moodleuser = $DB->get_record('user', array('email' => $participant->user_email, + 'deleted' => 0, 'suspended' => 0), '*', IGNORE_MULTIPLE))) { // This is the case where someone attends the meeting, but is not enrolled in the class. $moodleuserid = $moodleuser->id; $name = strtoupper(fullname($moodleuser)); diff --git a/db/services.php b/db/services.php index 617c96a8..a7745529 100755 --- a/db/services.php +++ b/db/services.php @@ -33,7 +33,8 @@ 'classname' => 'mod_zoom_external', 'methodname' => 'get_state', 'classpath' => 'mod/zoom/classes/external.php', - 'description' => 'Determine if a zoom meeting is available, meeting status, and the start time, duration, and other meeting options.', + 'description' => 'Determine if a zoom meeting is available, meeting ' + . 'status, and the start time, duration, and other meeting options.', 'type' => 'read', 'capabilities' => 'mod/zoom:view', 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE, 'local_mobile'), diff --git a/jwt/BeforeValidException.php b/jwt/BeforeValidException.php index 32761fe3..c0571e08 100644 --- a/jwt/BeforeValidException.php +++ b/jwt/BeforeValidException.php @@ -1,3 +1,4 @@ libdir . '/gradelib.php'); require_once($CFG->libdir . '/moodlelib.php'); diff --git a/participants.php b/participants.php index 621e377f..86cbf70c 100644 --- a/participants.php +++ b/participants.php @@ -107,7 +107,7 @@ $name = $p->name; if (!empty($moodleuser->email)) { $row[] = html_writer::link("mailto:$moodleuser->email", $name); - } else if (!empty($p->user_email)){ + } else if (!empty($p->user_email)) { $row[] = html_writer::link("mailto:$p->user_email", $name); } else { $row[] = $name; diff --git a/view.php b/view.php index 7998481c..68cf710a 100755 --- a/view.php +++ b/view.php @@ -52,13 +52,6 @@ $PAGE->set_title(format_string($zoom->name)); $PAGE->set_heading(format_string($course->fullname)); -/* - * Other things you may want to set - remove if not needed. - * $PAGE->set_cacheable(false); - * $PAGE->set_focuscontrol('some-html-id'); - * $PAGE->add_body_class('zoom-'.$somevar); - */ - $zoomuserid = zoom_get_user_id(false); $userishost = ($zoomuserid == $zoom->host_id); @@ -147,18 +140,21 @@ } } -// Generate add-to-calendar buttons if meeting was found. -if (!$showrecreate) { - $googlelink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/calendar/google/add'; - $outlooklink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/ics'; - $googleicon = $OUTPUT->pix_icon('i/google', get_string('googleiconalt', 'mod_zoom'), 'mod_zoom'); - $windowsicon = $OUTPUT->pix_icon('i/windows', get_string('windowsiconalt', 'mod_zoom'), 'mod_zoom'); - $googlebutton = html_writer::div($googleicon . ' ' . get_string('googlecalendar', 'mod_zoom'), 'btn btn-primary'); - $outlookbutton = html_writer::div($windowsicon . ' ' . get_string('outlook', 'mod_zoom'), 'btn btn-primary'); - $googlehtml = html_writer::link($googlelink, $googlebutton, array('target' => '_blank')); - $outlookhtml = html_writer::link($outlooklink, $outlookbutton, array('target' => '_blank')); - $table->data[] = array(get_string('addtocalendar', 'mod_zoom'), $googlehtml . $outlookhtml); -} +//@codingStandardsIgnoreStart +// TODO: Commenting out because it requires user to be host. Need to generate ical file ourselves. +//// Generate add-to-calendar buttons if meeting was found. +//if (!$showrecreate) { +// $googlelink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/calendar/google/add'; +// $outlooklink = 'https://ucla.zoom.us/meeting/' . $zoom->meeting_id . '/ics'; +// $googleicon = $OUTPUT->pix_icon('i/google', get_string('googleiconalt', 'mod_zoom'), 'mod_zoom'); +// $windowsicon = $OUTPUT->pix_icon('i/windows', get_string('windowsiconalt', 'mod_zoom'), 'mod_zoom'); +// $googlebutton = html_writer::div($googleicon . ' ' . get_string('googlecalendar', 'mod_zoom'), 'btn btn-primary'); +// $outlookbutton = html_writer::div($windowsicon . ' ' . get_string('outlook', 'mod_zoom'), 'btn btn-primary'); +// $googlehtml = html_writer::link($googlelink, $googlebutton, array('target' => '_blank')); +// $outlookhtml = html_writer::link($outlooklink, $outlookbutton, array('target' => '_blank')); +// $table->data[] = array(get_string('addtocalendar', 'mod_zoom'), $googlehtml . $outlookhtml); +//} +//@codingStandardsIgnoreEnd if ($zoom->recurring) { $recurringmessage = new html_table_cell(get_string('recurringmeetinglong', 'mod_zoom'));