Permalink
Browse files

MDL-38011 completion: Use new localised role names

  • Loading branch information...
1 parent 931eff3 commit 3220058b14dfc84ac8529695b1af708be60f9a1e @srynot4sale srynot4sale committed with srynot4sale Apr 6, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 completion/criteria/completion_criteria_role.php
View
9 completion/criteria/completion_criteria_role.php
@@ -59,7 +59,7 @@ public static function fetch($params) {
*/
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) {
$mform->setDefault('criteria_role['.$data->id.']', 1);
@@ -122,8 +122,8 @@ public function review($completion, $mark = true, $is_complete = false) {
*/
public function get_title() {
global $DB;
- $role = $DB->get_field('role', 'name', array('id' => $this->role));
- return $role;
+ $role = $DB->get_record('role', array('id' => $this->role));
+ return role_get_name($role, context_course::instance($this->course));
}
/**
@@ -132,8 +132,7 @@ public function get_title() {
* @return string
*/
public function get_title_detailed() {
- global $DB;
- return $DB->get_field('role', 'name', array('id' => $this->role));
+ return $this->get_title();
}
/**

0 comments on commit 3220058

Please sign in to comment.