Add multiple URL support when showing session list see BT#12776

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent c1daf3f569
commit 9a2455a17e
  1. 16
      main/inc/lib/sessionmanager.lib.php
  2. 7
      main/tracking/courseLog.php

@ -4293,11 +4293,23 @@ class SessionManager
{ {
$table_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); $table_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$table_session = Database::get_main_table(TABLE_MAIN_SESSION); $table_session = Database::get_main_table(TABLE_MAIN_SESSION);
$url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$courseId = intval($courseId); $courseId = intval($courseId);
$urlId = api_get_current_access_url_id();
if (empty($courseId)) {
return [];
}
$sql = "SELECT name, s.id $sql = "SELECT name, s.id
FROM $table_session_course sc FROM $table_session_course sc
INNER JOIN $table_session s ON (sc.session_id = s.id) INNER JOIN $table_session s
WHERE sc.c_id = '$courseId' "; ON (sc.session_id = s.id)
INNER JOIN $url u
ON (u.session_id = s.id)
WHERE
u.access_url_id = $urlId AND
sc.c_id = '$courseId' ";
$result = Database::query($sql); $result = Database::query($sql);
return Database::store_result($result); return Database::store_result($result);

@ -306,16 +306,17 @@ if (!empty($coaches)) {
$sessionList = SessionManager::get_session_by_course($courseInfo['real_id']); $sessionList = SessionManager::get_session_by_course($courseInfo['real_id']);
if (!empty($sessionList)) { if (!empty($sessionList)) {
$html .= Display::page_subheader2(get_lang('SessionList')); $html .= Display::page_subheader2(get_lang('SessionList'));
$iconCourse = Display::return_icon( $icon = Display::return_icon(
'course.png', 'session.png',
null, null,
null, null,
ICON_SIZE_TINY ICON_SIZE_TINY
); );
$html .= '<ul class="session-list">'; $html .= '<ul class="session-list">';
foreach ($sessionList as $session) { foreach ($sessionList as $session) {
$url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code']; $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
$html .= Display::tag('li', $iconCourse.' '.Display::url($session['name'], $url)); $html .= Display::tag('li', $icon.' '.Display::url($session['name'], $url));
} }
$html .= '</ul>'; $html .= '</ul>';
} }

Loading…
Cancel
Save