Update skills changes from 1.11.x

pull/3063/head
jmontoyaa 8 years ago
parent 6a98afecf2
commit 20a97b75ac
  1. 2
      main/admin/skill_badge.php
  2. 2
      main/admin/skill_badge_create.php
  3. 2
      main/admin/skill_badge_list.php
  4. 2
      main/admin/skill_create.php
  5. 2
      main/admin/skill_edit.php
  6. 2
      main/admin/skill_list.php
  7. 2
      main/admin/skills.php
  8. 2
      main/admin/skills_gradebook.php
  9. 2
      main/admin/skills_profile.php
  10. 2
      main/admin/skills_wheel.php
  11. 2
      main/admin/user_information.php
  12. 2
      main/badge/issued.php
  13. 2
      main/badge/issued_all.php
  14. 2
      main/gradebook/get_badges.php
  15. 2
      main/inc/ajax/skill.ajax.php
  16. 2
      main/inc/lib/course.lib.php
  17. 287
      main/inc/lib/skill.lib.php
  18. 2
      main/inc/lib/social.lib.php
  19. 2
      main/inc/lib/tracking.lib.php
  20. 2
      main/inc/lib/userportal.lib.php
  21. 36
      main/social/my_skills_report.php
  22. 2
      main/social/skills_ranking.php
  23. 2
      main/social/skills_tree.php
  24. 2
      main/social/skills_wheel.php
  25. 44
      main/template/rainbow/skill/drh_report.tpl
  26. 24
      main/template/rainbow/skill/student_boss_report.tpl
  27. 134
      main/template/rainbow/skill/student_report.tpl

@ -12,7 +12,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$backpack = 'https://backpack.openbadges.org/'; $backpack = 'https://backpack.openbadges.org/';

@ -14,7 +14,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;

@ -14,7 +14,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;

@ -16,7 +16,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'skill_list.php', 'name' => get_lang('ManageSkills')); $interbreadcrumb[] = array('url' => 'skill_list.php', 'name' => get_lang('ManageSkills'));

@ -16,7 +16,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'skill_list.php', 'name' => get_lang('ManageSkills')); $interbreadcrumb[] = array('url' => 'skill_list.php', 'name' => get_lang('ManageSkills'));

@ -14,7 +14,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$action = isset($_GET['action']) ? $_GET['action'] : 'list'; $action = isset($_GET['action']) ? $_GET['action'] : 'list';
$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0; $skillId = isset($_GET['id']) ? intval($_GET['id']) : 0;

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
//Adds the JS needed to use the jqgrid //Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js'); $htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
//Adds the JS needed to use the jqgrid //Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();

@ -12,7 +12,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
Skill::isAllow(); Skill::isAllowed();
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => 'index.php', 'url' => 'index.php',

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(false, true); api_protect_admin_script(false, true);
Skill::isAllow(); Skill::isAllowed();
//Adds the JS needed to use the jqgrid //Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js'); $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');

