MDL-22033 groupings now enabled unconditionally, groupmembersonly kept as experimental - this simplifies groups code logic a bit, user interface changes should not be significant because the groupings are not visible much until at least one created; hopefully the new description of groupmembersonly will have to preventsome gradebook complaints

This commit is contained in:
Petr Skoda 2010-04-07 07:37:12 +00:00
parent e8c2189d78
commit 98da60215e
31 changed files with 137 additions and 214 deletions

View file

@ -144,12 +144,6 @@ function groups_get_grouping($groupingid, $fields='*', $strictness=IGNORE_MISSIN
function groups_get_all_groups($courseid, $userid=0, $groupingid=0, $fields='g.*') {
global $CFG, $DB;
// groupings are ignored when not enabled
if (empty($CFG->enablegroupings)) {
$groupingid = 0;
}
if (empty($userid)) {
$userfrom = "";
$userwhere = "";
@ -238,10 +232,6 @@ function groups_get_user_groups($courseid, $userid=0) {
function groups_get_all_groupings($courseid) {
global $CFG, $DB;
// groupings are ignored when not enabled
if (empty($CFG->enablegroupings)) {
return(false);
}
return $DB->get_records_sql("SELECT *
FROM {groupings}
WHERE courseid = ?
@ -287,11 +277,6 @@ function groups_has_membership($cm, $userid=null) {
static $cache = array();
// groupings are ignored when not enabled
if (empty($CFG->enablegroupings)) {
$cm->groupingid = 0;
}
if (empty($userid)) {
$userid = $USER->id;
}
@ -521,11 +506,6 @@ function groups_print_activity_menu($cm, $urlroot, $return=false, $hideallpartic
DEBUG_DEVELOPER);
}
// groupings are ignored when not enabled
if (empty($CFG->enablegroupings)) {
$cm->groupingid = 0;
}
if (!$groupmode = groups_get_activity_groupmode($cm)) {
if ($return) {
return '';
@ -694,11 +674,6 @@ function groups_get_course_group($course, $update=false) {
function groups_get_activity_group($cm, $update=false) {
global $CFG, $USER, $SESSION;
// groupings are ignored when not enabled
if (empty($CFG->enablegroupings)) {
$cm->groupingid = 0;
}
if (!$groupmode = groups_get_activity_groupmode($cm)) {
// NOGROUPS used
return false;
@ -807,7 +782,7 @@ function groups_course_module_visible($cm, $userid=null) {
if (empty($userid)) {
$userid = $USER->id;
}
if (empty($CFG->enablegroupings)) {
if (empty($CFG->enablegroupmembersonly)) {
return true;
}
if (empty($cm->groupmembersonly)) {