if (!$downloadown && !$downloadissue) {
// Get the current groups mode.
.....
} else if ($canreceive || $canmanage) { // Output to pdf.
// Set the userid value of who we are downloading the certificate for.
$userid = $USER->id;
if ($downloadown) {
// Create new customcert issue record if one does not already exist.
.....
} else if ($downloadissue && $canviewreport) {
$userid = $downloadissue;
}
// Now we want to generate the PDF.
$template = new \mod_customcert\template($template);
$template->generate_pdf(false, $userid);
exit();
I have a question. Because in the case that $downloadissue && $canviewreport = true , the userid is matched to the issue id if inside the following function generate_pdf , it is searched by userid and it has nothing to do with the issue.
My apologies. I have read a little more into the code, and the confusion was due to the implementation itself and not the project in general. Thanks anyway.
In file
view.php
:I have a question. Because in the case that $downloadissue && $canviewreport = true , the userid is matched to the issue id if inside the following function
generate_pdf
, it is searched by userid and it has nothing to do with the issue.