diff --git a/classes/event/student_attendance_sessions_viewed.php b/classes/event/session_report_viewed.php similarity index 94% rename from classes/event/student_attendance_sessions_viewed.php rename to classes/event/session_report_viewed.php index d97bf23..de625ba 100644 --- a/classes/event/student_attendance_sessions_viewed.php +++ b/classes/event/session_report_viewed.php @@ -18,7 +18,7 @@ * This file contains an event for when a student's attendance report is viewed. * * @package mod_attendance - * @copyright 2014 onwards Dan Marsden + * @copyright 2019 Nick Phillips * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -35,11 +35,10 @@ defined('MOODLE_INTERNAL') || die(); * string mode Mode of the report viewed. * } * @package mod_attendance - * @since Moodle 2.7 - * @copyright 2013 onwards Dan Marsden + * @copyright 2019 Nick Phillips * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class student_attendance_sessions_viewed extends \core\event\base { +class session_report_viewed extends \core\event\base { /** * Init method. @@ -75,9 +74,11 @@ class student_attendance_sessions_viewed extends \core\event\base { * @return \moodle_url */ public function get_url() { + // Mode is optional. + $mode = empty($this->other['mode']) ? "" : $this->other['mode']; return new \moodle_url('/mod/attendance/view.php', array('id' => $this->contextinstanceid, 'studentid' => $this->relateduserid, - 'mode' => $this->other['mode'], + 'mode' => $mode, 'view' => $this->other['view'], 'curdate' => $this->other['curdate'])); } diff --git a/lang/en/attendance.php b/lang/en/attendance.php index dc8ae3f..046caaa 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -216,7 +216,7 @@ $string['eventsessionipshared'] = 'Attendance self-marking IP conflict'; $string['eventsessionupdated'] = 'Session updated'; $string['eventstatusadded'] = 'Status added'; $string['eventstatusupdated'] = 'Status updated'; -$string['eventstudentattendancesessionsviewed'] = 'Student attendance sessions viewed'; +$string['eventstudentattendancesessionsviewed'] = 'Session report viewed'; $string['eventtaken'] = 'Attendance taken'; $string['eventtakenbystudent'] = 'Attendance taken by student'; $string['export'] = 'Export'; diff --git a/version.php b/version.php index 9a1178c..d70f28d 100755 --- a/version.php +++ b/version.php @@ -23,7 +23,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2019080800; +$plugin->version = 2019080801; $plugin->requires = 2019072500; // Requires 3.8. $plugin->release = '3.8.0'; $plugin->maturity = MATURITY_STABLE; diff --git a/view.php b/view.php index 9352322..4be6a1b 100644 --- a/view.php +++ b/view.php @@ -89,7 +89,7 @@ $filterparams = array( 'enddate' => $userdata->pageparams->enddate ); $params = array_merge($userdata->pageparams->get_significant_params(), $filterparams); -$event = \mod_attendance\event\student_attendance_sessions_viewed::create(array( +$event = \mod_attendance\event\session_report_viewed::create(array( 'relateduserid' => $userdata->pageparams->studentid, 'context' => $context, 'other' => $params));