diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 8a80b17..8c1f312 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -319,3 +319,4 @@ $string['repeatevery'] = 'Repeat every'; $string['repeatuntil'] = 'Repeat until'; $string['repeaton'] = 'Repeat on'; $string['invalidsessionendtime'] = 'The end time must be greater than start time'; +$string['deletedgroup'] = 'The group associated with this session has been deleted'; diff --git a/renderer.php b/renderer.php index 3b32b7a..38f9143 100644 --- a/renderer.php +++ b/renderer.php @@ -235,7 +235,15 @@ class mod_attendance_renderer extends plugin_renderer_base { $table->data[$sess->id][] = $i; if ($sess->groupid) { - $table->data[$sess->id][] = get_string('group') . ': ' . $sessdata->groups[$sess->groupid]->name; + if (empty($sessdata->groups[$sess->groupid])) { + $table->data[$sess->id][] = get_string('deletedgroup', 'attendance'); + // Remove actions and links on date/time. + $dta['actions'] = ''; + $dta['date'] = userdate($sess->sessdate, get_string('strftimedmyw', 'attendance')); + $dta['time'] = $this->construct_time($sess->sessdate, $sess->duration); + } else { + $table->data[$sess->id][] = get_string('group') . ': ' . $sessdata->groups[$sess->groupid]->name; + } } else { $table->data[$sess->id][] = get_string('commonsession', 'attendance'); }