Add 'Assigned Courses' info row - refs #7296

1.9.x
Imanol Losada 11 years ago
parent 078b0f847a
commit f95a57b4b9
  1. 2
      main/inc/lib/course.lib.php
  2. 13
      main/inc/lib/tracking.lib.php
  3. 1
      main/lang/english/tracking.inc.php
  4. 1
      main/lang/spanish/tracking.inc.php
  5. 10
      main/mySpace/index.php

@ -3204,6 +3204,8 @@ class CourseManager
$whereConditions .= " AND cru.user_id = '$user_id'";
if (!$showAllAssignedCourses) {
$whereConditions .= " AND status = ".COURSEMANAGER;
} else {
$whereConditions .= " AND relation_type = '1'";
}
break;
case DRH:

@ -24,6 +24,7 @@ class Tracking
*/
public static function getStats($userId)
{
$assignedCourses = array();
if (api_is_drh() && api_drh_can_access_all_session_content()) {
$studentList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus(
'drh_all',
@ -175,6 +176,15 @@ class Tracking
null,
true
);
foreach ($platformCourses as $course) {
$assignedCourses[$course['code']] = $course['code'];
}
$platformCourses = CourseManager::getCoursesFollowedByUser(
$userId,
COURSEMANAGER
);
foreach ($platformCourses as $course) {
$courses[$course['code']] = $course['code'];
}
@ -190,7 +200,8 @@ class Tracking
'teachers' => $teachers,
'students' => $students,
'courses' => $courses,
'sessions' => $sessions
'sessions' => $sessions,
'assignedCourses' => $assignedCourses
);
}

@ -2,6 +2,7 @@
/*
for more information: see languages.txt in the lang folder.
*/
$AssignedCourses = "Assigned courses";
$SleepingStudents = "Students with no activity during the last few days";
$SleepingTeachers = "Teachers with no activity in the last few days";
$InactiveUsers = "Users who's account has been disabled";

@ -2,6 +2,7 @@
/*
for more information: see languages.txt in the lang folder.
*/
$AssignedCourses = "Cursos asignados";
$SleepingStudents = "Alumnos inactivos desde unos días";
$SleepingTeachers = "Docentes inactivos desde algunos días";
$InactiveUsers = "Usuarios desactivados";

@ -160,6 +160,7 @@ $stats = Tracking::getStats($userId);
$students = $stats['students'];
$teachers = $stats['teachers'];
$humanResourcesUsers = $stats['drh'];
$assignedCourses = $stats['assignedCourses'];
$courses = $stats['courses'];
$sessions = $stats['sessions'];
@ -171,6 +172,7 @@ if (!empty($sessions)) {
}
// Courses for the user
$countAssignedCourses = count($assignedCourses);
$count_courses = count($courses);
// Sessions for the user
@ -274,6 +276,14 @@ echo '<div class="report_section">
'</td>
<td align="right">'.($nb_students + $numberTeachers + $countHumanResourcesUsers).$linkAddUser.'</td>
</tr>
<tr>
<td>'.Display::url(
get_lang('AssignedCourses'),
api_get_path(WEB_CODE_PATH).'mySpace/course.php'
).
'</td>
<td align="right">'.$countAssignedCourses.$linkAddCourse.'</td>
</tr>
<tr>
<td>'.Display::url(
get_lang('FollowedCourses'),

Loading…
Cancel
Save