Display classes not in a course -ref #5619

skala
Hubert Borderiou 12 years ago
parent 7cfeb1caed
commit 180ecaa6d0
  1. 2
      main/inc/ajax/model.ajax.php
  2. 5
      main/inc/lib/usergroup.lib.php

@ -409,7 +409,7 @@ switch ($action) {
$options = array('order'=>"name $sord", 'LIMIT'=> "$start , $limit");
switch ($type) {
case 'not_registered':
$options['where'] = array(" course_id != ? " => $course_id);
$options['where'] = array(" (course_id IS NULL OR course_id != ?) " => $course_id);
$result = $obj->get_usergroup_not_in_course($options);
break;
case 'registered':

@ -93,8 +93,9 @@ class UserGroup extends Model {
}
public function get_usergroup_not_in_course($options = array()) {
$sql = "SELECT * FROM {$this->usergroup_rel_course_table} urc
JOIN {$this->table} u
$sql = "SELECT DISTINCT *
FROM {$this->usergroup_rel_course_table} urc
RIGHT JOIN {$this->table} u
ON (u.id = urc.usergroup_id)
";
$conditions = Database::parse_conditions($options);

Loading…
Cancel
Save