From cb78bdbc4f561f7b4ea2a3086471aeff2883e559 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 2 Feb 2017 21:38:20 +1300 Subject: [PATCH] Fix coding guideline issues. --- classes/observer.php | 2 +- db/events.php | 2 ++ lib.php | 2 +- renderhelpers.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/observer.php b/classes/observer.php index 16804a8..150a540 100644 --- a/classes/observer.php +++ b/classes/observer.php @@ -41,7 +41,7 @@ class mod_attendance_observer { public static function course_content_deleted(\core\event\course_content_deleted $event) { global $DB; - $attids = array_keys($DB->get_records('attendance', array('course' => $event->objectid), '', 'id')); + $attids = array_keys($DB->get_records('attendance', array('course' => $event->objectid), '', 'id')); $sessids = array_keys($DB->get_records_list('attendance_sessions', 'attendanceid', $attids, '', 'id')); if (attendance_existing_calendar_events_ids($sessids)) { attendance_delete_calendar_events($sessids); diff --git a/db/events.php b/db/events.php index afe87a6..6b877b3 100644 --- a/db/events.php +++ b/db/events.php @@ -23,6 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + // List of observers. $observers = array( diff --git a/lib.php b/lib.php index e3d6163..f1cd0fc 100644 --- a/lib.php +++ b/lib.php @@ -275,7 +275,7 @@ function attendance_grade_item_update($attendance, $grades=null) { $params = array('itemname' => $attendance->name, 'idnumber' => $attendance->cmidnumber); } else { // MDL-14303. - $params = array('itemname' => $attendance->name/*, 'idnumber'=>$attendance->id*/); + $params = array('itemname' => $attendance->name); } if ($attendance->grade > 0) { diff --git a/renderhelpers.php b/renderhelpers.php index 9c1a5c6..285649c 100644 --- a/renderhelpers.php +++ b/renderhelpers.php @@ -218,7 +218,7 @@ class user_sessions_cells_text_generator extends user_sessions_cells_generator { } } -// Used to print simple time - 1am instead of 1:00am +// Used to print simple time - 1am instead of 1:00am. function attendance_strftimehm($time) { $mins = userdate($time, '%M'); if ($mins == '00') {