From 6025dabd48a8aae2ea4743c0755e4c8fb0aa9b01 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 28 Apr 2017 08:47:47 +1200 Subject: [PATCH] Fixes #254 - issue with colspan in header/footer. Thanks to @xuwenbin for report and patch. --- renderer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/renderer.php b/renderer.php index dd1449e..6b5180c 100644 --- a/renderer.php +++ b/renderer.php @@ -969,17 +969,18 @@ class mod_attendance_renderer extends plugin_renderer_base { */ protected function get_user_rows(attendance_report_data $reportdata) { $rows = array(); + $extrafields = get_extra_user_fields($reportdata->att->context); + $usercolspan = 1 + count($extrafields); $row = new html_table_row(); $row->cells[] = $this->build_header_cell(''); - $row->cells[] = $this->build_header_cell(get_string('users'), false, false); + $row->cells[] = $this->build_header_cell(get_string('users'), false, false, $usercolspan); $rows[] = $row; $row = new html_table_row(); $row->cells[] = $this->build_header_cell(''); $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); } @@ -1000,7 +1001,7 @@ class mod_attendance_renderer extends plugin_renderer_base { $row = new html_table_row(); $row->cells[] = $this->build_data_cell(''); $text = ($reportdata->pageparams->view == ATT_VIEW_SUMMARY) ? '' : get_string('summary'); - $row->cells[] = $this->build_data_cell($text); + $row->cells[] = $this->build_data_cell($text, false, true, $usercolspan); $rows[] = $row; return $rows;