Improvement in detailed user report -refs #2878

pull/3173/head
Alex Aragón 7 years ago
parent f3bc998999
commit 5e5495a61d
  1. 84
      app/Resources/public/css/base.css
  2. 339
      main/mySpace/myStudents.php
  3. 264
      main/template/default/my_space/user_details.tpl

@ -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;

@ -13,6 +13,7 @@ use ChamiloSession as Session;
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery.easy-pie-chart/dist/jquery.easypiechart.js"></script>';
$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
];
}
?>
<div class="row">
<div class="col-sm-2">
<img src="<?php echo $userPicture; ?>" class="thumbnail img-responsive">
</div>
<div class="col-sm-5">
<table class="table table-striped table-hover">
<thead>
<tr>
<th colspan="2"><?php echo get_lang('Information'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo get_lang('Name'); ?></td>
<td><?php echo $user_info['complete_name_with_message_link']; ?></td>
</tr>
<tr>
<td><?php echo get_lang('Email'); ?></td>
<td>
<?php
echo !empty($user_info['email'])
? '<a href="mailto:'.$user_info['email'].'">'.$user_info['email'].'</a>'
: get_lang('NoEmail');
?>
</td>
</tr>
<tr>
<td><?php echo get_lang('Tel'); ?></td>
<td><?php echo !empty($user_info['phone']) ? $user_info['phone'] : get_lang('NoTel'); ?></td>
</tr>
<tr>
<td><?php echo get_lang('OfficialCode'); ?></td>
<td><?php
echo !empty($user_info['official_code'])
? $user_info['official_code']
: get_lang('NoOfficialCode');
?></td>
</tr>
<tr>
<td><?php echo get_lang('OnLine'); ?></td>
<td><?php echo $online; ?></td>
</tr>
<?php
if (!empty($course_code)) {
?>
<tr>
<td colspan="2">
<?php
echo 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']
); ?>
</td>
</tr>
<?php
}
// 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) {
?>
<tr>
<td> <?php echo get_lang('Timezone').' : '.$timezone; ?> </td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="col-sm-5">
<table class="table table-striped table-hover">
<thead>
<tr>
<th colspan="2" class="text-center"><?php echo get_lang('Tracking'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td align="right"><?php echo get_lang('FirstLoginInPlatform'); ?></td>
<td align="left"><?php echo $first_connection_date; ?></td>
</tr>
<tr>
<td align="right"><?php echo get_lang('LatestLoginInPlatform'); ?></td>
<td align="left"><?php echo $last_connection_date; ?></td>
</tr>
<?php
if ($details == 'true') {
?>
<tr>
<td align="right"><?php echo get_lang('TimeSpentInTheCourse'); ?></td>
<td align="left"><?php echo $time_spent_on_the_course; ?></td>
</tr>
<tr>
<td align="right">
<?php
echo get_lang('Progress').' ';
Display::display_icon(
'info3.gif',
get_lang('ScormAndLPProgressTotalAverage'),
['align' => 'absmiddle', 'hspace' => '3px']
); ?>
</td>
<td align="left"><?php echo $avg_student_progress.'%'; ?></td>
</tr>
<tr>
<td align="right">
<?php
echo get_lang('Score').' ';
Display::display_icon(
'info3.gif',
get_lang('ScormAndLPTestTotalAverage'),
['align' => 'absmiddle', 'hspace' => '3px']
); ?>
</td>
<td align="left">
<?php
if (is_numeric($avg_student_score)) {
echo $avg_student_score.'%';
} else {
echo $avg_student_score;
} ?>
</td>
</tr>
<?php
}
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');
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 '<tr>
<td align="right">';
echo get_lang('LegalAccepted').' </td> <td align="left">'.$icon;
echo '</td></tr>';
}
}
?>
</tbody>
</table>
<?php if (!empty($userGroups)) {
?>
<table class="table table-striped table-hover">
@ -1090,17 +1000,6 @@ $userInfo = [
<?php
$tpl = new Template('',
false,
false,
false,
false,
false,
false);
$tpl->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)) {
</div>
';
echo '<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th colspan="2">'.get_lang('OtherTools').'</th>
</tr>
</thead>
<tbody>
';
$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,
]; ?>
<tr><!-- assignments -->
<td width="40%"><?php echo get_lang('Student_publication'); ?></td>
<td><?php echo $nb_assignments; ?></td>
</tr>
<tr><!-- messages -->
<td><?php echo get_lang('Forum').' - '.get_lang('NumberOfPostsForThisUser'); ?></td>
<td><?php echo $messages; ?></td>
</tr>
<tr><!-- links -->
<td><?php echo get_lang('LinksDetails'); ?></td>
<td><?php echo $links; ?></td>
</tr>
<tr><!-- downloaded documents -->
<td><?php echo get_lang('DocumentsDetails'); ?></td>
<td><?php echo $documents; ?></td>
</tr>
<tr><!-- uploaded documents -->
<td><?php echo get_lang('UploadedDocuments'); ?></td>
<td><?php echo $uploaded_documents; ?></td>
</tr>
<tr><!-- Chats -->
<td><?php echo get_lang('ChatLastConnection'); ?></td>
<td><?php echo $chat_last_connection; ?></td>
</tr>
</tbody>
</table>
</div>
<?php
];
} //end details
$allowAll = api_get_configuration_value('allow_teacher_access_student_skills');
@ -2141,6 +2014,18 @@ if ($export) {
exit;
}
$tpl = new Template('',
false,
false,
false,
false,
false,
false);
$tpl->assign('user', $userInfo);
$templateName = $tpl->get_template('my_space/user_details.tpl');
$content = $tpl->fetch($templateName);
echo $content;
Display::display_footer();

