Add skills report to student role - refs BT#9084

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent ec70d42970
commit 0b6b0ce29d
  1. 9
      main/auth/my_progress.php
  2. 49
      main/auth/skills.php
  3. 38
      main/template/default/auth/skills.tpl

@ -87,6 +87,15 @@ if (!empty($course_user_list)) {
$content = ''; $content = '';
if (api_is_student()) {
$content .= '<div class="actions">';
$content .= Display::url(
Display::return_icon('skills.png', get_lang('Skills'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . 'auth/skills.php'
);
$content .= '</div>';
}
$content .= Tracking::show_user_progress(api_get_user_id(), $sessionId); $content .= Tracking::show_user_progress(api_get_user_id(), $sessionId);
$content .= Tracking::show_course_detail(api_get_user_id(), $courseCode, $sessionId); $content .= Tracking::show_course_detail(api_get_user_id(), $courseCode, $sessionId);

@ -0,0 +1,49 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Skills reporting
* @package chamilo.reporting
*/
require_once '../inc/global.inc.php';
if (!api_is_student()) {
api_not_allowed();
}
$this_section = SECTION_TRACKING;
$toolName = get_lang('Skills');
$tableRows = array();
$objSkill = new Skill();
$objSkillRelUser = new SkillRelUser();
$userSkills = $objSkillRelUser->get_all(array(
'where' => array(
'user_id = ?' => api_get_user_id()
)
));
foreach ($userSkills as $achievedSkill) {
$skill = $objSkill->get($achievedSkill['skill_id']);
$course = api_get_course_info_by_id($achievedSkill['course_id']);
$tableRows[] = array(
'skillName' => $skill['name'],
'achievedAt' => api_format_date($achievedSkill['acquired_skill_at'], DATE_FORMAT_NUMBER),
'courseImage' => $course['course_image'],
'courseName' => $course['name']
);
}
/*
* View
*/
$tpl = new Template($toolName);
$tpl->assign('rows', $tableRows);
$contentTemplate = $tpl->get_template('auth/skills.tpl');
$tpl->display($contentTemplate);

@ -0,0 +1,38 @@
{% extends "default/layout/main.tpl" %}
{% block body %}
<div class="span12">
<div class="actions">
<a href="{{ _p.web_main }}auth/my_progress.php">
<img src="{{ _p.web_img }}icons/32/stats.png" alt='{{ 'MyProgress' | get_lang }}' title="Ver mis estadísticas">
</a>
</div>
<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1>
{% if rows %}
<table class="table">
<thead>
<tr>
<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.skillName }}</td>
<td>{{ row.achievedAt }}</td>
<td><img src="{{ row.courseImage }}" alt="{{ row.courseName }}" width="64"> {{ row.courseName }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert alert-info">
{{ 'NoResults' | get_lang }}
</div>
{% endif %}
</div>
{% endblock %}
Loading…
Cancel
Save