$string['caltoday'] = 'Today';
$string['calweekdays'] = 'Su,Mo,Tu,We,Th,Fr,Sa';
$string['cannottakeforgroup'] = 'You can\'t take attendance for group "{$a}"';
+$string['cantaddstatus'] = 'You must set an acronym and description when adding a new status.';
$string['categoryreport'] = 'Course category report';
$string['changeattendance'] = 'Change attendance';
$string['changeduration'] = 'Change duration';
if (!empty($att->pageparams->action)) {
require_sesskey();
}
-
+$notification = '';
// TODO: combine this with the stuff in defaultstatus.php to avoid code duplication.
switch ($att->pageparams->action) {
case mod_attendance_preferences_page_params::ACTION_ADD:
$status = attendance_add_status($newstatus);
if (!$status) {
- print_error('cantaddstatus', 'attendance', $this->url_preferences());
+ $notification = $OUTPUT->notification(get_string('cantaddstatus', 'attendance'), 'error');
}
if ($pageparams->statusset > $maxstatusset) {
// Output starts here.
echo $output->header();
+if (!empty($notification)) {
+ echo $notification;
+}
echo $output->heading(get_string('attendanceforthecourse', 'attendance').' :: '. format_string($course->fullname));
echo $output->render($tabs);
echo $OUTPUT->box(get_string('preferences_desc', 'attendance'), 'generalbox attendancedesc', 'notice');