user_information.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\UserBundle\Entity\User;
  4. use Chamilo\CoreBundle\Entity\UserRelUser;
  5. /**
  6. * Script showing information about a user (name, e-mail, courses and sessions)
  7. * @author Bart Mollet
  8. * @package chamilo.admin
  9. */
  10. $cidReset = true;
  11. require_once __DIR__.'/../inc/global.inc.php';
  12. $this_section = SECTION_PLATFORM_ADMIN;
  13. require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
  14. require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
  15. if (!isset($_GET['user_id'])) {
  16. api_not_allowed(true);
  17. }
  18. $user = api_get_user_info($_GET['user_id'], true);
  19. if (empty($user)) {
  20. api_not_allowed(true);
  21. }
  22. /** @var User $userEntity */
  23. $userEntity = api_get_user_entity($user['user_id']);
  24. $myUserId = api_get_user_id();
  25. if (!api_is_student_boss()) {
  26. api_protect_admin_script();
  27. } else {
  28. $isBoss = UserManager::userIsBossOfStudent($myUserId, $user['user_id']);
  29. if (!$isBoss) {
  30. api_not_allowed(true);
  31. }
  32. }
  33. $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  34. $interbreadcrumb[] = array("url" => 'user_list.php', "name" => get_lang('UserList'));
  35. $userId = $user['user_id'];
  36. $tool_name = $userEntity->getCompleteName();
  37. $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
  38. $table_course = Database::get_main_table(TABLE_MAIN_COURSE);
  39. $csvContent = [];
  40. // only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
  41. $actions = [
  42. Display::url(
  43. Display::return_icon(
  44. 'statistics.png',
  45. get_lang('Reporting'),
  46. [],
  47. ICON_SIZE_MEDIUM
  48. ),
  49. api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?'.http_build_query([
  50. 'student' => intval($_GET['user_id'])
  51. ]),
  52. ['title' => get_lang('Reporting')]
  53. )
  54. ];
  55. if (api_is_platform_admin()) {
  56. $actions[] = Display::url(
  57. Display::return_icon(
  58. 'login_as.png',
  59. get_lang('LoginAs'),
  60. [],
  61. ICON_SIZE_MEDIUM
  62. ),
  63. api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=login_as&user_id='.$userId.'&sec_token='.Security::getTokenFromSession()
  64. );
  65. $actions[] = Display::url(
  66. Display::return_icon(
  67. 'edit.png',
  68. get_lang('Edit'),
  69. array(),
  70. ICON_SIZE_MEDIUM
  71. ),
  72. api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$userId
  73. );
  74. $actions[] = Display::url(
  75. Display::return_icon(
  76. 'export_csv.png',
  77. get_lang('ExportAsCSV'),
  78. [],
  79. ICON_SIZE_MEDIUM
  80. ),
  81. api_get_self().'?user_id='.$userId.'&action=export'
  82. );
  83. $actions[] = Display::url(
  84. Display::return_icon(
  85. 'vcard.png',
  86. get_lang('UserInfo'),
  87. [],
  88. ICON_SIZE_MEDIUM
  89. ),
  90. api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.$userId
  91. );
  92. $actions[] = Display::url(
  93. Display::return_icon('new_group.png', get_lang('AddHrmToUser'), [], ICON_SIZE_MEDIUM),
  94. api_get_path(WEB_CODE_PATH).'admin/add_drh_to_user.php?u='.$userId
  95. );
  96. if (Skill::isAllow($userId, false)) {
  97. $actions[] = Display::url(
  98. Display::return_icon(
  99. 'skill-badges.png',
  100. get_lang('AddSkill'),
  101. array(),
  102. ICON_SIZE_MEDIUM,
  103. false
  104. ),
  105. api_get_path(WEB_CODE_PATH).'badge/assign.php?user='.$userId
  106. );
  107. }
  108. }
  109. $studentBossList = UserManager::getStudentBossList($userId);
  110. $studentBossListToString = '';
  111. if ($studentBossList) {
  112. $table = new HTML_Table(array('class' => 'data_table'));
  113. $table->setHeaderContents(0, 0, get_lang('User'));
  114. $csvContent[] = [get_lang('StudentBoss')];
  115. $row = 1;
  116. foreach ($studentBossList as $studentBossId) {
  117. $studentBoss = api_get_user_info($studentBossId['boss_id']);
  118. $table->setCellContents($row, 0, $studentBoss['complete_name_with_username']);
  119. $csvContent[] = array($studentBoss['complete_name_with_username']);
  120. $row++;
  121. }
  122. $studentBossListToString = $table->toHtml();
  123. }
  124. // Show info about who created this user and when
  125. $creatorId = $user['creator_id'];
  126. $creatorInfo = api_get_user_info($creatorId);
  127. $registrationDate = $user['registration_date'];
  128. $table = new HTML_Table(array('class' => 'data_table'));
  129. $table->setHeaderContents(0, 0, get_lang('Information'));
  130. $csvContent[] = [get_lang('Information')];
  131. $data = array(
  132. get_lang('Name') => $user['complete_name'],
  133. get_lang('Email') => $user['email'],
  134. get_lang('Phone') => $user['phone'],
  135. get_lang('OfficialCode') => $user['official_code'],
  136. get_lang('Online') => !empty($user['user_is_online']) ?
  137. Display::return_icon('online.png') : Display::return_icon(
  138. 'offline.png'
  139. ),
  140. get_lang('Status') => $user['status'] == 1 ? get_lang('Teacher') : get_lang(
  141. 'Student'
  142. ),
  143. null => sprintf(
  144. get_lang('CreatedByXYOnZ'),
  145. 'user_information.php?user_id='
  146. .$creatorId,
  147. $creatorInfo['username'],
  148. api_get_utc_datetime($registrationDate)
  149. )
  150. );
  151. $row = 1;
  152. foreach ($data as $label => $item) {
  153. if (!empty($label)) {
  154. $label = $label.': ';
  155. }
  156. $table->setCellContents($row, 0, $label.$item);
  157. $csvContent[] = array($label, strip_tags($item));
  158. $row++;
  159. }
  160. $userInformation = $table->toHtml();
  161. $table = new HTML_Table(array('class' => 'data_table'));
  162. $table->setHeaderContents(0, 0, get_lang('Tracking'));
  163. $csvContent[] = [get_lang('Tracking')];
  164. $data = array(
  165. get_lang('FirstLogin') => Tracking::get_first_connection_date($userId),
  166. get_lang('LatestLogin') => Tracking::get_last_connection_date($userId, true)
  167. );
  168. if (api_get_setting('allow_terms_conditions') === 'true') {
  169. $extraFieldValue = new ExtraFieldValue('user');
  170. $value = $extraFieldValue->get_values_by_handler_and_field_variable(
  171. $userId,
  172. 'legal_accept'
  173. );
  174. $icon = Display::return_icon('accept_na.png');
  175. if (isset($value['value'])) {
  176. list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']);
  177. $icon = Display::return_icon('accept.png').' '.api_get_local_time($legalTime);
  178. $icon .= ' '.Display::url(
  179. get_lang('DeleteLegal'),
  180. api_get_self().'?action=delete_legal&user_id='.$userId,
  181. ['class' => 'btn btn-danger btn-xs']
  182. );
  183. } else {
  184. $icon .= ' '.Display::url(
  185. get_lang('SendLegal'),
  186. api_get_self().'?action=send_legal&user_id='.$userId,
  187. ['class' => 'btn btn-primary btn-xs']
  188. );
  189. }
  190. $data[get_lang('LegalAccepted')] = $icon;
  191. }
  192. $row = 1;
  193. foreach ($data as $label => $item) {
  194. if (!empty($label)) {
  195. $label = $label.': ';
  196. }
  197. $table->setCellContents($row, 0, $label.$item);
  198. $csvContent[] = array($label, strip_tags($item));
  199. $row++;
  200. }
  201. $trackingInformation = $table->toHtml();
  202. $socialInformation = '';
  203. /**
  204. * Show social activity
  205. */
  206. if (api_get_setting('allow_social_tool') === 'true') {
  207. $em = Database::getManager();
  208. $userObject = $em->find('ChamiloUserBundle:User', $user['user_id']);
  209. $data = [];
  210. // Calculate values
  211. if (api_get_setting('allow_message_tool') === 'true') {
  212. $messagesSent = SocialManager::getCountMessagesSent($user['user_id']);
  213. $data[] = [get_lang('MessagesSent'), $messagesSent];
  214. $messagesReceived = SocialManager::getCountMessagesReceived($user['user_id']);
  215. $data[] = [get_lang('MessagesReceived'), $messagesReceived];
  216. }
  217. $wallMessagesPosted = SocialManager::getCountWallPostedMessages($user['user_id']);
  218. $data[] = [get_lang('WallMessagesPosted'), $wallMessagesPosted];
  219. $friends = SocialManager::getCountFriends($user['user_id']);
  220. $data[] = [get_lang('Friends'), $friends];
  221. $count = SocialManager::getCountInvitationSent($user['user_id']);
  222. $data[] = [get_lang('InvitationSent'), $count];
  223. $count = SocialManager::get_message_number_invitation_by_user_id($user['user_id']);
  224. $data[] = [get_lang('InvitationReceived'), $count];
  225. $socialInformation = Display::return_sortable_table(
  226. '',
  227. $data
  228. );
  229. }
  230. /**
  231. * Show the sessions in which this user is subscribed
  232. */
  233. $sessions = SessionManager::get_sessions_by_user($userId, true);
  234. $personal_course_list = array();
  235. $courseToolInformationTotal = null;
  236. if (count($sessions) > 0) {
  237. $sessionInformation = null;
  238. $header = array(
  239. array(get_lang('Code'), true),
  240. array(get_lang('Title'), true),
  241. array(get_lang('Status'), true),
  242. array(get_lang('TimeSpentInTheCourse'), true),
  243. array(get_lang('TotalPostsInAllForums'), true),
  244. array('', false)
  245. );
  246. $headerList = array();
  247. foreach ($header as $item) {
  248. $headerList[] = $item[0];
  249. }
  250. $csvContent[] = array();
  251. $csvContent[] = array(get_lang('Sessions'));
  252. foreach ($sessions as $session_item) {
  253. $data = array();
  254. $personal_course_list = array();
  255. $id_session = $session_item['session_id'];
  256. $csvContent[] = array($session_item['session_name']);
  257. $csvContent[] = $headerList;
  258. foreach ($session_item['courses'] as $my_course) {
  259. $courseInfo = api_get_course_info_by_id($my_course['real_id']);
  260. $sessionStatus = SessionManager::get_user_status_in_course_session(
  261. $userId,
  262. $courseInfo['real_id'],
  263. $id_session
  264. );
  265. $status = null;
  266. switch ($sessionStatus) {
  267. case 0:
  268. case STUDENT:
  269. $status = get_lang('Student');
  270. break;
  271. case 2:
  272. $status = get_lang('CourseCoach');
  273. break;
  274. }
  275. $tools = '<a href="course_information.php?code='.$courseInfo['code'].'&id_session='.$id_session.'">'.
  276. Display::return_icon('synthese_view.gif', get_lang('Overview')).'</a>'.
  277. '<a href="'.$courseInfo['course_public_url'].'?id_session='.$id_session.'">'.
  278. Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>';
  279. if ($my_course['status'] == STUDENT) {
  280. $tools .= '<a href="user_information.php?action=unsubscribeSessionCourse&course_code='.$courseInfo['code'].'&user_id='.$userId.'&id_session='.$id_session.'">'.
  281. Display::return_icon('delete.png', get_lang('Delete')).'</a>';
  282. }
  283. $timeSpent = api_time_to_hms(
  284. Tracking :: get_time_spent_on_the_course(
  285. $userId,
  286. $courseInfo['real_id'],
  287. $id_session
  288. )
  289. );
  290. $totalForumMessages = CourseManager::getCountPostInForumPerUser(
  291. $userId,
  292. $courseInfo['real_id'],
  293. $id_session
  294. );
  295. $row = array(
  296. Display::url(
  297. $courseInfo['code'],
  298. $courseInfo['course_public_url'].'?id_session='.$id_session
  299. ),
  300. $courseInfo['title'],
  301. $status,
  302. $timeSpent,
  303. $totalForumMessages,
  304. $tools
  305. );
  306. $csvContent[] = array_map('strip_tags', $row);
  307. $data[] = $row;
  308. $result = Tracking::getToolInformation(
  309. $userId,
  310. $courseInfo,
  311. $id_session
  312. );
  313. if (!empty($result['html'])) {
  314. $courseToolInformationTotal .= $result['html'];
  315. $csvContent = array_merge($csvContent, $result['array']);
  316. }
  317. }
  318. $dates = array_filter(
  319. array($session_item['access_start_date'], $session_item['access_end_date'])
  320. );
  321. $sessionInformation .= Display::page_subheader(
  322. '<a href="'.api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id_session.'">'.
  323. $session_item['session_name'].'</a>',
  324. ' '.implode(' - ', $dates)
  325. );
  326. $sessionInformation .= Display::return_sortable_table(
  327. $header,
  328. $data,
  329. array(),
  330. array(),
  331. array('user_id' => intval($_GET['user_id']))
  332. );
  333. $sessionInformation .= $courseToolInformationTotal;
  334. }
  335. } else {
  336. $sessionInformation = '<p>'.get_lang('NoSessionsForThisUser').'</p>';
  337. }
  338. $courseToolInformationTotal = '';
  339. /**
  340. * Show the courses in which this user is subscribed
  341. */
  342. $sql = 'SELECT * FROM '.$table_course_user.' cu, '.$table_course.' c
  343. WHERE
  344. cu.user_id = '.$userId.' AND
  345. cu.c_id = c.id AND
  346. cu.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' ';
  347. $res = Database::query($sql);
  348. if (Database::num_rows($res) > 0) {
  349. $header = array(
  350. array(get_lang('Code')),
  351. array(get_lang('Title')),
  352. array(get_lang('Status')),
  353. array(get_lang('TimeSpentInTheCourse')),
  354. array(get_lang('TotalPostsInAllForums')),
  355. array('')
  356. );
  357. $headerList = array();
  358. foreach ($header as $item) {
  359. $headerList[] = $item[0];
  360. }
  361. $csvContent[] = array();
  362. $csvContent[] = array(get_lang('Courses'));
  363. $csvContent[] = $headerList;
  364. $data = array();
  365. $courseToolInformationTotal = null;
  366. while ($course = Database::fetch_object($res)) {
  367. $courseInfo = api_get_course_info_by_id($course->c_id);
  368. $courseCode = $courseInfo['code'];
  369. $courseToolInformation = null;
  370. $tools = '<a href="course_information.php?code='.$courseCode.'">'.
  371. Display::return_icon('synthese_view.gif', get_lang('Overview')).'</a>'.
  372. '<a href="'.$courseInfo['course_public_url'].'">'.
  373. Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'</a>'.
  374. '<a href="course_edit.php?id='.$course->c_id.'">'.
  375. Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
  376. if ($course->status == STUDENT) {
  377. $tools .= '<a href="user_information.php?action=unsubscribe&course_code='.$courseCode.'&user_id='.$userId.'">'.
  378. Display::return_icon('delete.png', get_lang('Delete')).'</a>';
  379. }
  380. $timeSpent = api_time_to_hms(
  381. Tracking :: get_time_spent_on_the_course(
  382. $userId,
  383. $courseInfo['real_id'],
  384. 0
  385. )
  386. );
  387. $totalForumMessages = CourseManager::getCountPostInForumPerUser(
  388. $userId,
  389. $course->id,
  390. 0
  391. );
  392. $row = array(
  393. Display::url($courseCode, $courseInfo['course_public_url']),
  394. $course->title,
  395. $course->status == STUDENT ? get_lang('Student') : get_lang('Teacher'),
  396. $timeSpent,
  397. $totalForumMessages,
  398. $tools,
  399. );
  400. $csvContent[] = array_map('strip_tags', $row);
  401. $data[] = $row;
  402. $result = Tracking::getToolInformation(
  403. $userId,
  404. $courseInfo,
  405. 0
  406. );
  407. $courseToolInformationTotal .= $result['html'];
  408. $csvContent = array_merge($csvContent, $result['array']);
  409. }
  410. $courseInformation = Display::page_subheader(get_lang('Courses'));
  411. $courseInformation .= Display::return_sortable_table(
  412. $header,
  413. $data,
  414. array(),
  415. array(),
  416. array('user_id' => intval($_GET['user_id']))
  417. );
  418. $courseInformation .= $courseToolInformationTotal;
  419. } else {
  420. $courseInformation = '<p>'.get_lang('NoCoursesForThisUser').'</p>';
  421. }
  422. /**
  423. * Show the URL in which this user is subscribed
  424. */
  425. $urlInformation = '';
  426. if (api_is_multiple_url_enabled()) {
  427. $urlList = UrlManager::get_access_url_from_user($userId);
  428. if (count($urlList) > 0) {
  429. $header = array();
  430. $header[] = array('URL', true);
  431. $data = array();
  432. $csvContent[] = array();
  433. $csvContent[] = array('Url');
  434. foreach ($urlList as $url) {
  435. $row = array();
  436. $row[] = Display::url($url['url'], $url['url']);
  437. $csvContent[] = array_map('strip_tags', $row);
  438. $data[] = $row;
  439. }
  440. $urlInformation = Display::page_subheader(get_lang('URLList'));
  441. $urlInformation .= Display::return_sortable_table(
  442. $header,
  443. $data,
  444. array(),
  445. array(),
  446. array('user_id' => intval($_GET['user_id']))
  447. );
  448. } else {
  449. $urlInformation = '<p>'.get_lang('NoUrlForThisUser').'</p>';
  450. }
  451. }
  452. if (isset($_GET['action'])) {
  453. switch ($_GET['action']) {
  454. case 'send_legal':
  455. $subject = get_lang('SendLegalSubject');
  456. $content = sprintf(
  457. get_lang('SendLegalDescriptionToUrlX'),
  458. api_get_path(WEB_PATH)
  459. );
  460. MessageManager::send_message_simple($userId, $subject, $content);
  461. Display::addFlash(Display::return_message(get_lang('Sent')));
  462. break;
  463. case 'delete_legal':
  464. $extraFieldValue = new ExtraFieldValue('user');
  465. $value = $extraFieldValue->get_values_by_handler_and_field_variable(
  466. $userId,
  467. 'legal_accept'
  468. );
  469. $result = $extraFieldValue->delete($value['id']);
  470. if ($result) {
  471. Display::addFlash(Display::return_message(get_lang('Deleted')));
  472. }
  473. break;
  474. case 'unsubscribe':
  475. $courseCode = empty($_GET['course_code']) ? '' : intval($_GET['course_code']);
  476. $sessionId = empty($_GET['id_session']) ? 0 : intval($_GET['id_session']);
  477. $courseInfo = api_get_course_info($courseCode);
  478. if (empty($courseInfo)) {
  479. break;
  480. }
  481. if (CourseManager::getUserInCourseStatus($userId, $courseInfo['real_id']) == STUDENT) {
  482. CourseManager::unsubscribe_user($userId, $courseCode, $sessionId);
  483. Display::addFlash(Display::return_message(get_lang('UserUnsubscribed')));
  484. } else {
  485. Display::addFlash(Display::return_message(
  486. get_lang('CannotUnsubscribeUserFromCourse'),
  487. 'error',
  488. false
  489. ));
  490. }
  491. break;
  492. case 'unsubscribeSessionCourse':
  493. $userId = empty($_GET['user_id']) ? 0 : intval($_GET['user_id']);
  494. $courseCode = empty($_GET['course_code']) ? '' : intval($_GET['course_code']);
  495. $sessionId = empty($_GET['id_session']) ? 0 : intval($_GET['id_session']);
  496. SessionManager::removeUsersFromCourseSession(
  497. array($userId),
  498. $sessionId,
  499. api_get_course_info($courseCode)
  500. );
  501. Display::addFlash(Display::return_message(get_lang('UserUnsubscribed')));
  502. break;
  503. case 'export':
  504. Export::arrayToCsv(
  505. $csvContent,
  506. 'user_information_'.$user['user_id']
  507. );
  508. exit;
  509. break;
  510. }
  511. }
  512. Display::display_header($tool_name);
  513. echo Display::toolbarAction('toolbar-user-information', [implode(PHP_EOL, $actions)]);
  514. echo Display::page_header($tool_name);
  515. $fullUrlBig = UserManager::getUserPicture(
  516. $userId,
  517. USER_IMAGE_SIZE_BIG
  518. );
  519. $fullUrl = UserManager::getUserPicture(
  520. $userId,
  521. USER_IMAGE_SIZE_ORIGINAL
  522. );
  523. echo '<div class="row">';
  524. echo '<div class="col-md-2">';
  525. echo '<a class="thumbnail expand-image" href="'.$fullUrlBig.'">'
  526. .'<img src="'.$fullUrl.'" /></a><br />';
  527. echo '</div>';
  528. echo '<div class="col-md-5">';
  529. echo $userInformation;
  530. echo '</div>';
  531. echo '<div class="col-md-5">';
  532. echo $trackingInformation;
  533. echo '</div>';
  534. echo '</div>';
  535. if ($studentBossList) {
  536. echo Display::page_subheader(get_lang('StudentBossList'));
  537. echo $studentBossListToString;
  538. }
  539. $hrmList = $userEntity->getHrm();
  540. if ($hrmList) {
  541. echo Display::page_subheader(get_lang('HrmList'));
  542. echo '<div class="row">';
  543. /** @var UserRelUser $hrm */
  544. foreach ($hrmList as $hrm) {
  545. $hrmInfo = api_get_user_info($hrm->getFriendUserId());
  546. $userPicture = isset($hrmInfo["avatar_medium"]) ? $hrmInfo["avatar_medium"] : $hrmInfo["avatar"];
  547. echo '<div class="col-sm-4 col-md-3">';
  548. echo '<div class="media">';
  549. echo '<div class="media-left">';
  550. echo Display::img($userPicture, $hrmInfo['complete_name'], ['class' => 'media-object'], false);
  551. echo '</div>';
  552. echo '<div class="media-body">';
  553. echo '<h4 class="media-heading">'.$hrmInfo['complete_name'].'</h4>';
  554. echo $hrmInfo['username'];
  555. echo '</div>';
  556. echo '</div>';
  557. echo '</div>';
  558. }
  559. echo '</div>';
  560. }
  561. if ($user['status'] == DRH) {
  562. $usersAssigned = UserManager::get_users_followed_by_drh($userId);
  563. if ($usersAssigned) {
  564. echo Display::page_subheader(get_lang('AssignedUsersListToHumanResourcesManager'));
  565. echo '<div class="row">';
  566. foreach ($usersAssigned as $userAssigned) {
  567. $userAssigned = api_get_user_info($userAssigned['user_id']);
  568. $userPicture = isset($userAssigned["avatar_medium"]) ? $userAssigned["avatar_medium"] : $userAssigned["avatar"];
  569. echo '<div class="col-sm-4 col-md-3">';
  570. echo '<div class="media">';
  571. echo '<div class="media-left">';
  572. echo Display::img($userPicture, $userAssigned['complete_name'], ['class' => 'media-object'], false);
  573. echo '</div>';
  574. echo '<div class="media-body">';
  575. echo '<h4 class="media-heading">'.$userAssigned['complete_name'].'</h4>';
  576. echo $userAssigned['username'];
  577. echo '</div>';
  578. echo '</div>';
  579. echo '</div>';
  580. }
  581. echo '</div>';
  582. }
  583. }
  584. if (api_get_setting('allow_social_tool') === 'true') {
  585. echo Display::page_subheader(get_lang('SocialData'));
  586. echo $socialInformation;
  587. }
  588. echo Display::page_subheader(get_lang('SessionList'));
  589. echo $sessionInformation;
  590. echo Display::page_subheader(get_lang('CourseList'));
  591. echo $courseInformation;
  592. echo $urlInformation;
  593. Display::display_footer();