Own certificate not showing in list when "manage certificates" is On

Own certificate not showing in list when "manage certificates" is On

by Pieter Wolters -
Number of replies: 3

Hi all

I will be running some courses for our company within the Netherlands and I upgrade an old Certificate module to the current version.

This question is a permission problem I think.

In short: when "Manage Certificate" is allowed you can not see your own certificate in the report view ("see all xxx certificates").


I want him/her to see als his own certificate.

The situation is as follows:

  • I created a role which I called "Location Champion".
    • The role of the location champion is to coach is collegues in doing the courses, as we are 24/7 company.
    • The location champion is allowed to see the scores of his collegues within his location or location's
    • And also to view the certificates
    • A location champion can be a firstline manager but sometimes he is a one of the guys, primus interpares
  • So to let him view the certificates I allow in this role "certificate:manage" (Manage Certificates)
  • This is all-right:
  • He can download/view his own certificate, when he is student (he can have a double role)
    • He can view the certificates of his collegues (ie within his groups in a report (see all xxx certificates))
    • But he can not see his OWN certificate in this report view.
    • Actually this certificate disappears from this report also when viewed as an administrator




Questions:

  • Is this intentional.
  • If I do want this what do I have to change?
Average of ratings: -
In reply to Pieter Wolters

Re: Own certificate not showing in list when "manage certificates" is On

by Pieter Wolters -

As extra information : we are using Moodle 1.9

Greetzz and thnx

In reply to Pieter Wolters

Re: Own certificate not showing in list when "manage certificates" is On

by Jean-Michel Védrine -

Hello,

If your problem is located when the url is something like mod/certificate/report.php?... then it is easy to correct.

open the mod/certificate/lib.php and in the function certificate_get_issues, either suppress or comment the lines

    if (!empty($users)) {
        foreach ($users as $id=>$user) {
            if (isset($certmanagers[$id])) { //exclude certmanagers.
                unset($users[$id]);
            }
        }
    }

For instance if you don't want to suppress them you can put them between /*    */ like this :

/*    if (!empty($users)) {
        foreach ($users as $id=>$user) {
            if (isset($certmanagers[$id])) { //exclude certmanagers.
                unset($users[$id]);
            }
        }
    }

*/

This will remove the suppression of certificate managers in the list

If you also want them counted in the display

view xxx certificates issued

in the function certificate_count_issues you need to suppress or comment the lines :

    foreach ($users as $id=>$user) {
        if (isset($certmanagers[$id])) { //exclude certmanagers.
            unset($users[$id]);
        }
    }

 

In reply to Jean-Michel Védrine

Re: Own certificate not showing in list when "manage certificates" is On

by Pieter Wolters -

Hi Jean-Michel,

Exact what I needed, thanx a lot. It works for me,

 

Greetingz

 

Pieter