mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
89 stars 155 forks source link

Question about use case #586

Closed seon22break closed 8 months ago

seon22break commented 8 months ago

In file view.php :

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.

seon22break commented 8 months ago

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.