|
|
@ -406,10 +406,10 @@ switch ($action) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'get_usergroups_teacher': |
|
|
|
case 'get_usergroups_teacher': |
|
|
|
$columns = array('name', 'users', 'actions'); |
|
|
|
$columns = array('name', 'users', 'actions'); |
|
|
|
$options = array('order'=>"name $sord", 'LIMIT'=> "$start , $limit"); |
|
|
|
$options = array('order'=>"name $sord", 'LIMIT'=> "$start , $limit"); |
|
|
|
switch ($type) { |
|
|
|
switch ($type) { |
|
|
|
case 'not_registered': |
|
|
|
case 'not_registered': |
|
|
|
$options['where'] = array(" (course_id IS NULL OR course_id != ?) " => $course_id); |
|
|
|
$options['course_id'] = $course_id; |
|
|
|
$result = $obj->get_usergroup_not_in_course($options); |
|
|
|
$result = $obj->get_usergroup_not_in_course($options); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'registered': |
|
|
|
case 'registered': |
|
|
@ -419,7 +419,7 @@ switch ($action) { |
|
|
|
} |
|
|
|
} |
|
|
|
$new_result = array(); |
|
|
|
$new_result = array(); |
|
|
|
if (!empty($result)) { |
|
|
|
if (!empty($result)) { |
|
|
|
foreach ($result as $group) { |
|
|
|
foreach ($result as $group) { |
|
|
|
$group['users'] = count($obj->get_users_by_usergroup($group['id'])); |
|
|
|
$group['users'] = count($obj->get_users_by_usergroup($group['id'])); |
|
|
|
if ($obj->usergroup_was_added_in_course($group['id'], $course_id)) { |
|
|
|
if ($obj->usergroup_was_added_in_course($group['id'], $course_id)) { |
|
|
|
$url = 'class.php?action=remove_class_from_course&id='.$group['id']; |
|
|
|
$url = 'class.php?action=remove_class_from_course&id='.$group['id']; |
|
|
|