mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-35775-master' of git://github.com/micaherne/moodle
This commit is contained in:
commit
91d5e08aa3
@ -82,7 +82,8 @@ if ($mform_post->is_cancelled()) {
|
||||
"idnumber" => 1,
|
||||
"groupidnumber" => 1,
|
||||
"description" => 1,
|
||||
"enrolmentkey" => 1);
|
||||
"enrolmentkey" => 1,
|
||||
"groupingname" => 1);
|
||||
|
||||
// --- get header (field names) ---
|
||||
$header = explode($csv_delimiter, array_shift($rawlines));
|
||||
@ -187,10 +188,37 @@ if ($mform_post->is_cancelled()) {
|
||||
}
|
||||
if ($groupid = groups_get_group_by_name($newgroup->courseid, $groupname)) {
|
||||
echo $OUTPUT->notification("$groupname :".get_string('groupexistforcourse', 'error', $groupname));
|
||||
} else if (groups_create_group($newgroup)) {
|
||||
} else if ($groupid = groups_create_group($newgroup)) {
|
||||
echo $OUTPUT->notification(get_string('groupaddedsuccesfully', 'group', $groupname), 'notifysuccess');
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('groupnotaddederror', 'error', $groupname));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add group to grouping
|
||||
if (isset($newgroup->groupingname)) {
|
||||
$groupingname = $newgroup->groupingname;
|
||||
if (! $groupingid = groups_get_grouping_by_name($newgroup->courseid, $groupingname)) {
|
||||
$data = new stdClass();
|
||||
$data->courseid = $newgroup->courseid;
|
||||
$data->name = $groupingname;
|
||||
if ($groupingid = groups_create_grouping($data)) {
|
||||
echo $OUTPUT->notification(get_string('groupingaddedsuccesfully', 'group', $groupname), 'notifysuccess');
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('groupingnotaddederror', 'error', $groupname));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// if we have reached here we definitely have a groupingid
|
||||
$a = array('groupname' => $groupname, 'groupingname' => $groupingname);
|
||||
try {
|
||||
groups_assign_grouping($groupingid, $groupid);
|
||||
echo $OUTPUT->notification(get_string('groupaddedtogroupingsuccesfully', 'group', $a), 'notifysuccess');
|
||||
} catch (Exception $e) {
|
||||
echo $OUTPUT->notification(get_string('groupnotaddedtogroupingerror', 'error', $a));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,6 +246,8 @@ $string['groupexistforcoursewithidnumber'] = '{$a->problemgroup}: Group "{$a->na
|
||||
$string['grouphasidnumber'] = 'Group "{$a}" has an idnumber and may have been automatically created by an external system. You do not have permission to remove this group.';
|
||||
$string['groupinghasidnumber'] = 'Grouping "{$a}" has an idnumber and may have been automatically created by an external system. You do not have permission to remove this grouping.';
|
||||
$string['groupnotaddederror'] = 'Group "{$a}" not added';
|
||||
$string['groupnotaddedtogroupingerror'] = 'Group "{$a->groupname}" not added to grouping "{$a->groupingname}"';
|
||||
$string['groupingnotaddederror'] = 'Grouping "{$a}" not added';
|
||||
$string['groupunknown'] = 'Group {$a} not associated to specified course';
|
||||
$string['groupusernotmember'] = 'User is not member of this group.';
|
||||
$string['guestnocomment'] = 'Guests are not allowed to post comments!';
|
||||
|
@ -71,12 +71,14 @@ $string['existingmembers'] = 'Existing members: {$a}';
|
||||
$string['filtergroups'] = 'Filter groups by:';
|
||||
$string['group'] = 'Group';
|
||||
$string['groupaddedsuccesfully'] = 'Group {$a} added successfully';
|
||||
$string['groupaddedtogroupingsuccesfully'] = 'Group {$a->groupname} added to grouping {$a->groupingname} successfully';
|
||||
$string['groupby'] = 'Specify';
|
||||
$string['groupdescription'] = 'Group description';
|
||||
$string['groupinfo'] = 'Info about selected group';
|
||||
$string['groupinfomembers'] = 'Info about selected members';
|
||||
$string['groupinfopeople'] = 'Info about selected people';
|
||||
$string['grouping'] = 'Grouping';
|
||||
$string['groupingaddedsuccesfully'] = 'Grouping {$a} added successfully';
|
||||
$string['grouping_help'] = 'A grouping is a collection of groups within a course. If a grouping is selected, students assigned to groups within the grouping will be able to work together.';
|
||||
$string['groupingsection'] = 'Grouping access';
|
||||
$string['groupingsection_help'] = 'A grouping is a collection of groups within a course. If a grouping is selected here, only students assigned to groups within this grouping will have access to the section.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user