@ -1,31 +1,249 @@
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<div class="user">
<div class="avatar">
<img width="128px" src="{{ user.avatar }}" class="img-responsive" >
<div class="details">
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<div class="user">
<div class="avatar">
<img width="128px" src="{{ user.avatar }}" class="img-responsive" >
</div>
<div class="name">
<h3>{{ user.complete_name_link }}</h3>
<p class="email">{{ user.email }}</p>
</div>
<div class="parameters">
<dl class="dl-horizontal">
<dt>{{ 'Tel'|get_lang }}</dt>
<dd>{{ user.phone == '' ? 'NoTel'|get_lang : user.phone }}</dd>
<dt>{{ 'OfficialCode'|get_lang }}</dt>
<dd>{{ user.code == '' ? 'NoOfficialCode'|get_lang : user.code }}</dd>
<dt>{{ 'OnLine'|get_lang }}</dt>
<dd>{{ user.online }}</dd>
<dt>{{ 'Timezone'|get_lang }}</dt>
<dd>{{ user.timezone }}</dd>
</dl>
</div>
<div class="access">
{{ user.url_access }}
{{ user.legal.url_send }}
</div>
</div>
<div class="name">
<h3>{{ user.complete_name_link }}</h3>
<p class="email">{{ user.email }}</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-6">
<div class="easy-donut">
<div id="easypiechart-blue" title="{{ 'Progress'|get_lang }}" class="easypiechart" data-percent="{{ user.student_progress }}">
<span class="percent">{{ user.student_progress }}%</span>
</div>
<div class="easypiechart-legend">
{{ 'ScormAndLPProgressTotalAverage'|get_lang }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="easy-donut">
<div id="easypiechart-red" title="{{ 'Score'|get_lang }}" class="easypiechart" data-percent="{{ user.student_score }}">
<span class="percent">{{ user.student_score }} </span>
</div>
<div class="easypiechart-legend">
{{ 'ScormAndLPTestTotalAverage'|get_lang }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-globe" aria-hidden="true"></i>
{{ user.tools.links }}
<div class="box-name">
{{ 'LinksDetails'|get_lang }}
</div>
</div>
</div>
</div>
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
{{ user.tools.documents }}
<div class="box-name">
{{ 'DocumentsDetails'|get_lang }}
</div>
</div>
</div>
</div>
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-pencil" aria-hidden="true"></i>
{{ user.tools.tasks }}
<div class="box-name">
{{ 'Student_publication'|get_lang }}
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-comments-o" aria-hidden="true"></i>
{{ user.tools.messages }}
<div class="box-name">
{{ 'NumberOfPostsForThisUser'|get_lang }}
</div>
</div>
</div>
</div>
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
{{ user.tools.upload_documents }}
<div class="box-name">
{{ 'UploadedDocuments'|get_lang }}
</div>
</div>
</div>
</div>
<div class="card box-widget">
<div class="card-body">
<div class="stat-widget-five">
<i class="fa fa-plug" aria-hidden="true"></i>
<span class="date" title="{{ user.tools.chat_connection }}">
{% if user.tools.chat_connection != '' %}
{{ user.tools.chat_connection }}
{% else %}
{{ 'NotRegistered'|get_lang }}
{% endif %}
</span>
<div class="box-name">
{{ 'ChatLastConnection'|get_lang }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card card-first-date">
<div class="card-body">
<div class="stat-widget-five">
<div class="stat-icon">
<i class="fa fa-calendar" aria-hidden="true"></i>
</div>
<div class="stat-content">
<div class="text-left">
<div class="stat-text">
{{ user.first_connection }}
</div>
<div class="stat-heading">
{{ 'FirstLoginInPlatform'|get_lang }}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="parameters">
<dl class="dl-horizontal">
<dt>{{ 'Tel'|get_lang }}</dt>
<dd>{{ user.phone == '' ? 'NoTel'|get_lang : user.phone }}</dd>
<dt>{{ 'OfficialCode'|get_lang }}</dt>
<dd>{{ user.code == '' ? 'NoOfficialCode'|get_lang : user.code }}</dd>
<dt>{{ 'OnLine'|get_lang }}</dt>
<dd>{{ user.online }}</dd>
</dl>
<div class="card card-last-date">
<div class="card-body">
<div class="stat-widget-five">
<div class="stat-icon">
<i class="fa fa-calendar" aria-hidden="true"></i>
</div>
<div class="stat-content">
<div class="text-left">
<div class="stat-text">
{{ user.first_connection }}
</div>
<div class="stat-heading">
{{ 'LatestLoginInPlatform'|get_lang }}
</div>
</div>
</div>
</div>
</div>
</div>
{% if(user.time_spent_course) %}
<div class="card card-time">
<div class="card-body">
<div class="stat-widget-five">
<div class="stat-icon">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
<div class="stat-content">
<div class="text-left">
<div class="stat-text">
{{ user.time_spent_course }}
</div>
<div class="stat-heading">
{{ 'TimeSpentInTheCourse'|get_lang }}
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="card card-legal">
<div class="card-body">
<div class="stat-widget-five">
<div class="stat-icon">
<i class="fa fa-gavel" aria-hidden="true"></i>
<span class="active-icon">{{ user.legal.icon }}</span>
</div>
<div class="stat-content">
<div class="text-left">
<div class="stat-text">
{{ user.legal.datetime }}
</div>
<div class="stat-heading">
{{ 'LegalAccepted'|get_lang }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8">
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#easypiechart-blue').easyPieChart({
scaleColor: false,
barColor: '#30a5ff',
lineWidth:8,
trackColor: '#f2f2f2'
});
});
$(function() {
$('#easypiechart-red').easyPieChart({
scaleColor: false,
barColor: '#f9243f',
lineWidth:8,
trackColor: '#f2f2f2'
});
});
</script>
Loading…
Cancel
Save