Skip to content

Commit

Permalink
Merge branch 'MDL-41305-master' of git://github.com/FMCorz/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Sep 10, 2013
2 parents d184f9b + 5995717 commit 89cb942
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
56 changes: 29 additions & 27 deletions group/autogroup_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,30 @@ function definition() {

$mform =& $this->_form;

$mform->addElement('header', 'autogroup', get_string('autocreategroups', 'group'));
$mform->addElement('header', 'autogroup', get_string('general'));

$mform->addElement('text', 'namingscheme', get_string('namingscheme', 'group'));
$mform->addHelpButton('namingscheme', 'namingscheme', 'group');
$mform->addRule('namingscheme', get_string('required'), 'required', null, 'client');
$mform->setType('namingscheme', PARAM_TEXT);
// There must not be duplicate group names in course.
$template = get_string('grouptemplate', 'group');
$gname = groups_parse_name($template, 0);
if (!groups_get_group_by_name($COURSE->id, $gname)) {
$mform->setDefault('namingscheme', $template);
}

$options = array('groups' => get_string('numgroups', 'group'),
'members' => get_string('nummembers', 'group'));
$mform->addElement('select', 'groupby', get_string('groupby', 'group'), $options);

$mform->addElement('text', 'number', get_string('number', 'group'),'maxlength="4" size="4"');
$mform->setType('number', PARAM_INT);
$mform->addRule('number', null, 'numeric', null, 'client');
$mform->addRule('number', get_string('required'), 'required', null, 'client');

$mform->addElement('header', 'groupmembershdr', get_string('groupmembers', 'group'));
$mform->setExpanded('groupmembershdr', true);

$options = array(0=>get_string('all'));
$options += $this->_customdata['roles'];
Expand Down Expand Up @@ -76,41 +99,20 @@ function definition() {
$mform->setType('cohortid', PARAM_INT);
$mform->setConstant('cohortid', '0');
}

$options = array('groups' => get_string('numgroups', 'group'),
'members' => get_string('nummembers', 'group'));
$mform->addElement('select', 'groupby', get_string('groupby', 'group'), $options);

$mform->addElement('text', 'number', get_string('number', 'group'),'maxlength="4" size="4"');
$mform->setType('number', PARAM_INT);
$mform->addRule('number', null, 'numeric', null, 'client');
$mform->addRule('number', get_string('required'), 'required', null, 'client');

$mform->addElement('checkbox', 'nosmallgroups', get_string('nosmallgroups', 'group'));
$mform->disabledIf('nosmallgroups', 'groupby', 'noteq', 'members');
$mform->setAdvanced('nosmallgroups');

$options = array('no' => get_string('noallocation', 'group'),
'random' => get_string('random', 'group'),
'firstname' => get_string('byfirstname', 'group'),
'lastname' => get_string('bylastname', 'group'),
'idnumber' => get_string('byidnumber', 'group'));
$mform->addElement('select', 'allocateby', get_string('allocateby', 'group'), $options);
$mform->setDefault('allocateby', 'random');
$mform->setAdvanced('allocateby');

$mform->addElement('text', 'namingscheme', get_string('namingscheme', 'group'));
$mform->addHelpButton('namingscheme', 'namingscheme', 'group');
$mform->addRule('namingscheme', get_string('required'), 'required', null, 'client');
$mform->setType('namingscheme', PARAM_TEXT);
// there must not be duplicate group names in course
$template = get_string('grouptemplate', 'group');
$gname = groups_parse_name($template, 0);
if (!groups_get_group_by_name($COURSE->id, $gname)) {
$mform->setDefault('namingscheme', $template);
}
$mform->addElement('checkbox', 'nosmallgroups', get_string('nosmallgroups', 'group'));
$mform->disabledIf('nosmallgroups', 'groupby', 'noteq', 'members');

$mform->addElement('header', 'groupinghdr', get_string('grouping', 'group'));

$options = array('0' => get_string('no'),
$options = array('0' => get_string('nogrouping', 'group'),
'-1'=> get_string('newgrouping', 'group'));
if ($groupings = groups_get_all_groupings($COURSE->id)) {
foreach ($groupings as $grouping) {
Expand Down
1 change: 0 additions & 1 deletion group/group_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ function definition () {
$mform->addElement('text','idnumber', get_string('idnumbergroup'), 'maxlength="100" size="10"');
$mform->addHelpButton('idnumber', 'idnumbergroup');
$mform->setType('idnumber', PARAM_RAW);
$mform->setAdvanced('idnumber');
if (!has_capability('moodle/course:changeidnumber', $coursecontext)) {
$mform->hardFreeze('idnumber');
}
Expand Down
1 change: 0 additions & 1 deletion group/grouping_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function definition () {
$mform->addElement('text','idnumber', get_string('idnumbergrouping'), 'maxlength="100" size="10"');
$mform->addHelpButton('idnumber', 'idnumbergrouping');
$mform->setType('idnumber', PARAM_RAW);
$mform->setAdvanced('idnumber');
if (!has_capability('moodle/course:changeidnumber', $coursecontext)) {
$mform->hardFreeze('idnumber');
}
Expand Down
2 changes: 1 addition & 1 deletion group/import_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function definition() {

//fill in the data depending on page params
//later using set_data
$mform->addElement('header', 'general');
$mform->addElement('header', 'general', get_string('general'));

$filepickeroptions = array();
$filepickeroptions['filetypes'] = '*';
Expand Down
7 changes: 4 additions & 3 deletions lang/en/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$string['creategroup'] = 'Create group';
$string['creategrouping'] = 'Create grouping';
$string['creategroupinselectedgrouping'] = 'Create group in grouping';
$string['createingrouping'] = 'Create in grouping';
$string['createingrouping'] = 'Grouping of auto-created groups';
$string['createorphangroup'] = 'Create orphan group';
$string['databaseupgradegroups'] = 'Groups version is now {$a}';
$string['defaultgrouping'] = 'Default grouping';
Expand Down Expand Up @@ -80,7 +80,7 @@
$string['group'] = 'Group';
$string['groupaddedsuccesfully'] = 'Group {$a} added successfully';
$string['groupaddedtogroupingsuccesfully'] = 'Group {$a->groupname} added to grouping {$a->groupingname} successfully';
$string['groupby'] = 'Specify';
$string['groupby'] = 'Auto create based on';
$string['groupdescription'] = 'Group description';
$string['groupinfo'] = 'Info about selected group';
$string['groupinfomembers'] = 'Info about selected members';
Expand Down Expand Up @@ -149,6 +149,7 @@
$string['newpicture'] = 'New picture';
$string['newpicture_help'] = 'Select an image in JPG or PNG format. The image will be cropped to a square and resized to 100x100 pixels.';
$string['noallocation'] = 'No allocation';
$string['nogrouping'] = 'No grouping';
$string['nogroups'] = 'There are no groups set up in this course yet';
$string['nogroupsassigned'] = 'No groups assigned';
$string['nopermissionforcreation'] = 'Can\'t create group "{$a}" as you don\'t have the required permissions';
Expand All @@ -169,7 +170,7 @@
$string['removegroupingsmembers'] = 'Remove all groups from groupings';
$string['removegroupsmembers'] = 'Remove all group members';
$string['removeselectedusers'] = 'Remove selected users';
$string['selectfromrole'] = 'Select members from role';
$string['selectfromrole'] = 'Select members with role';
$string['showgroupsingrouping'] = 'Show groups in grouping';
$string['showmembersforgroup'] = 'Show members for group';
$string['toomanygroups'] = 'Insufficient users to populate this number of groups - there are only {$a} users in the selected role.';
Expand Down

0 comments on commit 89cb942

Please sign in to comment.