From c9fc3c4c7b4786eda4682383e75743b6c2641476 Mon Sep 17 00:00:00 2001 From: Nick Phillips Date: Mon, 26 Feb 2018 14:07:44 +1300 Subject: [PATCH] Add description to event, and group to event name if present. (#296) --- classes/calendar_helpers.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/calendar_helpers.php b/classes/calendar_helpers.php index 9b5b8bf..eb29ecf 100644 --- a/classes/calendar_helpers.php +++ b/classes/calendar_helpers.php @@ -52,10 +52,15 @@ function attendance_create_calendar_event(&$session) { $caleventdata->instance = $session->attendanceid; $caleventdata->timestart = $session->sessdate; $caleventdata->timeduration = $session->duration; + $caleventdata->description = $session->description; $caleventdata->eventtype = 'attendance'; $caleventdata->timemodified = time(); $caleventdata->modulename = 'attendance'; + if (!empty($session->groupid)) { + $caleventdata->name .= " (". get_string('group', 'group') ." ". groups_get_group_name($session->groupid) .")"; + } + $calevent = new stdClass(); if ($calevent = calendar_event::create($caleventdata, false)) { $session->caleventid = $calevent->id;