mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-41605 Enrolments: Updated unassign role url to use roleid as param
Filter on enrolled users page use role param to perform filtering by role, and unassign role also contain role param to remove user role in course which used to conflict. Looking at assign role, we use roleid param, so using roleid for unassigning as well
This commit is contained in:
parent
ee788142f2
commit
cc6a0dd095
@ -193,7 +193,7 @@ class core_enrol_renderer extends plugin_renderer_base {
|
||||
if ($canassign and (is_siteadmin() or isset($assignableroles[$roleid])) and !$role['unchangeable']) {
|
||||
$strunassign = get_string('unassignarole', 'role', $role['text']);
|
||||
$icon = html_writer::empty_tag('img', array('alt'=>$strunassign, 'src'=>$iconenrolremove));
|
||||
$url = new moodle_url($pageurl, array('action'=>'unassign', 'role'=>$roleid, 'user'=>$userid));
|
||||
$url = new moodle_url($pageurl, array('action'=>'unassign', 'roleid'=>$roleid, 'user'=>$userid));
|
||||
$rolesoutput .= html_writer::tag('div', $role['text'] . html_writer::link($url, $icon, array('class'=>'unassignrolelink', 'rel'=>$roleid, 'title'=>$strunassign)), array('class'=>'role role_'.$roleid));
|
||||
} else {
|
||||
$rolesoutput .= html_writer::tag('div', $role['text'], array('class'=>'role unchangeable', 'rel'=>$roleid));
|
||||
|
@ -75,7 +75,7 @@ if ($action) {
|
||||
*/
|
||||
case 'unassign':
|
||||
if (has_capability('moodle/role:assign', $manager->get_context())) {
|
||||
$role = required_param('role', PARAM_INT);
|
||||
$role = required_param('roleid', PARAM_INT);
|
||||
$user = required_param('user', PARAM_INT);
|
||||
if ($confirm && $manager->unassign_role_from_user($user, $role)) {
|
||||
redirect($PAGE->url);
|
||||
@ -83,7 +83,7 @@ if ($action) {
|
||||
$user = $DB->get_record('user', array('id'=>$user), '*', MUST_EXIST);
|
||||
$allroles = $manager->get_all_roles();
|
||||
$role = $allroles[$role];
|
||||
$yesurl = new moodle_url($PAGE->url, array('action'=>'unassign', 'role'=>$role->id, 'user'=>$user->id, 'confirm'=>1, 'sesskey'=>sesskey()));
|
||||
$yesurl = new moodle_url($PAGE->url, array('action'=>'unassign', 'roleid'=>$role->id, 'user'=>$user->id, 'confirm'=>1, 'sesskey'=>sesskey()));
|
||||
$message = get_string('unassignconfirm', 'role', array('user'=>fullname($user, true), 'role'=>$role->localname));
|
||||
$pagetitle = get_string('unassignarole', 'role', $role->localname);
|
||||
$pagecontent = $OUTPUT->confirm($message, $yesurl, $PAGE->url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user