mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Use the new get_recent_enrolments() function in datalib to find users
in recent_activity
This commit is contained in:
parent
0a08581d61
commit
6c38b7e012
1 changed files with 4 additions and 8 deletions
|
@ -234,22 +234,18 @@ function print_recent_activity($course) {
|
|||
$heading = false;
|
||||
$content = false;
|
||||
|
||||
$logs = get_records_select("log", "time > '$timestart' AND course = '$course->id' AND
|
||||
module = 'course' AND action = 'enrol'", "time ASC");
|
||||
$users = get_recent_enrolments($course->id, $timestart);
|
||||
|
||||
if ($logs) {
|
||||
foreach ($logs as $key => $log) {
|
||||
if ($users) {
|
||||
foreach ($users as $user) {
|
||||
if (! $heading) {
|
||||
print_headline(get_string("newusers").":");
|
||||
$heading = true;
|
||||
$content = true;
|
||||
}
|
||||
$user = get_record("user", "id", $log->info);
|
||||
if (isstudent($course->id, $user->id)) {
|
||||
echo "<p><font size=1><a href=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</a></font></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Next, have there been any modifications to the course structure?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue