Replacing title with a link.

1.9.x
Julio Montoya 11 years ago
parent b4d38d9d1f
commit 42c3c2bca0
  1. 12
      main/mySpace/course.php

@ -181,7 +181,7 @@ function get_count_courses()
function get_courses($from, $limit, $column, $direction) function get_courses($from, $limit, $column, $direction)
{ {
$userId = api_get_user_id(); $userId = api_get_user_id();
$sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : null; $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : null; $keyword = isset($_GET['keyword']) ? $_GET['keyword'] : null;
$drhLoaded = false; $drhLoaded = false;
@ -218,6 +218,7 @@ function get_courses($from, $limit, $column, $direction)
if (!empty($courses)) { if (!empty($courses)) {
foreach ($courses as $data) { foreach ($courses as $data) {
$courseCode = $data['code']; $courseCode = $data['code'];
$courseInfo = api_get_course_info($courseCode);
$userList = CourseManager::get_user_list_from_course_code($data['code'], $sessionId); $userList = CourseManager::get_user_list_from_course_code($data['code'], $sessionId);
$userIdList = array(); $userIdList = array();
if (!empty($userList)) { if (!empty($userList)) {
@ -258,9 +259,12 @@ function get_courses($from, $limit, $column, $direction)
$courseIcon = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?cidReq='.$courseCode.'&id_session='.$sessionId.'"> $courseIcon = '<a href="'.api_get_path(WEB_CODE_PATH).'tracking/courseLog.php?cidReq='.$courseCode.'&id_session='.$sessionId.'">
<img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /> <img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" />
</a>'; </a>';
$title = Display::url(
$courseList[] = array(
$data['title'], $data['title'],
$courseInfo['course_public_url'].'?id_session='.$sessionId
);
$courseList[] = array(
$title,
$countStudents, $countStudents,
is_null($avgTimeSpentInCourse) ? '-' : $avgTimeSpentInCourse, is_null($avgTimeSpentInCourse) ? '-' : $avgTimeSpentInCourse,
$tematicAdvanceProgress, $tematicAdvanceProgress,
@ -285,8 +289,6 @@ $table = new SortableTable(
10 10
); );
$table->set_header(0, get_lang('CourseTitle'), false); $table->set_header(0, get_lang('CourseTitle'), false);
$table->set_header(1, get_lang('NbStudents'), false); $table->set_header(1, get_lang('NbStudents'), false);
$table->set_header(2, get_lang('TimeSpentInTheCourse').Display :: return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false); $table->set_header(2, get_lang('TimeSpentInTheCourse').Display :: return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false);

Loading…
Cancel
Save