Serve session courses info according to courses info - refs #7402

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 9a09260bd0
commit 74b174ff3d
  1. 13
      main/inc/lib/webservices/Rest.php

@ -883,21 +883,24 @@ class Rest extends WebService
foreach ($sessions['courses'] as $course) {
$courseInfo = api_get_course_info_by_id($course['real_id']);
$teachers = SessionManager::getCoachesByCourseSessionToString(
$sessions['session_id'],
$course['real_id']
);
$sessionCourses[] = [
'visibility' => $course['visibility'],
'status' => $course['status'],
'id' => $courseInfo['real_id'],
'title' => $courseInfo['title'],
'code' => $courseInfo['code'],
'directory' => $courseInfo['directory'],
'pictureUrl' => $courseInfo['course_image_large']
'pictureUrl' => $courseInfo['course_image_large'],
'teachers' => $teachers
];
}
$categorySessions[] = [
'session_name' => $sessions['session_name'],
'session_id' => $sessions['session_id'],
'name' => $sessions['session_name'],
'id' => $sessions['session_id'],
'accessStartDate' => api_format_date($sessions['access_start_date'], DATE_TIME_FORMAT_SHORT),
'accessEndDate' => api_format_date($sessions['access_end_date'], DATE_TIME_FORMAT_SHORT),
'courses' => $sessionCourses

Loading…
Cancel
Save