mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-25708 recordsets - tag and user directory
This commit is contained in:
parent
cfd62f13a1
commit
cd5fdfd87a
15
tag/lib.php
15
tag/lib.php
@ -409,16 +409,15 @@ function tag_get_id($tags, $return_value=null) {
|
||||
|
||||
list($tag_string, $params) = $DB->get_in_or_equal($tags);
|
||||
|
||||
if ($rs = $DB->get_recordset_sql("SELECT * FROM {tag} WHERE name $tag_string ORDER BY name", $params)) {
|
||||
foreach ($rs as $record) {
|
||||
if ($return_value == TAG_RETURN_OBJECT) {
|
||||
$result[$record->name] = $record;
|
||||
} else { // TAG_RETURN_ARRAY
|
||||
$result[$record->name] = $record->id;
|
||||
}
|
||||
$rs = $DB->get_recordset_sql("SELECT * FROM {tag} WHERE name $tag_string ORDER BY name", $params);
|
||||
foreach ($rs as $record) {
|
||||
if ($return_value == TAG_RETURN_OBJECT) {
|
||||
$result[$record->name] = $record;
|
||||
} else { // TAG_RETURN_ARRAY
|
||||
$result[$record->name] = $record->id;
|
||||
}
|
||||
$rs->close();
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
if ($return_an_int) {
|
||||
return array_pop($result);
|
||||
|
@ -763,12 +763,11 @@ class group_non_members_selector extends groups_user_selector_base {
|
||||
JOIN {groups} g ON gm.groupid = g.id
|
||||
WHERE u.id $membersidsclause AND g.courseid = :courseid ";
|
||||
$params['courseid'] = $courseid;
|
||||
if ($rs = $DB->get_recordset_sql($sql, $params)) {
|
||||
foreach ($rs as $usergroup) {
|
||||
$usergroups[$usergroup->userid][$usergroup->id] = $usergroup;
|
||||
}
|
||||
$rs->close();
|
||||
$rs = $DB->get_recordset_sql($sql, $params);
|
||||
foreach ($rs as $usergroup) {
|
||||
$usergroups[$usergroup->userid][$usergroup->id] = $usergroup;
|
||||
}
|
||||
$rs->close();
|
||||
|
||||
foreach ($potentialmembersids as $userid) {
|
||||
if (isset($usergroups[$userid])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user