|
@ -70,10 +70,8 @@ if (get_config('attendance', 'enablecalendar')) { |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if ($action == 'delete' && confirm_sesskey()) { |
|
|
if ($action == 'delete' && confirm_sesskey()) { |
|
|
$caleventids = $DB->get_records_select_menu('attendance_sessions', 'caleventid > 0', array(), |
|
|
// Attendance isn't using Calendar - delete anything that was created. |
|
|
'', 'caleventid, caleventid as id2'); |
|
|
$DB->delete_records('event', ['modulename' => 'attendance', 'eventtype' => 'attendance']); |
|
|
$DB->delete_records_list('event', 'id', $caleventids); |
|
|
|
|
|
$DB->execute("UPDATE {attendance_sessions} set caleventid = 0"); |
|
|
|
|
|
echo $OUTPUT->notification(get_string('eventsdeleted', 'mod_attendance'), 'notifysuccess'); |
|
|
echo $OUTPUT->notification(get_string('eventsdeleted', 'mod_attendance'), 'notifysuccess'); |
|
|
} else { |
|
|
} else { |
|
|
// Check to see if there are any events that need to be deleted. |
|
|
// Check to see if there are any events that need to be deleted. |
|
|