mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-53893 core_badges: Add strictness to manual badge criteria
This commit is contained in:
parent
0344082208
commit
294f7773db
@ -207,12 +207,15 @@ class award_criteria_manual extends award_criteria {
|
||||
return array($join, $where, $params);
|
||||
} else {
|
||||
foreach ($this->params as $param) {
|
||||
$join .= " LEFT JOIN {badge_manual_award} bma{$param['role']} ON
|
||||
bma{$param['role']}.recipientid = u.id AND
|
||||
bma{$param['role']}.issuerrole = :issuerrole{$param['role']} ";
|
||||
$where .= " AND bma{$param['role']}.issuerrole IS NOT NULL ";
|
||||
$roledata[] = " bma.issuerrole = :issuerrole{$param['role']} ";
|
||||
$params["issuerrole{$param['role']}"] = $param['role'];
|
||||
}
|
||||
if (!empty($roledata)) {
|
||||
$extraon = implode(' AND ', $roledata);
|
||||
$join = " JOIN {badge_manual_award} bma ON bma.recipientid = u.id
|
||||
AND bma.badgeid = :badgeid{$this->badgeid} AND ({$extraon})";
|
||||
$params["badgeid{$this->badgeid}"] = $this->badgeid;
|
||||
}
|
||||
return array($join, $where, $params);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user