|
@ -963,10 +963,21 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
|
|
|
|
|
|
$i = 1; |
|
|
$i = 1; |
|
|
foreach ($prefdata->statuses as $st) { |
|
|
foreach ($prefdata->statuses as $st) { |
|
|
|
|
|
$emptyacronym = ''; |
|
|
|
|
|
$emptydescription = ''; |
|
|
|
|
|
if (array_key_exists($st->id, $prefdata->errors)) { |
|
|
|
|
|
if (empty($prefdata->errors[$st->id]['acronym'])) { |
|
|
|
|
|
$emptyacronym = $this->construct_notice(get_string('emptyacronym', 'mod_attendance'), 'notifyproblem'); |
|
|
|
|
|
} |
|
|
|
|
|
if (empty($prefdata->errors[$st->id]['description'])) { |
|
|
|
|
|
$emptydescription = $this->construct_notice(get_string('emptydescription', 'mod_attendance') , 'notifyproblem'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$table->data[$i][] = $i; |
|
|
$table->data[$i][] = $i; |
|
|
$table->data[$i][] = $this->construct_text_input('acronym['.$st->id.']', 2, 2, $st->acronym); |
|
|
$table->data[$i][] = $this->construct_text_input('acronym['.$st->id.']', 2, 2, $st->acronym) . $emptyacronym; |
|
|
$table->data[$i][] = $this->construct_text_input('description['.$st->id.']', 30, 30, $st->description); |
|
|
$table->data[$i][] = $this->construct_text_input('description['.$st->id.']', 30, 30, $st->description) . $emptydescription; |
|
|
$table->data[$i][] = $this->construct_text_input('grade['.$st->id.']', 4, 4, format_float($st->grade)); |
|
|
$table->data[$i][] = $this->construct_text_input('grade['.$st->id.']', 4, 4, $st->grade); |
|
|
$table->data[$i][] = $this->construct_preferences_actions_icons($st, $prefdata); |
|
|
$table->data[$i][] = $this->construct_preferences_actions_icons($st, $prefdata); |
|
|
|
|
|
|
|
|
$i++; |
|
|
$i++; |
|
@ -1040,6 +1051,18 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
return html_writer::empty_tag('input', $attributes); |
|
|
return html_writer::empty_tag('input', $attributes); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Construct a notice message |
|
|
|
|
|
* |
|
|
|
|
|
* @param string $text |
|
|
|
|
|
* @param string $class |
|
|
|
|
|
* @return string |
|
|
|
|
|
*/ |
|
|
|
|
|
private function construct_notice($text, $class = 'notifymessage') { |
|
|
|
|
|
$attributes = array('class' => $class); |
|
|
|
|
|
return html_writer::tag('p', $text, $attributes); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Show different picture if it is a temporary user. |
|
|
// Show different picture if it is a temporary user. |
|
|
protected function user_picture($user, array $opts = null) { |
|
|
protected function user_picture($user, array $opts = null) { |
|
|
if ($user->type == 'temporary') { |
|
|
if ($user->type == 'temporary') { |
|
|