Re-add code column (#264)

This commit is contained in:
Mark Nelson 2019-12-16 16:55:33 +01:00
parent d37cc22135
commit 7f62e6eaec

View file

@ -74,6 +74,7 @@ class report_table extends \table_sql {
$columns[] = $extrafield; $columns[] = $extrafield;
} }
$columns[] = 'timecreated'; $columns[] = 'timecreated';
$columns[] = 'code';
$headers = []; $headers = [];
$headers[] = get_string('fullname'); $headers[] = get_string('fullname');
@ -81,6 +82,7 @@ class report_table extends \table_sql {
$headers[] = get_user_field_name($extrafield); $headers[] = get_user_field_name($extrafield);
} }
$headers[] = get_string('receiveddate', 'customcert'); $headers[] = get_string('receiveddate', 'customcert');
$headers[] = get_string('code', 'customcert');
// Check if we were passed a filename, which means we want to download it. // Check if we were passed a filename, which means we want to download it.
if ($download) { if ($download) {
@ -101,6 +103,7 @@ class report_table extends \table_sql {
$this->define_headers($headers); $this->define_headers($headers);
$this->collapsible(false); $this->collapsible(false);
$this->sortable(true); $this->sortable(true);
$this->no_sorting('code');
$this->no_sorting('download'); $this->no_sorting('download');
$this->is_downloadable(true); $this->is_downloadable(true);
@ -135,6 +138,16 @@ class report_table extends \table_sql {
return userdate($user->timecreated); return userdate($user->timecreated);
} }
/**
* Generate the code column.
*
* @param \stdClass $user
* @return string
*/
public function col_code($user) {
return $user->code;
}
/** /**
* Generate the download column. * Generate the download column.
* *