diff --git a/assets/css/app.scss b/assets/css/app.scss index f65ab79b7b..382aa68adb 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -255,211 +255,6 @@ text-decoration: underline; } -#skillList .header-title{ - padding: 8px; - border-bottom: 2px solid #ddd; - font-weight: bold; - margin-bottom: 15px; -} -.skills-badges{ - display: grid; - grid-gap: 1rem; - grid-row-gap: 16px; - grid-template-columns: repeat(6, 1fr); -} -.skills-badges .item{ - display: inline-block; - width: 100%; - text-align: center; - justify-content: center; - align-items: center; -} -.skills-badges a .caption{ - text-align: center; -} -.list-horizontal .list-skills{ - display: grid; - grid-gap: 1rem; - grid-row-gap: 16px; - grid-template-columns: repeat(4, 1fr); -} -.list-vertical .list-skills{ - display: grid; - grid-gap: 1rem; - grid-row-gap: 16px; - grid-template-columns: repeat(2, 1fr); -} -.list-skills .item{ - display: inline-block; - width: 100%; - text-align: center; - justify-content: center; - align-items: center; -} -.skill-options .legend { - border: 1px dashed #cccccc; - padding: 1em; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; - margin-bottom: 1em; - margin-top: 1em; - background-color: #FFFFFF; -} - -.skill-options .skill-home { - margin-top: 1em; - margin-bottom: 1em; -} - -.skill-options .btn-block { - box-sizing: border-box; - display: block; - padding-left: 0; - padding-right: 0; - width: 100%; -} - -.skill-options .accordion-inner { - padding: 9px 15px; - /*border: 1px solid #dadada;*/ - background-color: #FFFFFF; -} - -.skill-options .load_wheel { -} - -.skill-options .skill-winner { - list-style: none; - margin: 0; - padding: 0; -} - -.skill-options .skill-winner li { - float: left; - margin-right: 1em; - padding-bottom: 1em; -} - -.skill-options .skill-winner li a { - /*background: url("/main/img/icons/16/winner.png") no-repeat;*/ - padding-left: 1.5em; - padding-bottom: 1em; -} - -.search-skill ul.holder li.bit-input input { - width: 100%; -} - -.skill-legend-basic { - color: #3A87AD; -} - -.skill-legend-add { - color: #F89406; -} - -.skill-legend-search { - color: #B94A48; -} - -.skill-legend-badges { - color: #31A354; -} - -.page-skill .panel-default { - border-color: #DDDDDD; -} - -.page-skill .btn-default { - background-color: #F6F6F6; -} - -.page-skill .btn-default:hover { - background-color: #E6E6E6; -} - -.page-skill #skill_info { - font-size: 12px; -} - -.page-skill #skill_wheel tspan { - font-size: 12px; -} - -.page-skill .holder_simple li.bit-box a { - color: #8A6D3B; -} - -.skill_partition { - cursor: pointer; - stroke: #000000; - stroke-width: 0.5px; -} - -.items-user .avatar-user { - text-align: center; - margin-bottom: 10px; -} - -.items-user p { - font-size: 12px; - margin-bottom: 5px; -} - -.items-user .list-group { - font-size: 12px; -} - -table#skill_holder { - margin-top: 15px; -} - -.badges-sidebar { - height: 250px; -} - -.panel figure figcaption { - background: none; - text-align: center; -} - -.skill_root { - box-shadow: 2px 2px 19px #aaa; - border-radius: 6px; - background-color: #ccc; - border: 0.1em dotted #D4E06B; - color: black; - font-size: 0.9em; - height: 4em; - opacity: 0.8; - padding-top: 0.9em; - text-align: center; - width: 120px; - z-index: 40; - position: relative; -} - -.skill_child { - box-shadow: 2px 2px 19px #aaa; - border-radius: 6px; - background-color: white; - border: 0.1em dotted #D4E06B; - color: black; - font-size: 0.9em; - height: 4em; - opacity: 0.8; - padding-top: 0.9em; - text-align: center; - width: 120px; - z-index: 40; - float: left; - margin-left: 20px; - margin-bottom: 20px; - margin-top: 10px; - position: relative; -} - .category-forum .custom-panel-group { width: 100%; } diff --git a/assets/css/scss/index.scss b/assets/css/scss/index.scss index 1053d94406..d9bbde06fe 100755 --- a/assets/css/scss/index.scss +++ b/assets/css/scss/index.scss @@ -72,3 +72,4 @@ @import 'lp'; @import "userreluser"; @import 'social'; +@import 'skill'; diff --git a/assets/vue/components/social/MySkillsCard.vue b/assets/vue/components/social/MySkillsCard.vue index 9f6dd1ea1d..7a40899dc2 100644 --- a/assets/vue/components/social/MySkillsCard.vue +++ b/assets/vue/components/social/MySkillsCard.vue @@ -13,10 +13,10 @@
{{ skill.name }}
- +

{{ t('Without achieved skills') }}

