From 9a2455a17e575a9dacca6670986a3c4d95e6f394 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 18 May 2017 10:14:06 +0200 Subject: [PATCH] Add multiple URL support when showing session list see BT#12776 --- main/inc/lib/sessionmanager.lib.php | 16 ++++++++++++++-- main/tracking/courseLog.php | 7 ++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 59e7a06546..a1ede36847 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -4293,11 +4293,23 @@ class SessionManager { $table_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); $table_session = Database::get_main_table(TABLE_MAIN_SESSION); + $url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); $courseId = intval($courseId); + $urlId = api_get_current_access_url_id(); + + if (empty($courseId)) { + return []; + } + $sql = "SELECT name, s.id FROM $table_session_course sc - INNER JOIN $table_session s ON (sc.session_id = s.id) - WHERE sc.c_id = '$courseId' "; + INNER JOIN $table_session s + 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); return Database::store_result($result); diff --git a/main/tracking/courseLog.php b/main/tracking/courseLog.php index 419965b3d0..7cecb18b1b 100755 --- a/main/tracking/courseLog.php +++ b/main/tracking/courseLog.php @@ -306,16 +306,17 @@ if (!empty($coaches)) { $sessionList = SessionManager::get_session_by_course($courseInfo['real_id']); if (!empty($sessionList)) { $html .= Display::page_subheader2(get_lang('SessionList')); - $iconCourse = Display::return_icon( - 'course.png', + $icon = Display::return_icon( + 'session.png', null, null, ICON_SIZE_TINY ); + $html .= ''; }