Permalink
Browse files

Merge branch 'MDL-38011-24' of git://github.com/srynot4sale/moodle in…

…to MOODLE_24_STABLE
  • Loading branch information...
2 parents 5ac9166 + 3220058 commit 7af74e7f19108d8938f2ef88a529cefa2f69b502 @danpoltawski danpoltawski committed Apr 15, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 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 7af74e7

Please sign in to comment.