Commit 1f558cf9 authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Francois Marier
Browse files

When group type changes from course to standard, demote tutors to members


Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent b139f7cb
......@@ -168,6 +168,11 @@ function editgroup_submit(Pieform $form, $values) {
delete_records('group_member_request', 'group', $group_data->id);
}
}
// When group type changes from course to standard, make sure that tutors
// are demoted to members.
if ($group_data->grouptype == 'course' && $grouptype != 'course') {
set_field('group_member', 'role', 'member', 'group', $values['id'], 'role', 'tutor');
}
$SESSION->add_ok_msg(get_string('groupsaved', 'group'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment