|
@ -499,7 +499,7 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected function render_attendance_take_list(attendance_take_data $takedata) { |
|
|
protected function render_attendance_take_list(attendance_take_data $takedata) { |
|
|
global $PAGE; |
|
|
global $PAGE, $CFG; |
|
|
$table = new html_table(); |
|
|
$table = new html_table(); |
|
|
$table->width = '0%'; |
|
|
$table->width = '0%'; |
|
|
$table->head = array( |
|
|
$table->head = array( |
|
@ -509,6 +509,15 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
$table->align = array('left', 'left'); |
|
|
$table->align = array('left', 'left'); |
|
|
$table->size = array('20px', ''); |
|
|
$table->size = array('20px', ''); |
|
|
$table->wrap[1] = 'nowrap'; |
|
|
$table->wrap[1] = 'nowrap'; |
|
|
|
|
|
// Check if extra useridentity fields need to be added. |
|
|
|
|
|
$extrasearchfields = array(); |
|
|
|
|
|
if (!empty($CFG->showuseridentity) && has_capability('moodle/site:viewuseridentity', $takedata->att->context)) { |
|
|
|
|
|
$extrasearchfields = explode(',', $CFG->showuseridentity); |
|
|
|
|
|
} |
|
|
|
|
|
foreach ($extrasearchfields as $field) { |
|
|
|
|
|
$table->head[] = get_string($field); |
|
|
|
|
|
$table->align[] = 'left'; |
|
|
|
|
|
} |
|
|
foreach ($takedata->statuses as $st) { |
|
|
foreach ($takedata->statuses as $st) { |
|
|
$table->head[] = html_writer::link("#", $st->acronym, array('id' => 'checkstatus'.$st->id, |
|
|
$table->head[] = html_writer::link("#", $st->acronym, array('id' => 'checkstatus'.$st->id, |
|
|
'title' => get_string('setallstatusesto', 'attendance', $st->description))); |
|
|
'title' => get_string('setallstatusesto', 'attendance', $st->description))); |
|
@ -533,6 +542,9 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
// Show a 'select all' row of radio buttons. |
|
|
// Show a 'select all' row of radio buttons. |
|
|
$row = new html_table_row(); |
|
|
$row = new html_table_row(); |
|
|
$row->cells[] = ''; |
|
|
$row->cells[] = ''; |
|
|
|
|
|
foreach ($extrasearchfields as $field) { |
|
|
|
|
|
$row->cells[] = ''; |
|
|
|
|
|
} |
|
|
$row->cells[] = html_writer::div(get_string('setallstatuses', 'attendance'), 'setallstatuses'); |
|
|
$row->cells[] = html_writer::div(get_string('setallstatuses', 'attendance'), 'setallstatuses'); |
|
|
foreach ($takedata->statuses as $st) { |
|
|
foreach ($takedata->statuses as $st) { |
|
|
$attribs = array( |
|
|
$attribs = array( |
|
@ -568,6 +580,9 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
$fullname .= $ucdata['warning']; |
|
|
$fullname .= $ucdata['warning']; |
|
|
} |
|
|
} |
|
|
$row->cells[] = $fullname; |
|
|
$row->cells[] = $fullname; |
|
|
|
|
|
foreach ($extrasearchfields as $field) { |
|
|
|
|
|
$row->cells[] = $user->$field; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (array_key_exists('colspan', $ucdata)) { |
|
|
if (array_key_exists('colspan', $ucdata)) { |
|
|
$cell = new html_table_cell($ucdata['text']); |
|
|
$cell = new html_table_cell($ucdata['text']); |
|
@ -887,6 +902,7 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
$table->attributes['class'] = 'generaltable attwidth attreport'; |
|
|
$table->attributes['class'] = 'generaltable attwidth attreport'; |
|
|
|
|
|
|
|
|
$userrows = $this->get_user_rows($reportdata); |
|
|
$userrows = $this->get_user_rows($reportdata); |
|
|
|
|
|
|
|
|
if ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) { |
|
|
if ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) { |
|
|
$sessionrows = array(); |
|
|
$sessionrows = array(); |
|
|
} else { |
|
|
} else { |
|
@ -962,13 +978,23 @@ class mod_attendance_renderer extends plugin_renderer_base { |
|
|
$row = new html_table_row(); |
|
|
$row = new html_table_row(); |
|
|
$row->cells[] = $this->build_header_cell(''); |
|
|
$row->cells[] = $this->build_header_cell(''); |
|
|
$row->cells[] = $this->build_header_cell($this->construct_fullname_head($reportdata), false, false); |
|
|
$row->cells[] = $this->build_header_cell($this->construct_fullname_head($reportdata), false, false); |
|
|
|
|
|
|
|
|
|
|
|
$extrafields = get_extra_user_fields($reportdata->att->context); |
|
|
|
|
|
foreach ($extrafields as $field) { |
|
|
|
|
|
$row->cells[] = $this->build_header_cell(get_string($field), false, false); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$rows[] = $row; |
|
|
$rows[] = $row; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($reportdata->users as $user) { |
|
|
foreach ($reportdata->users as $user) { |
|
|
$row = new html_table_row(); |
|
|
$row = new html_table_row(); |
|
|
$row->cells[] = $this->build_data_cell($this->user_picture($user)); |
|
|
$row->cells[] = $this->build_data_cell($this->user_picture($user)); |
|
|
$text = html_writer::link($reportdata->url_view(array('studentid' => $user->id)), fullname($user)); |
|
|
$text = html_writer::link($reportdata->url_view(array('studentid' => $user->id)), fullname($user)); |
|
|
$row->cells[] = $this->build_data_cell($text, false, false, null, null, false); |
|
|
$row->cells[] = $this->build_data_cell($text, false, false, null, null, false); |
|
|
|
|
|
foreach ($extrafields as $field) { |
|
|
|
|
|
$row->cells[] = $this->build_data_cell($user->$field, false, false); |
|
|
|
|
|
} |
|
|
$rows[] = $row; |
|
|
$rows[] = $row; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|