#6 Added ability to view other users' certificates

This commit is contained in:
Mark Nelson 2016-08-23 16:22:58 +08:00
parent d6ebc95c77
commit 6d28a15851
16 changed files with 90 additions and 32 deletions

View file

@ -68,15 +68,18 @@ class report_table extends \table_sql {
'fullname',
'timecreated',
'code',
'download'
));
$this->define_headers(array(
get_string('fullname'),
get_string('receiveddate', 'customcert'),
get_string('code', 'customcert')
get_string('code', 'customcert'),
get_string('file')
));
$this->collapsible(false);
$this->sortable(true);
$this->no_sorting('code');
$this->no_sorting('download');
$this->is_downloadable(true);
$this->customcertid = $customcertid;
@ -116,6 +119,24 @@ class report_table extends \table_sql {
return $user->code;
}
/**
* Generate the download column.
*
* @param \stdClass $user
* @return string
*/
public function col_download($user) {
global $OUTPUT;
$icon = new \pix_icon('i/import', get_string('download'));
$link = new \moodle_url('/mod/customcert/report.php',
array('id' => $this->cm->id,
'downloadcert' => '1',
'userid' => $user->id));
return $OUTPUT->action_link($link, '', null, null, $icon);
}
/**
* Query the reader.
*