diff --git a/public/main/inc/lib/SkillModel.php b/public/main/inc/lib/SkillModel.php index 9de3b044e8..ea1c3cd1fc 100644 --- a/public/main/inc/lib/SkillModel.php +++ b/public/main/inc/lib/SkillModel.php @@ -1286,12 +1286,12 @@ class SkillModel extends Model */ public function getCountSkillsByCourse($courseCode) { - $courseCode = Database::escape_string($courseCode); + $cid = api_get_course_int_id($courseCode); $sql = "SELECT count(skill_id) as count FROM {$this->table_gradebook} g INNER JOIN {$this->table_skill_rel_gradebook} sg ON g.id = sg.gradebook_id - WHERE course_code = '$courseCode'"; + WHERE c_id = '$cid'"; $result = Database::query($sql); if (Database::num_rows($result)) { diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index 27b2f878f3..4e3d585026 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -1334,6 +1334,47 @@ function _api_format_user($user, $add_password = false, $loadAvatars = true) $result['avatar_no_query'] = ''; $result['avatar_small'] = ''; $result['avatar_medium'] = ''; + + if (empty($user['avatar'])) { + $originalFile = UserManager::getUserPicture( + $user_id, + USER_IMAGE_SIZE_ORIGINAL, + null, + $result + ); + $result['avatar'] = $originalFile; + $avatarString = explode('?', $result['avatar']); + $result['avatar_no_query'] = reset($avatarString); + } else { + $result['avatar'] = $user['avatar']; + $avatarString = explode('?', $user['avatar']); + $result['avatar_no_query'] = reset($avatarString); + } + + if (!isset($user['avatar_small'])) { + $smallFile = UserManager::getUserPicture( + $user_id, + USER_IMAGE_SIZE_SMALL, + null, + $result + ); + $result['avatar_small'] = $smallFile; + } else { + $result['avatar_small'] = $user['avatar_small']; + } + + if (!isset($user['avatar_medium'])) { + $mediumFile = UserManager::getUserPicture( + $user_id, + USER_IMAGE_SIZE_MEDIUM, + null, + $result + ); + $result['avatar_medium'] = $mediumFile; + } else { + $result['avatar_medium'] = $user['avatar_medium']; + } + $urlImg = api_get_path(WEB_IMG_PATH); $iconStatus = ''; $iconStatusMedium = ''; diff --git a/public/main/inc/lib/usermanager.lib.php b/public/main/inc/lib/usermanager.lib.php index dd7ad868c1..44dafa062c 100644 --- a/public/main/inc/lib/usermanager.lib.php +++ b/public/main/inc/lib/usermanager.lib.php @@ -2933,7 +2933,7 @@ class UserManager $sessionLimitRestriction = "LIMIT $sessionLimit"; } - $sql = "SELECT DISTINCT s.id, name, access_start_date, access_end_date + $sql = "SELECT DISTINCT s.id, s.title, access_start_date, access_end_date FROM $tbl_session_user su INNER JOIN $tbl_session s ON (s.id = su.session_id) WHERE ( @@ -2941,7 +2941,7 @@ class UserManager su.relation_type = ".SessionEntity::STUDENT." ) $coachCourseConditions - ORDER BY access_start_date, access_end_date, name + ORDER BY access_start_date, access_end_date, s.title $sessionLimitRestriction "; @@ -3042,7 +3042,7 @@ class UserManager access_start_date, access_end_date, session.id as session_id, - session.name as session_name, + session.title as session_name, IF((session_course_user.user_id = 3 AND session_course_user.status = ".SessionEntity::COURSE_COACH."),'2', '5') FROM $tbl_session_course_user as session_course_user INNER JOIN $tbl_course AS course diff --git a/public/main/social/skills_ranking.php b/public/main/social/skills_ranking.php index c5f97752ca..4586740e5c 100644 --- a/public/main/social/skills_ranking.php +++ b/public/main/social/skills_ranking.php @@ -33,52 +33,52 @@ $column_model = [ [ 'name' => 'photo', 'index' => 'photo', - 'width' => '10', + 'width' => '150px', 'align' => 'center', 'sortable' => 'false', ], [ 'name' => 'firstname', 'index' => 'firstname', - 'width' => '70', + 'width' => '250px', 'align' => 'center', 'sortable' => 'false', ], [ 'name' => 'lastname', 'index' => 'lastname', - 'width' => '70', + 'width' => '250px', 'align' => 'center', 'sortable' => 'false', ], [ 'name' => 'skills_acquired', 'index' => 'skills_acquired', - 'width' => '30 ', + 'width' => '100px', 'align' => 'center', 'sortable' => 'false', ], [ 'name' => 'currently_learning', 'index' => 'currently_learning', - 'width' => '30', + 'width' => '150px', 'align' => 'center', 'sortable' => 'false', ], [ 'name' => 'rank', 'index' => 'rank', - 'width' => '30', + 'width' => '100px', 'align' => 'center', 'sortable' => 'false', ], ]; //Autowidth -$extra_params['autowidth'] = 'true'; +//$extra_params['autowidth'] = 'true'; //height auto -$extra_params['height'] = 'auto'; +//$extra_params['height'] = 'auto'; //$extra_params['excel'] = 'excel'; //$extra_params['rowList'] = array(10, 20 ,30); @@ -87,7 +87,7 @@ $jqgrid = Display::grid_js( $url, $columns, $column_model, - $extra_params, + [], [], null, true diff --git a/public/main/social/skills_wheel.php b/public/main/social/skills_wheel.php index ce88773caa..63d7916603 100644 --- a/public/main/social/skills_wheel.php +++ b/public/main/social/skills_wheel.php @@ -21,7 +21,7 @@ $htmlHeadXtra[] = api_get_js('skills.js'); $tpl = new Template(null, false, false); $userId = api_get_user_id(); -$userInfo = api_get_user_info(); +$userInfo = api_get_user_info($userId); $skill = new SkillModel(); $ranking = $skill->getUserSkillRanking($userId); diff --git a/public/main/template/default/skill/skill_wheel_student.html.twig b/public/main/template/default/skill/skill_wheel_student.html.twig index dd4ffac712..dc4d445562 100644 --- a/public/main/template/default/skill/skill_wheel_student.html.twig +++ b/public/main/template/default/skill/skill_wheel_student.html.twig @@ -1,7 +1,59 @@ {% include '@ChamiloCore/Skill/skill_wheel.js.html.twig' %} {% autoescape false %} -