mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-38011 completion: Use new localised role names
This commit is contained in:
parent
931eff3b84
commit
3220058b14
1 changed files with 4 additions and 5 deletions
|
@ -59,7 +59,7 @@ class completion_criteria_role extends completion_criteria {
|
||||||
*/
|
*/
|
||||||
public function config_form_display(&$mform, $data = null) {
|
public function config_form_display(&$mform, $data = null) {
|
||||||
|
|
||||||
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $data->name);
|
$mform->addElement('checkbox', 'criteria_role['.$data->id.']', $this->get_title($data));
|
||||||
|
|
||||||
if ($this->id) {
|
if ($this->id) {
|
||||||
$mform->setDefault('criteria_role['.$data->id.']', 1);
|
$mform->setDefault('criteria_role['.$data->id.']', 1);
|
||||||
|
@ -122,8 +122,8 @@ class completion_criteria_role extends completion_criteria {
|
||||||
*/
|
*/
|
||||||
public function get_title() {
|
public function get_title() {
|
||||||
global $DB;
|
global $DB;
|
||||||
$role = $DB->get_field('role', 'name', array('id' => $this->role));
|
$role = $DB->get_record('role', array('id' => $this->role));
|
||||||
return $role;
|
return role_get_name($role, context_course::instance($this->course));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,8 +132,7 @@ class completion_criteria_role extends completion_criteria {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function get_title_detailed() {
|
public function get_title_detailed() {
|
||||||
global $DB;
|
return $this->get_title();
|
||||||
return $DB->get_field('role', 'name', array('id' => $this->role));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue