diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index c18a6cefff..4f45336a24 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -708,11 +708,67 @@ input[type=checkbox], input[type=radio] { background-color: #FFFFFF; color: #252422; margin-bottom: 20px; - position: relative; - z-index: 1; border: 1px solid #e4e4e4; } +.card-body{ + padding: .5em 1em; + position: relative; + width: 100%; +} +.card-body .stat-widget-five{ + min-height: 60px; +} +.card-body .stat-widget-five .stat-icon{ + font-size: 35px; + line-height: 35px; + position: absolute; + left: 30px; + top: 20px; +} +.card-body .stat-widget-five .stat-icon .active-icon{ + position: absolute; + top: 15px; + bottom: 0; + left: -9px; +} +.card-body .stat-content{ + margin-left: 70px; +} +.card-body .stat-content .text-left{ + display: inline-block; +} +.card-body .stat-widget-five .stat-text { + color: #455a64; + font-size: 16px; +} +.card-body .stat-widget-five .stat-heading { + color: #99abb4; + font-size: 12px; +} +.box-widget .card-body .stat-widget-five{ + min-height: 45px; + text-align: center; + font-size:20px; +} +.box-widget .card-body .stat-widget-five .box-name{ + font-size: 12px; + color: #99abb4; +} +.box-widget .card-body .stat-widget-five span.date{ + font-size: 14px; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + width: 158px; +} +.box-widget .card-body{ + padding: 2px; + background: #1a3548; + color: #fff; +} + .card .content { padding: 15px 15px 10px 15px; } @@ -9956,9 +10012,29 @@ ul.dropdown-menu.inner > li > a { background-color: #fb5f0442 !important; color: #FF5722; } -.last-connection{ +.details .user .avatar, +.details .user .name, +.details .user .access +{ + text-align: center; +} +.details .user .name h3{ + font-size: 1.75rem; +} +.details .user .avatar .img-responsive{ + display:inline-block; +} +.details .user .parameters{ + margin-top: 1rem; + padding-top: 1rem; +} +.details .easypiechart-legend{ + text-align: center; +} +.details .easy-donut{ + padding-bottom: 10px; + margin-bottom: 10px; } - @media (min-width: 768px) { .clear-rows-6-4-3 .col-sm-6:nth-child(2n+1) { clear: left; diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index 3f5d977d64..8330bf181c 100755 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -13,6 +13,7 @@ use ChamiloSession as Session; require_once __DIR__.'/../inc/global.inc.php'; api_block_anonymous_users(); +$htmlHeadXtra[] = ''; $export = isset($_GET['export']) ? $_GET['export'] : false; $sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : 0; @@ -870,8 +871,8 @@ $userGroups = $userGroupManager->getNameListByUser( ); $userInfo = [ - 'id' => $user_info['user_id'], - 'complete_name' => $user_info['complete_name'], + 'id' => $user_info['user_id'], + 'complete_name' => $user_info['complete_name'], 'complete_name_link' => $user_info['complete_name_with_message_link'], 'phone' => $user_info['phone'], 'code' => $user_info['official_code'], @@ -885,186 +886,95 @@ $userInfo = [ 'avatar' => $userPicture, 'online' => $online ]; + +if (!empty($course_code)) { + $userInfo['url_access'] = Display::url( + get_lang('SeeAccesses'), + 'access_details.php?' + .http_build_query( + [ + 'student' => $student_id, + 'course' => $course_code, + 'origin' => $origin, + 'cidReq' => $course_code, + 'id_session' => $sessionId, + ] + ), + ['class' => 'btn btn-default'] + ); +} + + +// Display timezone if the user selected one and if the admin allows the use of user's timezone +$timezone = null; +$timezone_user = UserManager::get_extra_user_data_by_field( + $user_info['user_id'], + 'timezone' +); +$use_users_timezone = api_get_setting('use_users_timezone', 'timezones'); + if ($timezone_user['timezone'] != null && + $use_users_timezone == 'true' + ) { + $timezone = $timezone_user['timezone']; + } + if ($timezone !== null) { + $userInfo['timezone'] = $timezone; + } + + if (is_numeric($avg_student_score)) { + $score = $avg_student_score.'%'; + } else { + $score = $avg_student_score; + } + +$userInfo['student_score'] = $score; +$userInfo['student_progress'] = $avg_student_progress; +$userInfo['first_connection'] = $first_connection_date; +$userInfo['last_connection'] = $last_connection_date; +if ($details == 'true') { + $userInfo['time_spent_course'] = $time_spent_on_the_course; +} + +if (api_get_setting('allow_terms_conditions') === 'true') { + $isBoss = UserManager::userIsBossOfStudent(api_get_user_id(), $student_id); + if ($isBoss || api_is_platform_admin()) { + $extraFieldValue = new ExtraFieldValue('user'); + $value = $extraFieldValue->get_values_by_handler_and_field_variable( + $student_id, + 'legal_accept' + ); + $icon = Display::return_icon('accept_na.png'); + $legalTime = null; + + if (isset($value['value']) && !empty($value['value'])) { + list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']); + $icon = Display::return_icon('accept.png'); + $btn = Display::url( + get_lang('DeleteLegal'), + api_get_self().'?action=delete_legal&student='.$student_id.'&course='.$course_code, + ['class' => 'btn btn-danger'] + ); + $timeLegalAccept = api_get_local_time($legalTime); + } else { + $btn = Display::url( + get_lang('SendLegal'), + api_get_self().'?action=send_legal&student='.$student_id.'&course='.$course_code, + ['class' => 'btn btn-primary'] + ); + $timeLegalAccept = get_lang('NotRegistered'); + } + } + $userInfo['legal'] = [ + 'icon' => $icon, + 'datetime' => $timeLegalAccept, + 'url_send' => $btn + ]; +} + ?>
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- '.$user_info['email'].'' - : get_lang('NoEmail'); - ?> -
- $student_id, - 'course' => $course_code, - 'origin' => $origin, - 'cidReq' => $course_code, - 'id_session' => $sessionId, - ] - ), - ['class' => 'btn btn-default'] - ); ?> -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - get_values_by_handler_and_field_variable( - $student_id, - 'legal_accept' - ); - $icon = Display::return_icon('accept_na.png'); - if (isset($value['value']) && !empty($value['value'])) { - list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']); - $icon = Display::return_icon('accept.png').' '.api_get_local_time($legalTime); - $icon .= ' '.Display::url( - get_lang('DeleteLegal'), - api_get_self().'?action=delete_legal&student='.$student_id.'&course='.$course_code, - ['class' => 'btn btn-danger btn-xs'] - ); - } else { - $icon .= ' '.Display::url( - get_lang('SendLegal'), - api_get_self().'?action=send_legal&student='.$student_id.'&course='.$course_code, - ['class' => 'btn btn-primary btn-xs'] - ); - } - echo ' - '; - } - } - ?> - -
- 'absmiddle', 'hspace' => '3px'] - ); ?> -
- 'absmiddle', 'hspace' => '3px'] - ); ?> - - -
'; - echo get_lang('LegalAccepted').' '.$icon; - echo '
@@ -1090,17 +1000,6 @@ $userInfo = [ assign('user', $userInfo); -$templateName = $tpl->get_template('my_space/user_details.tpl'); -$content = $tpl->fetch($templateName); - $exportCourseList = []; $lpIdList = []; if (empty($details)) { @@ -1974,15 +1873,7 @@ if (empty($details)) { '; - echo '
-
- - - - - - - '; + $csv_content[] = []; $nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $sessionId); $messages = Tracking::count_student_messages($student_id, $course_code, $sessionId); @@ -1991,6 +1882,15 @@ if (empty($details)) { $documents = Tracking::count_student_downloaded_documents($student_id, $courseInfo['real_id'], $sessionId); $uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $sessionId); + $userInfo['tools'] = [ + 'tasks' => $nb_assignments, + 'messages' => $messages, + 'links' => $links, + 'chat_connection' => $chat_last_connection, + 'documents' => $documents, + 'upload_documents' => $uploaded_documents + ]; + $csv_content[] = [ get_lang('OtherTools'), ]; @@ -2018,35 +1918,8 @@ if (empty($details)) { $csv_content[] = [ get_lang('ChatLastConnection'), $chat_last_connection, - ]; ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
'.get_lang('OtherTools').'
-
- assign('user', $userInfo); +$templateName = $tpl->get_template('my_space/user_details.tpl'); +$content = $tpl->fetch($templateName); + echo $content; Display::display_footer(); diff --git a/main/template/default/my_space/user_details.tpl b/main/template/default/my_space/user_details.tpl index bcb7f067ef..51c3422bcf 100644 --- a/main/template/default/my_space/user_details.tpl +++ b/main/template/default/my_space/user_details.tpl @@ -1,31 +1,249 @@ -
-
-
-
-
-
- +
+
+
+
+
+
+
+ +
+
+

{{ user.complete_name_link }}

+ +
+
+
+
{{ 'Tel'|get_lang }}
+
{{ user.phone == '' ? 'NoTel'|get_lang : user.phone }}
+
{{ 'OfficialCode'|get_lang }}
+
{{ user.code == '' ? 'NoOfficialCode'|get_lang : user.code }}
+
{{ 'OnLine'|get_lang }}
+
{{ user.online }}
+
{{ 'Timezone'|get_lang }}
+
{{ user.timezone }}
+
+
+
+ {{ user.url_access }} + {{ user.legal.url_send }} +
-
-

{{ user.complete_name_link }}

- +
+
+
+
+
+
+
+
+
+
+ {{ user.student_progress }}% +
+
+ {{ 'ScormAndLPProgressTotalAverage'|get_lang }} +
+
+
+
+
+
+ {{ user.student_score }} +
+
+ {{ 'ScormAndLPTestTotalAverage'|get_lang }} +
+
+
+
+
+
+ +
+
+
+ + {{ user.tools.links }} +
+ {{ 'LinksDetails'|get_lang }} +
+
+
+
+ +
+
+
+ + {{ user.tools.documents }} +
+ {{ 'DocumentsDetails'|get_lang }} +
+
+
+
+ +
+
+
+ + {{ user.tools.tasks }} +
+ {{ 'Student_publication'|get_lang }} +
+
+
+
+ +
+
+ +
+
+
+ + {{ user.tools.messages }} +
+ {{ 'NumberOfPostsForThisUser'|get_lang }} +
+
+
+
+ +
+
+
+ + {{ user.tools.upload_documents }} +
+ {{ 'UploadedDocuments'|get_lang }} +
+
+
+
+ +
+
+
+ + + {% if user.tools.chat_connection != '' %} + {{ user.tools.chat_connection }} + {% else %} + {{ 'NotRegistered'|get_lang }} + {% endif %} + +
+ {{ 'ChatLastConnection'|get_lang }} +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ {{ user.first_connection }} +
+
+ {{ 'FirstLoginInPlatform'|get_lang }} +
+
+
+
+
-
-
-
{{ 'Tel'|get_lang }}
-
{{ user.phone == '' ? 'NoTel'|get_lang : user.phone }}
-
{{ 'OfficialCode'|get_lang }}
-
{{ user.code == '' ? 'NoOfficialCode'|get_lang : user.code }}
-
{{ 'OnLine'|get_lang }}
-
{{ user.online }}
- -
+
+
+
+
+ +
+
+
+
+ {{ user.first_connection }} +
+
+ {{ 'LatestLoginInPlatform'|get_lang }} +
+
+
+
+
+
+ {% if(user.time_spent_course) %} +
+
+
+
+ +
+
+
+
+ {{ user.time_spent_course }} +
+
+ {{ 'TimeSpentInTheCourse'|get_lang }} +
+
+
+
+
+
+ {% endif %} +
-
-
-
+
-
\ No newline at end of file +
+ \ No newline at end of file