@ -109,7 +109,7 @@ if (api_is_platform_admin()) {
api_get_path(WEB_CODE_PATH).'admin/add_drh_to_user.php?u='.$userId api_get_path(WEB_CODE_PATH).'admin/add_drh_to_user.php?u='.$userId
); );
if (Skill::isAllow($userId, false)) { if (Skill::isAllowed($userId, false)) {
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon( Display::return_icon(
'skill-badges.png', 'skill-badges.png',

@ -46,7 +46,7 @@ if (!$user || !$skill) {
exit; exit;
} }
Skill::isAllow($user->getId()); Skill::isAllowed($user->getId());
$userInfo = [ $userInfo = [
'id' => $user->getId(), 'id' => $user->getId(),

@ -20,7 +20,7 @@ if (!$userId || !$skillId) {
api_not_allowed(true); api_not_allowed(true);
} }
Skill::isAllow($userId); Skill::isAllowed($userId);
$em = Database::getManager(); $em = Database::getManager();
$user = $em->find('ChamiloUserBundle:User', $userId); $user = $em->find('ChamiloUserBundle:User', $userId);

@ -15,7 +15,7 @@ if (empty($userId)) {
api_not_allowed(true); api_not_allowed(true);
} }
Skill::isAllow($userId); Skill::isAllowed($userId);
$courseId = api_get_course_int_id(); $courseId = api_get_course_int_id();
$sessionId = api_get_session_id(); $sessionId = api_get_session_id();

@ -10,7 +10,7 @@ $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
api_block_anonymous_users(); api_block_anonymous_users();
Skill::isAllow(api_get_user_id()); Skill::isAllowed(api_get_user_id());
$skill = new Skill(); $skill = new Skill();
$gradebook = new Gradebook(); $gradebook = new Gradebook();

@ -4368,7 +4368,7 @@ class CourseManager
'session_category_id' => $session_category_id 'session_category_id' => $session_category_id
); );
if (Skill::isAllow($user_id, false)) { if (Skill::isAllowed($user_id, false)) {
$em = Database::getManager(); $em = Database::getManager();
$objUser = $em->find('ChamiloUserBundle:User', $user_id); $objUser = $em->find('ChamiloUserBundle:User', $user_id);
$objCourse = $em->find('ChamiloCoreBundle:Course', $course['real_id']); $objCourse = $em->find('ChamiloCoreBundle:Course', $course['real_id']);

@ -3,6 +3,8 @@
use Chamilo\UserBundle\Entity\User; use Chamilo\UserBundle\Entity\User;
use Chamilo\UserBundle\Entity\Repository\UserRepository; use Chamilo\UserBundle\Entity\Repository\UserRepository;
use Fhaculty\Graph\Vertex;
use Fhaculty\Graph\Graph;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi; use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
/** /**
@ -98,7 +100,7 @@ class SkillProfile extends Model
Database::delete( Database::delete(
$this->table_rel_profile, $this->table_rel_profile,
array( array(
'profile_id' => $id 'profile_id' => $id,
) )
); );
@ -201,7 +203,7 @@ class SkillRelSkill extends Model
*/ */
public function getSkillParents($skill_id, $add_child_info = true) public function getSkillParents($skill_id, $add_child_info = true)
{ {
$skill_id = (int) $skill_id; $skill_id = intval($skill_id);
$sql = 'SELECT child.* FROM '.$this->table.' child $sql = 'SELECT child.* FROM '.$this->table.' child
LEFT JOIN '.$this->table.' parent LEFT JOIN '.$this->table.' parent
ON child.parent_id = parent.skill_id ON child.parent_id = parent.skill_id
@ -223,15 +225,15 @@ class SkillRelSkill extends Model
} }
/** /**
* @param int $skill_id * @param int $skillId
* @return array * @return array
*/ */
public function getDirectParents($skill_id) public function getDirectParents($skillId)
{ {
$skill_id = intval($skill_id); $skillId = (int) $skillId;
$sql = 'SELECT parent_id as skill_id $sql = 'SELECT parent_id as skill_id
FROM '.$this->table.' FROM '.$this->table.'
WHERE skill_id = '.$skill_id.' '; WHERE skill_id = '.$skillId.' ';
$result = Database::query($sql); $result = Database::query($sql);
$skill = Database::store_result($result, 'ASSOC'); $skill = Database::store_result($result, 'ASSOC');
$skill = isset($skill[0]) ? $skill[0] : null; $skill = isset($skill[0]) ? $skill[0] : null;
@ -256,7 +258,7 @@ class SkillRelSkill extends Model
$order = '' $order = ''
) { ) {
$skill_id = (int) $skill_id; $skill_id = (int) $skill_id;
$sql = 'SELECT skill.* FROM '.$this->tableSkill.' skill $sql = 'SELECT parent.* FROM '.$this->tableSkill.' skill
INNER JOIN '.$this->table.' parent INNER JOIN '.$this->table.' parent
ON parent.id = skill.id ON parent.id = skill.id
WHERE parent_id = '.$skill_id.' WHERE parent_id = '.$skill_id.'
@ -277,11 +279,11 @@ class SkillRelSkill extends Model
if (!empty($skills)) { if (!empty($skills)) {
foreach ($skills as &$skill) { foreach ($skills as &$skill) {
$skill['data'] = $skill_obj->get($skill['id']); $skill['data'] = $skill_obj->get($skill['skill_id']);
if (isset($skill['data']) && !empty($skill['data'])) { if (isset($skill['data']) && !empty($skill['data'])) {
if (!empty($done_skills)) { if (!empty($done_skills)) {
$skill['data']['passed'] = 0; $skill['data']['passed'] = 0;
if (in_array($skill['id'], $done_skills)) { if (in_array($skill['skill_id'], $done_skills)) {
$skill['data']['passed'] = 1; $skill['data']['passed'] = 1;
} }
} }
@ -325,9 +327,9 @@ class SkillRelSkill extends Model
'where' => array( 'where' => array(
'skill_id = ? AND parent_id = ?' => array( 'skill_id = ? AND parent_id = ?' => array(
$skill_id, $skill_id,
$parent_id $parent_id,
) ),
) ),
) )
); );
@ -366,9 +368,9 @@ class SkillRelGradebook extends Model
'where' => array( 'where' => array(
'gradebook_id = ? AND skill_id = ?' => array( 'gradebook_id = ? AND skill_id = ?' => array(
$gradebookId, $gradebookId,
$skillId $skillId,
) ),
) ),
) )
); );
if (!empty($result)) { if (!empty($result)) {
@ -392,9 +394,9 @@ class SkillRelGradebook extends Model
'where' => array( 'where' => array(
'skill_id = ? AND gradebook_id = ? ' => array( 'skill_id = ? AND gradebook_id = ? ' => array(
$skill_id, $skill_id,
$gradebookId $gradebookId,
) ),
) ),
), ),
'first' 'first'
); );
@ -444,7 +446,7 @@ class SkillRelGradebook extends Model
foreach ($gradebooks_to_add as $gradebook_id) { foreach ($gradebooks_to_add as $gradebook_id) {
$attributes = array( $attributes = array(
'skill_id' => $skill_id, 'skill_id' => $skill_id,
'gradebook_id' => $gradebook_id 'gradebook_id' => $gradebook_id,
); );
$this->save($attributes); $this->save($attributes);
} }
@ -533,7 +535,7 @@ class SkillRelUser extends Model
$courseId = intval($courseId); $courseId = intval($courseId);
$sessionId = $sessionId ? intval($sessionId) : null; $sessionId = $sessionId ? intval($sessionId) : null;
$whereConditions = array( $whereConditions = array(
'user_id = ? ' => intval($userId) 'user_id = ? ' => intval($userId),
); );
if ($courseId > 0) { if ($courseId > 0) {
@ -545,7 +547,7 @@ class SkillRelUser extends Model
'skill_id', 'skill_id',
$this->table, $this->table,
array( array(
'where' => $whereConditions 'where' => $whereConditions,
), ),
'all' 'all'
); );
@ -567,12 +569,12 @@ class SkillRelUser extends Model
intval($userId), intval($userId),
intval($skillId), intval($skillId),
intval($courseId), intval($courseId),
$sessionId ? intval($sessionId) : null $sessionId ? intval($sessionId) : null,
) ),
); );
return Database::select('*', $this->table, array( return Database::select('*', $this->table, array(
'where' => $where 'where' => $where,
), 'first'); ), 'first');
} }
@ -590,7 +592,7 @@ class Skill extends Model
'access_url_id', 'access_url_id',
'short_code', 'short_code',
'icon', 'icon',
'criteria' 'criteria',
); );
public $required = array('name'); public $required = array('name');
@ -629,6 +631,10 @@ class Skill extends Model
public function get($id) public function get($id)
{ {
$result = parent::get($id); $result = parent::get($id);
if (empty($result)) {
return [];
}
$path = api_get_path(WEB_UPLOAD_PATH).'badges/'; $path = api_get_path(WEB_UPLOAD_PATH).'badges/';
if (!empty($result['icon'])) { if (!empty($result['icon'])) {
@ -654,7 +660,6 @@ class Skill extends Model
$result['icon_big'] = $iconSmall; $result['icon_big'] = $iconSmall;
$result['icon_small'] = $iconBig; $result['icon_small'] = $iconBig;
$result['icon_mini'] = $iconMini; $result['icon_mini'] = $iconMini;
$result['img_mini'] = Display::img($iconBig, $result['name'], ['width' => ICON_SIZE_MEDIUM]); $result['img_mini'] = Display::img($iconBig, $result['name'], ['width' => ICON_SIZE_MEDIUM]);
$result['img_big'] = Display::img($iconBig, $result['name']); $result['img_big'] = Display::img($iconBig, $result['name']);
$result['img_small'] = Display::img($iconSmall, $result['name']); $result['img_small'] = Display::img($iconSmall, $result['name']);
@ -688,6 +693,9 @@ class Skill extends Model
} }
$html .= '<ul class="list-unstyled list-badges">'; $html .= '<ul class="list-unstyled list-badges">';
foreach ($skills as $skill) { foreach ($skills as $skill) {
if (isset($skill['data'])) {
$skill = $skill['data'];
}
$html .= '<li class="thumbnail">'; $html .= '<li class="thumbnail">';
$item = $skill[$imageSize]; $item = $skill[$imageSize];
$item .= '<div class="caption"> $item .= '<div class="caption">
@ -709,6 +717,41 @@ class Skill extends Model
return $html; return $html;
} }
/**
* @param $skills
* @param string $imageSize
* @param string $style
* @return string
*/
public function processSkillListSimple($skills, $imageSize = '', $style = '')
{
if (empty($skills)) {
return '';
}
if (empty($imageSize)) {
$imageSize = 'img_small';
} else {
$imageSize = "img_$imageSize";
}
$html = '';
foreach ($skills as $skill) {
if (isset($skill['data'])) {
$skill = $skill['data'];
}
$item = $skill[$imageSize];
$item .= $skill['name'];
if (isset($skill['url'])) {
$html .= Display::url($item, $skill['url'], ['target' => '_blank', 'style' => $style]);
} else {
$html .= Display::url($item, '#', ['target' => '_blank', 'style' => $style]);
}
}
return $html;
}
/** /**
* @param int $id * @param int $id
* @return array * @return array
@ -888,7 +931,7 @@ class Skill extends Model
$skillRelSkill = new SkillRelSkill(); $skillRelSkill = new SkillRelSkill();
$skills = $skillRelSkill->getSkillParents($skillId, true); $skills = $skillRelSkill->getSkillParents($skillId, true);
foreach ($skills as &$skill) { foreach ($skills as &$skill) {
$skill['data'] = self::get($skill['skill_id']); $skill['data'] = $this->get($skill['skill_id']);
} }
return $skills; return $skills;
} }
@ -902,14 +945,24 @@ class Skill extends Model
{ {
$skillRelSkill = new SkillRelSkill(); $skillRelSkill = new SkillRelSkill();
$skills = $skillRelSkill->getDirectParents($skillId, true); $skills = $skillRelSkill->getDirectParents($skillId, true);
if (!empty($skills)) {
foreach ($skills as &$skill) { foreach ($skills as &$skill) {
$skill['data'] = self::get($skill['skill_id']); $skillData = $this->get($skill['skill_id']);
if (empty($skillData)) {
continue;
}
$skill['data'] = $skillData;
$skill_info2 = $skillRelSkill->getSkillInfo($skill['skill_id']); $skill_info2 = $skillRelSkill->getSkillInfo($skill['skill_id']);
$skill['data']['parent_id'] = $skill_info2['parent_id']; $parentId = isset($skill_info2['parent_id']) ? isset($skill_info2['parent_id']) : 0;
$skill['data']['parent_id'] = $parentId;
} }
return $skills; return $skills;
} }
return [];
}
/** /**
* Adds a new skill * Adds a new skill
* @param array $params * @param array $params
@ -990,7 +1043,7 @@ class Skill extends Model
'skill_id' => $skill_gradebook['skill_id'], 'skill_id' => $skill_gradebook['skill_id'],
'acquired_skill_at' => api_get_utc_datetime(), 'acquired_skill_at' => api_get_utc_datetime(),
'course_id' => intval($courseId), 'course_id' => intval($courseId),
'session_id' => $sessionId ? intval($sessionId) : null 'session_id' => $sessionId ? intval($sessionId) : null,
); );
$skill_rel_user->save($params); $skill_rel_user->save($params);
@ -1069,7 +1122,9 @@ class Skill extends Model
* Get user's skills * Get user's skills
* *
* @param int $userId User's id * @param int $userId User's id
* @param bool $get_skill_data * @param bool $getSkillData
* @param int $courseId
* @param int $sessionId
* *
* @return array * @return array
*/ */
@ -1104,7 +1159,6 @@ class Skill extends Model
$result = Database::query($sql); $result = Database::query($sql);
$skills = Database::store_result($result, 'ASSOC'); $skills = Database::store_result($result, 'ASSOC');
$uploadPath = api_get_path(WEB_UPLOAD_PATH);
$skillList = array(); $skillList = array();
if (!empty($skills)) { if (!empty($skills)) {
foreach ($skills as $skill) { foreach ($skills as $skill) {
@ -1121,30 +1175,67 @@ class Skill extends Model
return $skillList; return $skillList;
} }
/**
* @param Vertex $vertex
* @return string
*/
public function processVertex(Vertex $vertex, $skills = [])
{
$subTable = '';
if ($vertex->getVerticesEdgeTo()->count() > 0) {
$subTable .= '<ul>';
foreach ($vertex->getVerticesEdgeTo() as $subVertex) {
$data = $subVertex->getAttribute('graphviz.data');
$passed = in_array($data['id'], array_keys($skills));
$transparency = '';
if ($passed === false) {
// @todo use css class
$transparency = 'opacity: 0.4; filter: alpha(opacity=40);';
}
$label = $this->processSkillListSimple([$data], 'mini', $transparency);
/*$subTable .= '<div style="float:left; margin-right:5px; ">';
$subTable .= '<div style="'.$transparency.'">';
$subTable .= $label;
$subTable .= '</div>';*/
$subTable .= '<li>'.$label;
$subTable .= $this->processVertex($subVertex, $skills);
$subTable .= '</li>';
}
$subTable .= '</ul>';
}
return $subTable;
}
/** /**
* @param int $userId * @param int $userId
* @param int $courseId * @param int $courseId
* @param int $sessionId * @param int $sessionId
* *
* @return string * @return array
*/ */
public function getUserSkillsTable($userId, $courseId = 0, $sessionId = 0) public function getUserSkillsTable($userId, $courseId = 0, $sessionId = 0)
{ {
$skills = $this->getUserSkills($userId, true, $courseId, $sessionId); $skills = $this->getUserSkills($userId, true, $courseId, $sessionId);
$courseTempList = []; $courseTempList = [];
$skillParents = [];
$tableRows = []; $tableRows = [];
$skillParents = [];
foreach ($skills as $resultData) { foreach ($skills as $resultData) {
$parents = $this->get_parents($resultData['id']); $parents = $this->get_parents($resultData['id']);
foreach ($parents as $parentData) { foreach ($parents as $parentData) {
if ($parentData['id'] == 1 || $parentData['parent_id'] == 1) { $parentData['passed'] = in_array($parentData['id'], array_keys($skills));
continue; $skillParents[$resultData['id']][$parentData['id']] = $parentData;
} }
$skillParents[$parentData['id']]['passed'] = in_array($parentData['id'], array_keys($skills));
$skillParents[$parentData['id']][] = $resultData;
} }
foreach ($skills as $resultData) {
$courseId = $resultData['course_id']; $courseId = $resultData['course_id'];
if (!empty($courseId)) { if (!empty($courseId)) {
if (isset($courseTempList[$courseId])) { if (isset($courseTempList[$courseId])) {
@ -1157,10 +1248,10 @@ class Skill extends Model
$tableRow = array( $tableRow = array(
'skill_badge' => $resultData['img_mini'], 'skill_badge' => $resultData['img_mini'],
'skill_name' => Skill::translateName($resultData['name']), 'skill_name' => self::translateName($resultData['name']),
'achieved_at' => api_get_local_time($resultData['acquired_skill_at']), 'achieved_at' => api_get_local_time($resultData['acquired_skill_at']),
'course_image' => '', 'course_image' => '',
'course_name' => '' 'course_name' => '',
); );
if (!empty($courseInfo)) { if (!empty($courseInfo)) {
@ -1169,11 +1260,10 @@ class Skill extends Model
} }
$tableRows[] = $tableRow; $tableRows[] = $tableRow;
} }
$allowLevels = api_get_configuration_value('skill_levels_names'); $allowLevels = api_get_configuration_value('skill_levels_names');
$tableResult = '<div class="table-responsive"> $tableResult = '<div class="table-responsive" >
<table class="table" id="skillList"> <table class="table" >
<thead> <thead>
<tr> <tr>
<th>'.get_lang('AchievedSkills').'</th> <th>'.get_lang('AchievedSkills').'</th>
@ -1181,47 +1271,66 @@ class Skill extends Model
</thead> </thead>
<tbody> <tbody>
<tr><td>'; <tr><td>';
//$allowLevels = [];
if (!empty($skillParents)) { if (!empty($skillParents)) {
if (empty($allowLevels)) { if (empty($allowLevels)) {
$tableResult .= $this->processSkillList($skills); $tableResult .= $this->processSkillListSimple($skills);
} else { } else {
$table = new HTML_Table(['class' => 'table table-bordered']); $graph = new Graph();
if (!empty($skillParents)) { $graph->setAttribute('graphviz.graph.rankdir', 'LR');
$column = 0; foreach ($skillParents as $skillId => $parentList) {
$skillAdded = []; $old = null;
foreach ($skillParents as $parentId => $data) { foreach ($parentList as $parent) {
if (in_array($parentId, $skillAdded)) { if ($graph->hasVertex($parent['id'])) {
continue; $current = $graph->getVertex($parent['id']);
} else {
$current = $graph->createVertex($parent['id']);
$current->setAttribute('graphviz.data', $parent['data']);
} }
$parentName = '';
if ($data['passed']) { if (!empty($old)) {
$parentInfo = $skills[$parentId]; if ($graph->hasVertex($old['id'])) {
$parentName = $this->processSkillList([$parentInfo], 'mini', false); $nextVertex = $graph->getVertex($old['id']);
} else {
$nextVertex = $graph->createVertex($old['id']);
$nextVertex->setAttribute('graphviz.data', $old['data']);
} }
$table->setHeaderContents(0, $column, $parentName);
$row = 1; if (!$nextVertex->hasEdgeTo($current)) {
$skillsToShow = []; $nextVertex->createEdgeTo($current);
foreach ($data as $skillData) {
if ($skillData['id'] == $parentId) {
continue;
} }
if (empty($skillData['id'])) {
continue;
} }
$skillAdded[] = $skillData['id']; $old = $parent;
$skillsToShow[] = $skillData;
} }
$table->setCellContents(
$row,
$column,
$this->processSkillList($skillsToShow, 'mini', false)
);
$row++;
$column++;
} }
$table = '<table class ="table table-bordered">';
// Getting "root" vertex
$root = $graph->getVertex(1);
$table .= '<tr>';
/** @var Vertex $vertex */
foreach ($root->getVerticesEdgeTo() as $vertex) {
$data = $vertex->getAttribute('graphviz.data');
$passed = in_array($data['id'], array_keys($skills));
$transparency = '';
if ($passed === false) {
// @todo use a css class
$transparency = 'opacity: 0.4; filter: alpha(opacity=40);';
} }
$tableResult .= $table->toHtml();
$label = $this->processSkillListSimple([$data], 'mini', $transparency);
$table .= '<td >';
//$table .= '<div style="'.$transparency.'">';
$table .= '<div class="organigrama"> <ul><li>'.$label;
$table .= $this->processVertex($vertex, $skills);
$table .= '</ul></li></div>';
$table .= '</td>';
}
$table .= '</tr></table>';
$tableResult .= $table;
} }
} else { } else {
$tableResult .= get_lang('WithoutAchievedSkills'); $tableResult .= get_lang('WithoutAchievedSkills');
@ -1236,7 +1345,7 @@ class Skill extends Model
return [ return [
'skills' => $tableRows, 'skills' => $tableRows,
'table' => $tableResult 'table' => $tableResult,
]; ];
} }
@ -1272,7 +1381,7 @@ class Skill extends Model
$skills[1] = array( $skills[1] = array(
'id' => '1', 'id' => '1',
'name' => get_lang('Root'), 'name' => get_lang('Root'),
'parent_id' => '0' 'parent_id' => '0',
); );
$skillInfo = $this->getSkillInfo($skill_id); $skillInfo = $this->getSkillInfo($skill_id);
@ -1369,7 +1478,6 @@ class Skill extends Model
$flat_array[$skill_id] = $skills[$skill_id]; $flat_array[$skill_id] = $skills[$skill_id];
} else { } else {
// Moving node to the children index of their parents // Moving node to the children index of their parents
foreach ($skills as $my_skill_id => &$skill) { foreach ($skills as $my_skill_id => &$skill) {
if (isset($new_family_array[$skill['id']])) { if (isset($new_family_array[$skill['id']])) {
$skill['data']['family_id'] = $new_family_array[$skill['id']]; $skill['data']['family_id'] = $new_family_array[$skill['id']];
@ -1383,7 +1491,7 @@ class Skill extends Model
'name' => get_lang('SkillRootName'), 'name' => get_lang('SkillRootName'),
'id' => 'root', 'id' => 'root',
'children' => $refs['root']['children'], 'children' => $refs['root']['children'],
'data' => array() 'data' => array(),
); );
} }
@ -1424,7 +1532,7 @@ class Skill extends Model
} }
$simple_tree[] = array( $simple_tree[] = array(
'name' => $element['name'], 'name' => $element['name'],
'children' => $children 'children' => $children,
); );
} }
} }
@ -1613,7 +1721,7 @@ class Skill extends Model
$whereConditions = array( $whereConditions = array(
'user_id = ? ' => intval($userId), 'user_id = ? ' => intval($userId),
'AND skill_id = ? ' => intval($skillId) 'AND skill_id = ? ' => intval($skillId),
); );
if ($courseId > 0) { if ($courseId > 0) {
@ -1625,7 +1733,7 @@ class Skill extends Model
'COUNT(1) AS qty', 'COUNT(1) AS qty',
$this->table_skill_rel_user, $this->table_skill_rel_user,
array( array(
'where' => $whereConditions 'where' => $whereConditions,
), ),
'first' 'first'
); );
@ -1659,8 +1767,8 @@ class Skill extends Model
$skillRelProfileTable, $skillRelProfileTable,
array( array(
'where' => array( 'where' => array(
'skill_id = ?' => $id 'skill_id = ?' => $id,
) ),
), ),
'first' 'first'
); );
@ -1851,7 +1959,7 @@ class Skill extends Model
* *
* @return bool * @return bool
*/ */
public static function isAllow($studentId = 0, $blockPage = true) public static function isAllowed($studentId = 0, $blockPage = true)
{ {
if (self::isToolAvailable()) { if (self::isToolAvailable()) {
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
@ -1889,7 +1997,7 @@ class Skill extends Model
{ {
$allowTool = api_get_setting('allow_skills_tool'); $allowTool = api_get_setting('allow_skills_tool');
if ($allowTool == 'true') { if ($allowTool === 'true') {
return true; return true;
} }
@ -1907,13 +2015,14 @@ class Skill extends Model
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
return true; return true;
} }
// ofaj
if (api_is_student_boss()) { if (api_is_student_boss()) {
$isBoss = UserManager::userIsBossOfStudent($currentUserId, $studentId); $isBoss = UserManager::userIsBossOfStudent($currentUserId, $studentId);
if ($isBoss) { if ($isBoss) {
return true; return true;
} }
} }
$allow = api_get_configuration_value('allow_private_skills'); $allow = api_get_configuration_value('allow_private_skills');
if ($allow === true) { if ($allow === true) {
if (api_is_teacher()) { if (api_is_teacher()) {
@ -1955,7 +2064,7 @@ class Skill extends Model
foreach ($result as $item) { foreach ($result as $item) {
$skills[] = [ $skills[] = [
'name' => self::translateName($item['name']), 'name' => self::translateName($item['name']),
'acquired_skill_at' => $item['acquired_skill_at'] 'acquired_skill_at' => $item['acquired_skill_at'],
]; ];
} }
@ -1973,6 +2082,10 @@ class Skill extends Model
return isset($GLOBALS[$variable]) ? $GLOBALS[$variable] : $name; return isset($GLOBALS[$variable]) ? $GLOBALS[$variable] : $name;
} }
/**
* @param string $code
* @return mixed|string
*/
public static function translateCode($code) public static function translateCode($code)
{ {
if (empty($code)) { if (empty($code)) {

@ -2155,7 +2155,7 @@ class SocialManager extends UserManager
*/ */
public static function getSkillBlock($userId) public static function getSkillBlock($userId)
{ {
if (Skill::isAllow($userId, false) === false) { if (Skill::isAllowed($userId, false) === false) {
return ''; return '';
} }

@ -6454,7 +6454,7 @@ class Tracking
*/ */
public static function displayUserSkills($userId, $courseId = 0, $sessionId = 0) public static function displayUserSkills($userId, $courseId = 0, $sessionId = 0)
{ {
if (Skill::isAllow($userId, false) === false) { if (Skill::isAllowed($userId, false) === false) {
return ''; return '';
} }
$skillManager = new Skill(); $skillManager = new Skill();

@ -395,7 +395,7 @@ class IndexManager
]; ];
} }
if (Skill::isAllow(0, false)) { if (Skill::isAllowed(0, false)) {
$items[] = [ $items[] = [
'icon' => Display::return_icon('skill-badges.png', get_lang('MySkills')), 'icon' => Display::return_icon('skill-badges.png', get_lang('MySkills')),
'link' => api_get_path(WEB_CODE_PATH).'social/my_skills_report.php', 'link' => api_get_path(WEB_CODE_PATH).'social/my_skills_report.php',

@ -10,7 +10,7 @@
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$userId = api_get_user_id(); $userId = api_get_user_id();
Skill::isAllow($userId); Skill::isAllowed($userId);
$isStudent = api_is_student(); $isStudent = api_is_student();
$isStudentBoss = api_is_student_boss(); $isStudentBoss = api_is_student_boss();
@ -46,7 +46,7 @@ if ($isStudent) {
$tpl->assign('skill_table', $result['table']); $tpl->assign('skill_table', $result['table']);
$tplPath = 'skill/student_report.tpl'; $tplPath = 'skill/student_report.tpl';
} elseif ($isStudentBoss) { } elseif ($isStudentBoss) {
$selectedStudent = isset($_REQUEST['student']) ? intval($_REQUEST['student']) : 0; $selectedStudent = isset($_REQUEST['student']) ? (int) $_REQUEST['student'] : 0;
$tableRows = array(); $tableRows = array();
$followedStudents = UserManager::getUsersFollowedByStudentBoss($userId); $followedStudents = UserManager::getUsersFollowedByStudentBoss($userId);
@ -68,10 +68,10 @@ if ($isStudent) {
while ($resultData = Database::fetch_assoc($result)) { while ($resultData = Database::fetch_assoc($result)) {
$tableRow = array( $tableRow = array(
'completeName' => $followedStudents[$selectedStudent]['completeName'], 'complete_name' => $followedStudents[$selectedStudent]['completeName'],
'skillName' => Skill::translateName($resultData['name']), 'skill_name' => Skill::translateName($resultData['name']),
'achievedAt' => api_format_date($resultData['acquired_skill_at'], DATE_FORMAT_NUMBER), 'achieved_at' => api_format_date($resultData['acquired_skill_at'], DATE_FORMAT_NUMBER),
'courseImage' => Display::return_icon( 'course_image' => Display::return_icon(
'course.png', 'course.png',
null, null,
null, null,
@ -79,7 +79,7 @@ if ($isStudent) {
null, null,
true true
), ),
'courseName' => $resultData['title'] 'course_name' => $resultData['title']
); );
$imageSysPath = sprintf("%s%s/course-pic.png", api_get_path(SYS_COURSE_PATH), $resultData['directory']); $imageSysPath = sprintf("%s%s/course-pic.png", api_get_path(SYS_COURSE_PATH), $resultData['directory']);
@ -100,8 +100,8 @@ if ($isStudent) {
} }
$tplPath = 'skill/student_boss_report.tpl'; $tplPath = 'skill/student_boss_report.tpl';
$tpl->assign('followedStudents', $followedStudents); $tpl->assign('followed_students', $followedStudents);
$tpl->assign('selectedStudent', $selectedStudent); $tpl->assign('selected_student', $selectedStudent);
} elseif ($isDRH) { } elseif ($isDRH) {
$selectedCourse = isset($_REQUEST['course']) ? intval($_REQUEST['course']) : null; $selectedCourse = isset($_REQUEST['course']) ? intval($_REQUEST['course']) : null;
$selectedSkill = isset($_REQUEST['skill']) ? intval($_REQUEST['skill']) : 0; $selectedSkill = isset($_REQUEST['skill']) ? intval($_REQUEST['skill']) : 0;
@ -152,9 +152,9 @@ if ($isStudent) {
} }
foreach ($tableRows as &$row) { foreach ($tableRows as &$row) {
$row['completeName'] = api_get_person_name($row['firstname'], $row['lastname']); $row['complete_name'] = api_get_person_name($row['firstname'], $row['lastname']);
$row['achievedAt'] = api_format_date($row['acquired_skill_at'], DATE_FORMAT_NUMBER); $row['achieved_at'] = api_format_date($row['acquired_skill_at'], DATE_FORMAT_NUMBER);
$row['courseImage'] = Display::return_icon( $row['course_image'] = Display::return_icon(
'course.png', 'course.png',
null, null,
null, null,
@ -175,20 +175,22 @@ if ($isStudent) {
$courseImageThumb->send_image($thumbSysPath); $courseImageThumb->send_image($thumbSysPath);
} }
$row['courseImage'] = $thumbWebPath; $row['course_image'] = $thumbWebPath;
} }
} }
$tplPath = 'skill/drh_report.tpl'; $tplPath = 'skill/drh_report.tpl';
$tpl->assign('action', $action); $tpl->assign('action', $action);
$tpl->assign('courses', $courses); $tpl->assign('courses', $courses);
$tpl->assign('skills', $skills); $tpl->assign('skills', $skills);
$tpl->assign('selectedCourse', $selectedCourse); $tpl->assign('selected_course', $selectedCourse);
$tpl->assign('selectedSkill', $selectedSkill); $tpl->assign('selected_skill', $selectedSkill);
$tpl->assign('reportTitle', $reportTitle); $tpl->assign('report_title', $reportTitle);
} }
if (empty($tableRows)) {
Display::addFlash(Display::return_message(get_lang('NoResults')));
}
$tpl->assign('rows', $tableRows); $tpl->assign('rows', $tableRows);
$templateName = $tpl->get_template($tplPath); $templateName = $tpl->get_template($tplPath);
$contentTemplate = $tpl->fetch($templateName); $contentTemplate = $tpl->fetch($templateName);

@ -10,7 +10,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users(); api_block_anonymous_users();
Skill::isAllow(api_get_user_id()); Skill::isAllowed(api_get_user_id());
//Add the JS needed to use the jqgrid //Add the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();

@ -11,7 +11,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_MYPROFILE; $this_section = SECTION_MYPROFILE;
api_block_anonymous_users(); api_block_anonymous_users();
Skill::isAllow(api_get_user_id()); Skill::isAllowed(api_get_user_id());
//Adds the JS needed to use the jqgrid //Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();

@ -10,7 +10,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_SOCIAL; $this_section = SECTION_SOCIAL;
api_block_anonymous_users(); api_block_anonymous_users();
Skill::isAllow(api_get_user_id()); Skill::isAllowed(api_get_user_id());
//Adds the JS needed to use the jqgrid //Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js'); $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');

@ -1,14 +1,17 @@
{% if allowSkillsTool %} {% if allow_skill_tool %}
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a> <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">
{% if allowDrhSkillsManagement %} {{ 'SkillsWheel' | get_lang }}
<a class="btn btn-default" href="{{ _p.web_main }}admin/skills_wheel.php">{{ 'ManageSkills' | get_lang }}</a> </a>
{% if allow_drh_skills_management %}
<a class="btn btn-default" href="{{ _p.web_main }}admin/skills_wheel.php">
{{ 'ManageSkills' | get_lang }}
</a>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
<h1 class="page-header">{{ 'Skills' | get_lang }}</h1> <h1 class="page-header">{{ 'Skills' | get_lang }}</h1>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<form class="form-inline" method="post" action="{{ _p.web_self }}"> <form class="form-inline" method="post" action="{{ _p.web_self }}">
@ -16,10 +19,12 @@
<select name="course" id="course"> <select name="course" id="course">
<option value="0">{{ 'Select' | get_lang }}</option> <option value="0">{{ 'Select' | get_lang }}</option>
{% for course in courses %} {% for course in courses %}
<option value="{{ course.id }}" {{ (course.id == selectedCourse) ? 'selected' : '' }}>{{ course.title }}</option> <option value="{{ course.id }}" {{ (course.id == selected_course) ? 'selected' : '' }}>{{ course.title }}</option>
{% endfor %} {% endfor %}
</select> </select>
<button type="submit" class="btn btn-default">{{ 'Filter' | get_lang }}</button> <button type="submit" class="btn btn-default">
{{ 'Filter' | get_lang }}
</button>
</form> </form>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@ -28,16 +33,19 @@
<select name="skill" id="skill"> <select name="skill" id="skill">
<option value="0">{{ 'Select' | get_lang }}</option> <option value="0">{{ 'Select' | get_lang }}</option>
{% for skill in skills %} {% for skill in skills %}
<option value="{{ skill.id }}" {{ (skill.id == selectedSkill) ? 'selected' : '' }}>{{ skill.name }}</option> <option value="{{ skill.id }}" {{ (skill.id == selected_skill) ? 'selected' : '' }}>
{{ skill.name }}
</option>
{% endfor %} {% endfor %}
</select> </select>
<button type="submit" class="btn btn-default"><em class="fa fa-filter"></em>{{ 'Filter' | get_lang }}</button> <button type="submit" class="btn btn-default"><em class="fa fa-filter"></em>
{{ 'Filter' | get_lang }}
</button>
</form> </form>
</div> </div>
</div> </div>
<h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2> <h2 class="page-header">{{ report_title }}</h2>
{% if rows %} {% if rows %}
<table class="table"> <table class="table">
<thead> <thead>
@ -61,20 +69,16 @@
{% if action == 'filterByCourse' %} {% if action == 'filterByCourse' %}
<td><img src="{{ row.courseImage }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td> <td><img src="{{ row.courseImage }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td>
<td>{{ row.skill_name }}</td> <td>{{ row.skill_name }}</td>
<td>{{ row.completeName }}</td> <td>{{ row.complete_name }}</td>
<td>{{ row.achievedAt }}</td> <td>{{ row.achieved_at }}</td>
{% elseif action == 'filterBySkill' %} {% elseif action == 'filterBySkill' %}
<td>{{ row.skill_name }}</td> <td>{{ row.skill_name }}</td>
<td>{{ row.completeName }}</td> <td>{{ row.complete_name }}</td>
<td>{{ row.achievedAt }}</td> <td>{{ row.achieved_at }}</td>
<td><img src="{{ row.courseImage }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td> <td><img src="{{ row.course_image }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %}
<div class="alert alert-info">
{{ 'NoResults' | get_lang }}
</div>
{% endif %} {% endif %}

@ -1,6 +1,8 @@
{% if allowSkillsTool %} {% if allow_skill_tool %}
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a> <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">
{{ 'SkillsWheel' | get_lang }}
</a>
</div> </div>
{% endif %} {% endif %}
@ -10,8 +12,10 @@
<label>{{ 'Students' | get_lang }}</label> <label>{{ 'Students' | get_lang }}</label>
<select name="student" id="student"> <select name="student" id="student">
<option value="0">{{ 'Select' | get_lang }}</option> <option value="0">{{ 'Select' | get_lang }}</option>
{% for student in followedStudents %} {% for student in followed_students %}
<option value="{{ student.user_id }}" {{ (student.user_id == selectedStudent) ? 'selected' : '' }}>{{ student.completeName }}</option> <option value="{{ student.user_id }}" {{ (student.user_id == selected_student) ? 'selected' : '' }}>
{{ student.completeName }}
</option>
{% endfor %} {% endfor %}
</select> </select>
<button type="submit" class="btn btn-primary">{{ 'Search' | get_lang }}</button> <button type="submit" class="btn btn-primary">{{ 'Search' | get_lang }}</button>
@ -30,16 +34,12 @@
<tbody> <tbody>
{% for row in rows %} {% for row in rows %}
<tr> <tr>
<td>{{ row.completeName }}</td> <td>{{ row.complete_name }}</td>
<td>{{ row.skillName }}</td> <td>{{ row.skill_name }}</td>
<td>{{ row.achievedAt }}</td> <td>{{ row.achieved_at }}</td>
<td><img src="{{ row.courseImage }}" alt="{{ row.courseName }}"> {{ row.courseName }}</td> <td><img src="{{ row.course_image }}" alt="{{ row.course_name }}"> {{ row.course_name }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %}
<div class="alert alert-info">
{{ 'NoResults' | get_lang }}
</div>
{% endif %} {% endif %}

@ -1,15 +1,122 @@
{% if allowSkillsTool %} {% if allow_skill_tool %}
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">{{ 'SkillsWheel' | get_lang }}</a> <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">
{{ 'SkillsWheel' | get_lang }}
</a>
</div> </div>
{% endif %} {% endif %}
<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1> <style>
.organigrama * {
margin: 0px;
padding: 0px;
}
.organigrama ul {
padding-top: 20px;
position: relative;
}
.organigrama li {
float: left;
text-align: center;
list-style-type: none;
padding: 20px 5px 0px 5px;
position: relative;
}
.organigrama li::before, .organigrama li::after {
content: '';
position: absolute;
top: 0px;
right: 50%;
border-top: 1px solid #A4DC2D;
width: 50%;
height: 20px;
}
.organigrama li::after{
right: auto;
left: 50%;
border-left: 1px solid #A4DC2D;
}
.organigrama li:only-child::before, .organigrama li:only-child::after {
display: none;
}
.organigrama li:only-child {
padding-top: 0;
}
.organigrama li:first-child::before, .organigrama li:last-child::after{
border: 0 none;
}
.organigrama li:last-child::before{
border-right: 1px solid #A4DC2D;
-webkit-border-radius: 0 5px 0 0;
-moz-border-radius: 0 5px 0 0;
border-radius: 0 5px 0 0;
}
.organigrama li:first-child::after{
border-radius: 5px 0 0 0;
-webkit-border-radius: 5px 0 0 0;
-moz-border-radius: 5px 0 0 0;
}
.organigrama ul ul::before {
content: '';
position: absolute;
top: 0;
left: 50%;
border-left: 1px solid #A4DC2D;
width: 0;
height: 20px;
}
.organigrama li a {
border: 1px solid #A4DC2D;
padding: 1em 0.75em;
text-decoration: none;
color: #333;
background-color: rgba(255,255,255,0.5);
font-family: arial, verdana, tahoma;
font-size: 0.85em;
display: inline-block;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-transition: all 500ms;
-moz-transition: all 500ms;
transition: all 500ms;
}
.organigrama li a:hover {
border: 1px solid #fff;
color: #ddd;
background-color: rgba(185, 244, 46, 0.7);
display: inline-block;
}
.organigrama > ul > li > a {
font-size: 1em;
font-weight: bold;
}
.organigrama > ul > li > ul > li > a {
width: 8em;
}
</style>
{% if rows %} {% if rows %}
<h1 class="page-header">{{ 'SkillsAcquired' | get_lang }}</h1>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>{{ 'Badge' | get_lang }}</th>
<th>{{ 'Skill' | get_lang }}</th> <th>{{ 'Skill' | get_lang }}</th>
<th>{{ 'Date' | get_lang }}</th> <th>{{ 'Date' | get_lang }}</th>
<th>{{ 'Course' | get_lang }}</th> <th>{{ 'Course' | get_lang }}</th>
@ -18,15 +125,22 @@
<tbody> <tbody>
{% for row in rows %} {% for row in rows %}
<tr> <tr>
<td>{{ row.skillName }}</td> <td>{{ row.skill_badge }}</td>
<td>{{ row.achievedAt }}</td> <td>{{ row.skill_name }}</td>
<td><img src="{{ row.courseImage }}" alt="{{ row.courseName }}" width="32"> {{ row.courseName }}</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> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %} {% if skill_table %}
<div class="alert alert-info"> {{ skill_table }}
{{ 'NoResults' | get_lang }} {% endif %}
</div>
{% endif %} {% endif %}

Loading…
Cancel
Save