@ -203,7 +203,7 @@ if ($check) {
Security::clear_token();
}
// infos about user
// user info
$user_info = api_get_user_info($student_id);
$courses_in_session = array();
@ -220,7 +220,7 @@ $courses = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_i
$courses_in_session_by_coach = array();
$sessions_coached_by_user = Tracking::get_sessions_coached_by_user(api_get_user_id());
//RRHH or session admin
// RRHH or session admin
if (api_is_session_admin() || api_is_drh()) {
$courses = CourseManager::get_courses_followed_by_drh(api_get_user_id());
@ -242,7 +242,8 @@ if (!empty($sessions_coached_by_user)) {
}
}
$sql = "SELECT course_code FROM $tbl_course_user WHERE relation_type < > ".COURSE_RELATION_TYPE_RRHH." AND user_id = ".intval($user_info['user_id']);
$sql = "SELECT course_code FROM $tbl_course_user
WHERE relation_type < > ".COURSE_RELATION_TYPE_RRHH." AND user_id = ".intval($user_info['user_id']);
$rs = Database::query($sql);
while ($row = Database :: fetch_array($rs)) {
@ -256,7 +257,8 @@ while ($row = Database :: fetch_array($rs)) {
}
// Get the list of sessions where the user is subscribed as student
$sql = 'SELECT id_session, course_code FROM ' . Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . ' WHERE id_user=' . intval($user_info['user_id']);
$sql = 'SELECT id_session, course_code FROM ' . Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . '
WHERE id_user=' . intval($user_info['user_id']);
$rs = Database::query($sql);
$tmp_sessions = array();
while ($row = Database :: fetch_array($rs)) {
@ -274,20 +276,18 @@ while ($row = Database :: fetch_array($rs)) {
}
}
/*if (empty($courses_in_session)) {
Display :: display_header($nameTools);
echo '< div class = "actions" > ';
echo '< a href = "javascript: window.back();" " > '.Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).'< / a > ';
echo '< / div > ';
Display::display_warning_message(get_lang('NoDataAvailable'));
Display::display_footer();
exit;
}*/
if (!empty($student_id)) {
if (api_drh_can_access_all_session_content()) {
$sessions = SessionManager::get_sessions_followed_by_drh($user_id);
$sessionList = array_keys($sessions);
if (!in_array($session_id, $sessionList)) {
api_not_allowed();
}
} else {
if (api_is_drh() & & !UserManager::is_user_followed_by_drh($student_id, api_get_user_id())) {
api_not_allowed();
}
}
}
Display :: display_header($nameTools);
@ -560,8 +560,8 @@ echo Display::page_subheader($table_title);
if (empty($_GET['details'])) {
$csv_content[] = array ();
$csv_content[] = array (
$csv_content[] = array();
$csv_content[] = array(
get_lang('Session', ''),
get_lang('Course', ''),
get_lang('Time', ''),