mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-9038: Groups can now be created outside of any groupings. The number of groups within [Not in a grouping] is also correct now.
This commit is contained in:
parent
96c50eddd7
commit
4b3b962514
@ -68,17 +68,29 @@ if ($success) {
|
||||
}
|
||||
elseif (isset($frm->update)) {
|
||||
if (! $groupid) { //OK, new group.
|
||||
// Allow groups to be created outside of groupings
|
||||
/*
|
||||
if (GROUP_NOT_IN_GROUPING == $groupingid) {
|
||||
print_error('errornotingrouping', 'group', groups_home_url($courseid), get_string('notingrouping', 'group'));
|
||||
}
|
||||
*/
|
||||
$success = (bool)$groupid = groups_create_group($courseid); //$groupsettings);
|
||||
$success = groups_add_group_to_grouping($groupid, $groupingid);
|
||||
|
||||
if ($groupingid != GROUP_NOT_IN_GROUPING) {
|
||||
$success = groups_add_group_to_grouping($groupid, $groupingid);
|
||||
}
|
||||
}
|
||||
elseif ($groupingid != $newgrouping) { //OK, move group.
|
||||
// Allow groups to be created outside of groupings
|
||||
/*
|
||||
if (GROUP_NOT_IN_GROUPING == $newgrouping) {
|
||||
print_error('errornotingrouping', 'group', groups_home_url($courseid), get_string('notingrouping', 'group'));
|
||||
}
|
||||
$success = $success && groups_remove_group_from_grouping($groupid, $groupingid);
|
||||
*/
|
||||
if ($groupingid != GROUP_NOT_IN_GROUPING) {
|
||||
$success = $success && groups_remove_group_from_grouping($groupid, $groupingid);
|
||||
}
|
||||
|
||||
$success = $success && groups_add_group_to_grouping($groupid, $newgrouping);
|
||||
}
|
||||
if ($success) {
|
||||
|
@ -115,9 +115,12 @@ if ($success) {
|
||||
case 'removegroup':
|
||||
break;
|
||||
case 'showcreategroupform':
|
||||
// Allow groups to be created outside of groupings
|
||||
/*
|
||||
if (GROUP_NOT_IN_GROUPING == $groupingid) {
|
||||
print_error('errornotingrouping', 'group', groups_home_url($courseid), get_string('notingrouping', 'group'));
|
||||
}
|
||||
*/
|
||||
redirect(groups_group_edit_url($courseid, null, $groupingid, false));
|
||||
break;
|
||||
case 'addgroupstogroupingform':
|
||||
|
Loading…
x
Reference in New Issue
Block a user