mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-40424-master' of git://github.com/FMCorz/moodle
Conflicts: admin/oacleanup.php
This commit is contained in:
commit
fb1788c598
18 changed files with 105 additions and 46 deletions
|
@ -276,7 +276,9 @@ function enrol_get_shared_courses($user1, $user2, $preloadcontexts = false, $che
|
|||
$ctxselect = '';
|
||||
$ctxjoin = '';
|
||||
if ($preloadcontexts) {
|
||||
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
$ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
|
||||
$ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)";
|
||||
$params['contextlevel'] = CONTEXT_COURSE;
|
||||
}
|
||||
|
||||
$sql = "SELECT c.* $ctxselect
|
||||
|
@ -572,7 +574,9 @@ function enrol_get_my_courses($fields = NULL, $sort = 'visible DESC,sortorder AS
|
|||
}
|
||||
|
||||
$coursefields = 'c.' .join(',c.', $fields);
|
||||
list($ccselect, $ccjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
$ccselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
|
||||
$ccjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)";
|
||||
$params['contextlevel'] = CONTEXT_COURSE;
|
||||
$wheres = implode(" AND ", $wheres);
|
||||
|
||||
//note: we can not use DISTINCT + text fields due to Oracle and MS limitations, that is why we have the subselect there
|
||||
|
@ -830,7 +834,9 @@ function enrol_get_all_users_courses($userid, $onlyactive = false, $fields = NUL
|
|||
}
|
||||
|
||||
$coursefields = 'c.' .join(',c.', $fields);
|
||||
list($ccselect, $ccjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
$ccselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
|
||||
$ccjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)";
|
||||
$params['contextlevel'] = CONTEXT_COURSE;
|
||||
|
||||
//note: we can not use DISTINCT + text fields due to Oracle and MS limitations, that is why we have the subselect there
|
||||
$sql = "SELECT $coursefields $ccselect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue