Skip to content

Commit

Permalink
MDL-25708 recordsets - fix group dir uses
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jan 25, 2011
1 parent a0c3fc6 commit fc5016f
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,25 @@
WHERE g.courseid = :courseid $groupwhere $groupingwhere
ORDER BY g.name, u.lastname, u.firstname";

if ($rs = $DB->get_recordset_sql($sql, $params)) {
foreach ($rs as $row) {
$user = new stdClass();
$user->id = $row->userid;
$user->firstname = $row->firstname;
$user->lastname = $row->lastname;
$user->username = $row->username;
$user->idnumber = $row->idnumber;
if (!$row->groupingid) {
$row->groupingid = -1;
}
if (!array_key_exists($row->groupid, $members[$row->groupingid])) {
$members[$row->groupingid][$row->groupid] = array();
}
if(isset($user->id)){
$members[$row->groupingid][$row->groupid][] = $user;
}
$rs = $DB->get_recordset_sql($sql, $params);
foreach ($rs as $row) {
$user = new stdClass();
$user->id = $row->userid;
$user->firstname = $row->firstname;
$user->lastname = $row->lastname;
$user->username = $row->username;
$user->idnumber = $row->idnumber;
if (!$row->groupingid) {
$row->groupingid = -1;
}
if (!array_key_exists($row->groupid, $members[$row->groupingid])) {
$members[$row->groupingid][$row->groupid] = array();
}
if(isset($user->id)){
$members[$row->groupingid][$row->groupid][] = $user;
}
$rs->close();
}
$rs->close();

navigation_node::override_active_url(new moodle_url('/group/index.php', array('id'=>$courseid)));
$PAGE->navbar->add(get_string('overview', 'group'));
Expand Down

0 comments on commit fc5016f

Please sign in to comment.