|
@@ -21,6 +21,7 @@ if (!isset($_GET['user_id'])) {
|
|
|
api_not_allowed();
|
|
|
}
|
|
|
$user = api_get_user_info($_GET['user_id'], true);
|
|
|
+$userId = $user['user_id'];
|
|
|
$tool_name = $user['complete_name'].(empty($user['official_code'])?'':' ('.$user['official_code'].')');
|
|
|
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
|
|
|
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
|
|
@@ -31,7 +32,7 @@ $editUser = null;
|
|
|
if (api_is_platform_admin()) {
|
|
|
$login_as_icon =
|
|
|
'<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_list.php'
|
|
|
- .'?action=login_as&user_id='.$user['user_id'].'&'
|
|
|
+ .'?action=login_as&user_id='.$userId.'&'
|
|
|
.'sec_token='.$_SESSION['sec_token'].'">'
|
|
|
.Display::return_icon('login_as.png', get_lang('LoginAs'),
|
|
|
array(), ICON_SIZE_MEDIUM).'</a>';
|
|
@@ -42,20 +43,20 @@ if (api_is_platform_admin()) {
|
|
|
array(),
|
|
|
ICON_SIZE_MEDIUM
|
|
|
),
|
|
|
- api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user['user_id']
|
|
|
+ api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$userId
|
|
|
);
|
|
|
|
|
|
$exportLink = Display::url(
|
|
|
Display::return_icon(
|
|
|
'export_csv.png', get_lang('ExportAsCSV'),'', ICON_SIZE_MEDIUM
|
|
|
),
|
|
|
- api_get_self().'?user_id='.$user['user_id'].'&action=export'
|
|
|
+ api_get_self().'?user_id='.$userId.'&action=export'
|
|
|
);
|
|
|
$vCardExportLink = Display::url(
|
|
|
Display::return_icon(
|
|
|
'vcard.png', get_lang('UserInfo'),'', ICON_SIZE_MEDIUM
|
|
|
),
|
|
|
- api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.$user['user_id']
|
|
|
+ api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.$userId
|
|
|
);
|
|
|
|
|
|
}
|
|
@@ -65,11 +66,10 @@ $creatorId = $user['creator_id'];
|
|
|
$creatorInfo = api_get_user_info($creatorId);
|
|
|
$registrationDate = $user['registration_date'];
|
|
|
|
|
|
-$csvContent = array();
|
|
|
-
|
|
|
$table = new HTML_Table(array('class' => 'data_table'));
|
|
|
$table->setHeaderContents(0, 0, get_lang('Information'));
|
|
|
-$csvContent[] = get_lang('Information');
|
|
|
+
|
|
|
+$csvContent[] = [get_lang('Information')];
|
|
|
$data = array(
|
|
|
get_lang('Name') => $user['complete_name'],
|
|
|
get_lang('Email') => $user['email'],
|
|
@@ -104,10 +104,10 @@ $userInformation = $table->toHtml();
|
|
|
|
|
|
$table = new HTML_Table(array('class' => 'data_table'));
|
|
|
$table->setHeaderContents(0, 0, get_lang('Tracking'));
|
|
|
-$csvContent[] = get_lang('Tracking');
|
|
|
+$csvContent[] = [get_lang('Tracking')];
|
|
|
$data = array(
|
|
|
- get_lang('FirstLogin') => Tracking :: get_first_connection_date($user['user_id']),
|
|
|
- get_lang('LatestLogin') => Tracking :: get_last_connection_date($user['user_id'], true)
|
|
|
+ get_lang('FirstLogin') => Tracking :: get_first_connection_date($userId),
|
|
|
+ get_lang('LatestLogin') => Tracking :: get_last_connection_date($userId, true)
|
|
|
);
|
|
|
$row = 1;
|
|
|
foreach ($data as $label => $item) {
|
|
@@ -126,8 +126,7 @@ $tbl_session = Database:: get_main_table(TABLE_MAIN_SESSION);
|
|
|
$tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
|
|
|
$tbl_user = Database:: get_main_table(TABLE_MAIN_USER);
|
|
|
|
|
|
-$user_id = $user['user_id'];
|
|
|
-$sessions = SessionManager::get_sessions_by_user($user_id, true);
|
|
|
+$sessions = SessionManager::get_sessions_by_user($userId, true);
|
|
|
$personal_course_list = array();
|
|
|
$courseToolInformationTotal = null;
|
|
|
if (count($sessions) > 0) {
|
|
@@ -159,7 +158,7 @@ if (count($sessions) > 0) {
|
|
|
foreach ($session_item['courses'] as $my_course) {
|
|
|
$courseInfo = api_get_course_info_by_id($my_course['real_id']);
|
|
|
$sessionStatus = SessionManager::get_user_status_in_session(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo['real_id'],
|
|
|
$id_session
|
|
|
);
|
|
@@ -179,20 +178,20 @@ if (count($sessions) > 0) {
|
|
|
Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>';
|
|
|
|
|
|
if ($my_course['status'] == STUDENT) {
|
|
|
- $tools .= '<a href="user_information.php?action=unsubscribeSessionCourse&course_code='.$courseInfo['code'].'&user_id='.$user['user_id'].'&id_session='.$id_session.'">'.
|
|
|
+ $tools .= '<a href="user_information.php?action=unsubscribeSessionCourse&course_code='.$courseInfo['code'].'&user_id='.$userId.'&id_session='.$id_session.'">'.
|
|
|
Display::return_icon('delete.png', get_lang('Delete')).'</a>';
|
|
|
}
|
|
|
|
|
|
$timeSpent = api_time_to_hms(
|
|
|
Tracking :: get_time_spent_on_the_course(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo['real_id'],
|
|
|
$id_session
|
|
|
)
|
|
|
);
|
|
|
|
|
|
$totalForumMessages = CourseManager::getCountPostInForumPerUser(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo['real_id'],
|
|
|
$id_session
|
|
|
);
|
|
@@ -213,7 +212,7 @@ if (count($sessions) > 0) {
|
|
|
$data[] = $row;
|
|
|
|
|
|
$result = TrackingUserLogCSV::getToolInformation(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo,
|
|
|
$id_session
|
|
|
);
|
|
@@ -261,7 +260,7 @@ $courseToolInformationTotal = null;
|
|
|
*/
|
|
|
$sql = 'SELECT * FROM '.$table_course_user.' cu, '.$table_course.' c
|
|
|
WHERE
|
|
|
- cu.user_id = '.$user['user_id'].' AND
|
|
|
+ cu.user_id = '.$userId.' AND
|
|
|
cu.c_id = c.id AND
|
|
|
cu.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' ';
|
|
|
$res = Database::query($sql);
|
|
@@ -297,20 +296,20 @@ if (Database::num_rows($res) > 0) {
|
|
|
'<a href="course_edit.php?id='.$course->c_id.'">'.
|
|
|
Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
|
|
|
if ($course->status == STUDENT) {
|
|
|
- $tools .= '<a href="user_information.php?action=unsubscribe&course_code='.$courseCode.'&user_id='.$user['user_id'].'">'.
|
|
|
+ $tools .= '<a href="user_information.php?action=unsubscribe&course_code='.$courseCode.'&user_id='.$userId.'">'.
|
|
|
Display::return_icon('delete.png', get_lang('Delete')).'</a>';
|
|
|
}
|
|
|
|
|
|
$timeSpent = api_time_to_hms(
|
|
|
Tracking :: get_time_spent_on_the_course(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo['real_id'],
|
|
|
0
|
|
|
)
|
|
|
);
|
|
|
|
|
|
$totalForumMessages = CourseManager::getCountPostInForumPerUser(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$course->id,
|
|
|
0
|
|
|
);
|
|
@@ -328,7 +327,7 @@ if (Database::num_rows($res) > 0) {
|
|
|
$data[] = $row;
|
|
|
|
|
|
$result = TrackingUserLogCSV::getToolInformation(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
$courseInfo,
|
|
|
0
|
|
|
);
|
|
@@ -352,9 +351,9 @@ if (Database::num_rows($res) > 0) {
|
|
|
/**
|
|
|
* Show the URL in which this user is subscribed
|
|
|
*/
|
|
|
-$urlInformation = null;
|
|
|
+$urlInformation = '';
|
|
|
if (api_is_multiple_url_enabled()) {
|
|
|
- $urlList = UrlManager::get_access_url_from_user($user['user_id']);
|
|
|
+ $urlList = UrlManager::get_access_url_from_user($userId);
|
|
|
if (count($urlList) > 0) {
|
|
|
$header = array();
|
|
|
$header[] = array('URL', true);
|
|
@@ -381,6 +380,25 @@ if (api_is_multiple_url_enabled()) {
|
|
|
$urlInformation = '<p>'.get_lang('NoUrlForThisUser').'</p>';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+$studentBossList = UserManager::getStudentBossList($userId);
|
|
|
+$studentBossListToString = '';
|
|
|
+if ($studentBossList) {
|
|
|
+ $table = new HTML_Table(array('class' => 'data_table'));
|
|
|
+ $table->setHeaderContents(0, 0, get_lang('User'));
|
|
|
+ $csvContent[] = [get_lang('StudentBoss')];
|
|
|
+
|
|
|
+ $row = 1;
|
|
|
+ foreach ($studentBossList as $studentBossId) {
|
|
|
+ $studentBoss = api_get_user_info($studentBossId);
|
|
|
+ $table->setCellContents($row, 0, $studentBoss['complete_name_with_username']);
|
|
|
+ $csvContent[] = array($studentBoss['complete_name_with_username']);
|
|
|
+ $row++;
|
|
|
+ }
|
|
|
+ $studentBossListToString = $table->toHtml();
|
|
|
+}
|
|
|
+
|
|
|
$message = null;
|
|
|
|
|
|
if (isset($_GET['action'])) {
|
|
@@ -425,14 +443,13 @@ echo '<div class="actions">
|
|
|
|
|
|
echo Display::page_header($tool_name);
|
|
|
|
|
|
-
|
|
|
$fullUrlBig = UserManager::getUserPicture(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
USER_IMAGE_SIZE_BIG
|
|
|
);
|
|
|
|
|
|
$fullUrl = UserManager::getUserPicture(
|
|
|
- $user['user_id'],
|
|
|
+ $userId,
|
|
|
USER_IMAGE_SIZE_ORIGINAL
|
|
|
);
|
|
|
|
|
@@ -453,8 +470,15 @@ echo $trackingInformation;
|
|
|
echo '</div>';
|
|
|
echo '</div>';
|
|
|
|
|
|
+if ($studentBossList) {
|
|
|
+ echo Display::page_subheader(get_lang('StudentBossList'));
|
|
|
+ echo $studentBossListToString;
|
|
|
+}
|
|
|
+
|
|
|
echo Display::page_subheader(get_lang('SessionList'));
|
|
|
echo $sessionInformation;
|
|
|
+
|
|
|
+echo Display::page_subheader(get_lang('CourseList'));
|
|
|
echo $courseInformation;
|
|
|
echo $urlInformation;
|
|
|
|