mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
enrol MDL-19795 Upgraded deprecate function calls
This commit is contained in:
parent
928d4738f1
commit
6e08d1f1af
@ -15,7 +15,15 @@ function print_entry($course) {
|
||||
$strloginto = get_string("loginto", "", $course->shortname);
|
||||
$strcourses = get_string("courses");
|
||||
|
||||
$teacher = get_teacher($course->id);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
// Pass $view=true to filter hidden caps if the user cannot see them
|
||||
if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
|
||||
'', '', '', '', false, true)) {
|
||||
$users = sort_by_roleassignment_authority($users, $context);
|
||||
$teacher = array_shift($users);
|
||||
} else {
|
||||
$teacher = false;
|
||||
}
|
||||
|
||||
if ( (float) $course->cost < 0 ) {
|
||||
$cost = (float) $CFG->enrol_cost;
|
||||
|
@ -180,7 +180,15 @@
|
||||
message_paypal_error_to_admin("Error while trying to enrol ".fullname($user)." in '$course->fullname'", $data);
|
||||
die;
|
||||
} else {
|
||||
$teacher = get_teacher($course->id);
|
||||
// Pass $view=true to filter hidden caps if the user cannot see them
|
||||
if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC',
|
||||
'', '', '', '', false, true)) {
|
||||
$users = sort_by_roleassignment_authority($users, $context);
|
||||
$teacher = array_shift($users);
|
||||
} else {
|
||||
$teacher = false;
|
||||
}
|
||||
|
||||
|
||||
if (!empty($CFG->enrol_mailstudents)) {
|
||||
$a->coursename = $course->fullname;
|
||||
|
Loading…
x
Reference in New Issue
Block a user