Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-39110 Administration: Get role from get_roles function to display…

… as filter label
  • Loading branch information...
commit ff10ac525819bb497e5adbfb2217c0aa4bf7a8b2 1 parent b3661ab
@rajeshtaneja rajeshtaneja authored
Showing with 5 additions and 4 deletions.
  1. +2 −2 user/filters/courserole.php
  2. +3 −2 user/filters/globalrole.php
View
4 user/filters/courserole.php
@@ -129,8 +129,8 @@ function get_label($data) {
$a->label = $this->_label;
if ($roleid) {
- $rolename = $DB->get_field('role', 'name', array('id'=>$roleid));
- $a->rolename = '"'.format_string($rolename).'"';
+ $role = $DB->get_record('role', array('id'=>$roleid));
+ $a->rolename = '"'.role_get_name($role).'"';
} else {
$a->rolename = get_string('anyrole', 'filters');
}
View
5 user/filters/globalrole.php
@@ -78,11 +78,12 @@ function get_sql_filter($data) {
function get_label($data) {
global $DB;
- $rolename = $DB->get_field('role', 'name', array('id'=>$data['value']));
+ $role = $DB->get_record('role', array('id'=>$data['value']));
+
$a = new stdClass();
$a->label = $this->_label;
- $a->value = '"'.format_string($rolename).'"';
+ $a->value = '"'.role_get_name($role).'"';
return get_string('globalrolelabel', 'filters', $a);
}
Please sign in to comment.
Something went wrong with that request. Please try again.