Minor - fix after merge 1.11.x

pull/3063/head
Julio Montoya 7 years ago
parent f5f24be6b5
commit 0a9e58e767
  1. 114
      main/mySpace/myStudents.php
  2. 52
      main/template/rainbow/skill/student_report.tpl
  3. 4
      user_portal.php

@ -665,6 +665,8 @@ $userGroups = $userGroupManager->getNameListByUser(
<tr>
<td><?php echo get_lang('OnLine'); ?></td>
<td><?php echo $online; ?></td>
</tr>
<?php
if (!empty($course_code)) {
@ -690,6 +692,106 @@ $userGroups = $userGroupManager->getNameListByUser(
</tr>
<?php
}
// Ofaj
echo get_lang('Language').' : ';
$languageId = api_get_language_id($user_info['language']);
if ($languageId) {
$languageInfo = api_get_language_info($languageId);
echo $languageInfo['original_name'];
}
echo '</td></tr>';
$startDate = UserManager::get_extra_user_data_by_field(
$user_info['user_id'],
'datedebutstage'
);
$endDate = UserManager::get_extra_user_data_by_field(
$user_info['user_id'],
'datefinstage'
);
$extraField = new ExtraField('user');
$extraFieldInfoStart = $extraField->get_handler_field_info_by_field_variable(
'datedebutstage'
);
$extraFieldInfoEnd = $extraField->get_handler_field_info_by_field_variable(
'datefinstage'
);
echo '<tr><td>';
echo $extraFieldInfoStart['display_text'].' : ';
if (isset($startDate['datedebutstage'])) {
echo $startDate['datedebutstage'];
}
echo '</td></tr>';
echo '<tr><td>';
echo $extraFieldInfoEnd['display_text'].' : ';
if (isset($endDate['datefinstage'])) {
echo $endDate['datefinstage'];
}
echo '</td></tr>';
/** @var ExtraFieldSavedSearch $saved */
$search = [
'user' => $student_id,
];
$items = $em->getRepository('ChamiloCoreBundle:ExtraFieldSavedSearch')->findBy($search);
$listVariables = [
'ecouter',
'lire',
'ecrire',
's_exprimer_oralement_en_continu',
'participer_a_une_conversation',
];
$extraField = new ExtraField('session');
if ($items) {
/** @var ExtraFieldSavedSearch $item */
foreach ($items as $item) {
$variable = $item->getField()->getVariable();
if (in_array($variable, $listVariables)) {
$extraFieldInfo = $extraField->get_handler_field_info_by_field_variable($variable);
if ($extraFieldInfo) {
echo '<tr><td>';
$options = $extraFieldInfo['options'];
$optionValues = array_column($options, 'display_text', 'option_value');
//var_dump($optionValues);
echo $extraFieldInfo['display_text'].' : ';
$answers = $item->getValue();
$list = [];
if (is_array($answers)) {
foreach ($answers as $answer) {
$list[] = $optionValues[$answer];
}
} else {
foreach ($options as $option) {
$answers = trim($answers, '.');
$answers = str_replace('-', '_', $answers);
if ($option['option_value'] != api_underscore_to_camel_case($answers)) {
continue;
}
$list[] = $option['display_text'];
}
}
echo '<ul><li>';
echo implode('</li><li>', $list);
echo '</li></ul>';
echo '</td></tr>';
}
}
}
}
// 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(
@ -800,6 +902,18 @@ $userGroups = $userGroupManager->getNameListByUser(
echo '</td></tr>';
}
}
$icon = ' '.Display::url(
get_lang('Generate'),
api_get_self().'?action=generate_certificate&student='.$student_id.'&cidReq='.$course_code.'&course='.$course_code,
['class' => 'btn btn-primary btn-xs']
);
echo '<tr>
<td align="right">';
echo get_lang('Certificate').' </td> <td align="left">'.$icon;
echo '</td></tr>';
?>
</tbody>
</table>

@ -0,0 +1,52 @@
<!--
{% if allow_skill_tool %}
<div class="btn-group">
<a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">
{{ 'SkillsWheel' | get_lang }}
</a>
</div>
{% endif %}
-->
<style>
</style>
<h1 class="page-header">{{ 'MyBadges' | get_lang }}</h1>
<p>
{{ 'MySkillsReportIntroduction' | get_lang }}
</p>
{% if rows %}
<div class="communications">
{% if skill_table %}
{{ skill_table }}
{% endif %}
</div>
<h6 class="table-header">{{ 'SkillsHistory' | get_lang }}</h6>
<table class="table">
<thead>
<tr>
<th>{{ 'Badge' | get_lang }}</th>
<th>{{ 'Skill' | get_lang }}</th>
<th>{{ 'Date' | get_lang }}</th>
<th>{{ 'Course' | get_lang }}</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
<td>{{ row.skill_badge }}</td>
<td>{{ row.skill_name }}</td>
<td>{{ row.achieved_at }}</td>
{% if row.course_name %}
<td>
<img src="{{ row.course_image }}" alt="{{ row.course_name }}" width="32">
{{ row.course_name }}
</td>
{% else %}
<td> - </td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

@ -336,9 +336,9 @@ $controller->tpl->assign('user_image_block', $controller->return_user_image_bloc
//$controller->tpl->assign('course_block', $controller->return_course_block());
//$controller->tpl->assign('navigation_course_links', $controller->return_navigation_links());
//$controller->tpl->assign('search_block', $controller->return_search_block());
//$controller->tpl->assign('notice_block', $controller->return_notice());
$controller->tpl->assign('notice_block', $controller->return_notice());
//$controller->tpl->assign('classes_block', $controller->returnClassesBlock());
//$controller->tpl->assign('skills_block', $controller->returnSkillLinks());
$controller->tpl->assign('skills_block', $controller->returnSkillLinks());
$historyClass = '';
if (!empty($_GET['history'])) {

Loading…
Cancel
Save