$text .= ' ';
$text .= $sess->groupid ? $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance');
$data->tabhead[] = $text;
+ if (isset($formdata->includeremarks)) {
+ $data->tabhead[] = get_string('remark', 'attendance', $text);
+ }
}
} else {
print_error('sessionsnotfound', 'attendance', $att->url_manage());
$data->table[$i][] = $user->lastname;
$data->table[$i][] = $user->firstname;
$cellsgenerator = new user_sessions_cells_text_generator($reportdata, $user);
- $data->table[$i] = array_merge($data->table[$i], $cellsgenerator->get_cells());
+ $data->table[$i] = array_merge($data->table[$i], $cellsgenerator->get_cells($formdata->includeremarks));
if ($reportdata->gradable) {
$data->table[$i][] = $reportdata->grades[$user->id].' / '.$reportdata->maxgrades[$user->id];
}
$mform->addElement('checkbox', 'includeallsessions', get_string('includeall', 'attendance'), get_string('yes'));
$mform->setDefault('includeallsessions', true);
$mform->addElement('checkbox', 'includenottaken', get_string('includenottaken', 'attendance'), get_string('yes'));
+ $mform->addElement('checkbox', 'includeremarks', get_string('includeremarks', 'attendance'), get_string('yes'));
$mform->addElement('date_selector', 'sessionstartdate', get_string('startofperiod', 'attendance'));
$mform->setDefault('sessionstartdate', $course->startdate);
$mform->disabledIf('sessionstartdate', 'includeallsessions', 'checked');
$string['period'] = 'Frequency';
$string['pluginname'] = 'Attendance';
$string['pluginadministration'] = 'Attendance administration';
+$string['remark'] = 'Remark for: {a}';
$string['remarks'] = 'Remarks';
$string['report'] = 'Report';
$string['required'] = 'Required*';
}
$params = array(
'type' => 'text',
- 'name' => 'remarks'.$user->id);
+ 'name' => 'remarks'.$user->id,
+ 'maxlength' => 255);
if (array_key_exists($user->id, $takedata->sessionlog)) {
$params['value'] = $takedata->sessionlog[$user->id]->remarks;
}
$this->user = $user;
}
- public function get_cells() {
+ public function get_cells($remarks = false) {
$this->init_cells();
foreach ($this->reportdata->sessions as $sess) {
if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) {
} else {
$this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym);
}
+ if ($remarks) {
+ $this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks);
+ }
} else {
if ($this->user->enrolmentstart > $sess->sessdate) {
$starttext = get_string('enrolmentstart', 'attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y'));
$this->construct_not_existing_for_user_session_cell('');
}
}
+ if ($remarks) {
+ $this->construct_remarks_cell('');
+ }
}
}
$this->finalize_cells();
protected function construct_not_taken_cell($text) {
$this->cells[] = $text;
}
+
+ protected function construct_remarks_cell($text) {
+ $this->cells[] = $text;
+ }
protected function construct_not_existing_for_user_session_cell($text) {
$this->cells[] = $text;
$this->close_open_cell_if_needed();
$this->cells[] = $text;
}
+
+ protected function construct_remarks_cell($text) {
+ $this->close_open_cell_if_needed();
+ $this->cells[] = $text;
+ }
protected function construct_not_existing_for_user_session_cell($text) {
$this->close_open_cell_if_needed();