Browse Source

Merge branch 'master' of https://github.com/chamilo/chamilo-lms

Alex Aragón 6 years ago
parent
commit
25d1ce2039

+ 3 - 1
main/inc/lib/skill.lib.php

@@ -2195,8 +2195,10 @@ class Skill extends Model
      */
     public static function isAllowed($studentId = 0, $blockPage = true)
     {
+        $allowHR = api_get_setting('allow_hr_skills_management') === 'true';
+
         if (self::isToolAvailable()) {
-            if (api_is_platform_admin()) {
+            if (api_is_platform_admin(false, $allowHR)) {
                 return true;
             }
 

+ 16 - 8
main/mySpace/student.php

@@ -28,6 +28,8 @@ $active = isset($_GET['active']) ? intval($_GET['active']) : 1;
 $sleepingDays = isset($_GET['sleeping_days']) ? intval($_GET['sleeping_days']) : null;
 $this_section = SECTION_TRACKING;
 
+$webCodePath = api_get_path(WEB_CODE_PATH);
+
 $interbreadcrumb[] = [
     "url" => api_is_student_boss() ? "#" : "index.php",
     "name" => get_lang('MySpace'),
@@ -73,6 +75,8 @@ function get_users($from, $limit, $column, $direction)
     $sleepingDays = isset($_GET['sleeping_days']) ? (int) $_GET['sleeping_days'] : null;
     $sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : 0;
 
+    $webCodePath = api_get_path(WEB_CODE_PATH);
+
     $lastConnectionDate = null;
     if (!empty($sleepingDays)) {
         $lastConnectionDate = api_get_utc_datetime(strtotime($sleepingDays.' days ago'));
@@ -121,7 +125,7 @@ function get_users($from, $limit, $column, $direction)
         );
     }
 
-    $url = api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php';
+    $url = $webCodePath.'mySpace/myStudents.php';
 
     $all_datas = [];
     foreach ($students as $student_data) {
@@ -200,7 +204,7 @@ function get_users($from, $limit, $column, $direction)
         if (api_is_drh() || api_is_platform_admin()) {
             $lostPasswordLink = ' '.Display::url(
                 Display::return_icon('edit.png', get_lang('Edit')),
-                api_get_path(WEB_CODE_PATH).'mySpace/user_edit.php?user_id='.$student_id
+                    $webCodePath.'mySpace/user_edit.php?user_id='.$student_id
             );
         }
 
@@ -224,7 +228,7 @@ if (api_is_drh()) {
     $menu_items = [
         Display::url(
             Display::return_icon('statistics.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
-            api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
+            $webCodePath."auth/my_progress.php"
         ),
         Display::url(
             Display::return_icon('user_na.png', get_lang('Students'), [], ICON_SIZE_MEDIUM),
@@ -244,7 +248,7 @@ if (api_is_drh()) {
         ),
         Display::url(
             Display::return_icon('skills.png', get_lang('Skills'), [], ICON_SIZE_MEDIUM),
-            'skills.php'
+            $webCodePath.'social/my_skills_report.php'
         ),
     ];
 
@@ -257,15 +261,19 @@ if (api_is_drh()) {
 } elseif (api_is_student_boss()) {
     $actionsLeft .= Display::url(
         Display::return_icon('statistics.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
-        api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
+        $webCodePath."auth/my_progress.php"
     );
     $actionsLeft .= Display::url(
         Display::return_icon('user_na.png', get_lang('Students'), [], ICON_SIZE_MEDIUM),
         '#'
     );
+    $actions .= Display::url(
+        Display::return_icon('skills.png', get_lang('Skills'), array(), ICON_SIZE_MEDIUM),
+        $webCodePath.'social/my_skills_report.php'
+    );
     $actionsLeft .= Display::url(
         Display::return_icon("statistics.png", get_lang('CompanyReport'), [], ICON_SIZE_MEDIUM),
-        api_get_path(WEB_CODE_PATH)."mySpace/company_reports.php"
+        $webCodePath."mySpace/company_reports.php"
     );
     $actionsLeft .= Display::url(
         Display::return_icon(
@@ -274,7 +282,7 @@ if (api_is_drh()) {
             [],
             ICON_SIZE_MEDIUM
         ),
-        api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
+        $webCodePath."gradebook/certificate_report.php"
     );
 }
 
@@ -338,7 +346,7 @@ if ($export_csv) {
 $form = new FormValidator(
     'search_user',
     'get',
-    api_get_path(WEB_CODE_PATH).'mySpace/student.php'
+    $webCodePath.'mySpace/student.php'
 );
 $form = Tracking::setUserSearchForm($form);
 $form->setDefaults($params);

+ 12 - 6
main/mySpace/users.php

@@ -27,6 +27,8 @@ $active = isset($_GET['active']) ? intval($_GET['active']) : 1;
 $sleepingDays = isset($_GET['sleeping_days']) ? intval($_GET['sleeping_days']) : null;
 $status = isset($_GET['status']) ? Security::remove_XSS($_GET['status']) : null;
 
+$webCodePath = api_get_path(WEB_CODE_PATH);
+
 $this_section = SECTION_TRACKING;
 
 $interbreadcrumb[] = [
@@ -200,7 +202,7 @@ if (api_is_drh()) {
     $menu_items = [
         Display::url(
             Display::return_icon('statistics.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
-            api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
+            $webCodePath."auth/my_progress.php"
         ),
         Display::url(
             Display::return_icon('user_na.png', get_lang('Students'), [], ICON_SIZE_MEDIUM),
@@ -220,7 +222,7 @@ if (api_is_drh()) {
         ),
         Display::url(
             Display::return_icon('skills.png', get_lang('Skills'), [], ICON_SIZE_MEDIUM),
-            'skills.php'
+            $webCodePath.'social/my_skills_report.php'
         ),
     ];
 
@@ -233,15 +235,19 @@ if (api_is_drh()) {
 } elseif (api_is_student_boss()) {
     $actionsLeft .= Display::url(
         Display::return_icon('statistics.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
-        api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
+        $webCodePath."auth/my_progress.php"
     );
     $actionsLeft .= Display::url(
         Display::return_icon('user_na.png', get_lang('Students'), [], ICON_SIZE_MEDIUM),
         '#'
     );
+    $actions .= Display::url(
+        Display::return_icon('skills.png', get_lang('Skills'), array(), ICON_SIZE_MEDIUM),
+        $webCodePath.'social/my_skills_report.php'
+    );
     $actionsLeft .= Display::url(
         Display::return_icon("statistics.png", get_lang("CompanyReport"), [], ICON_SIZE_MEDIUM),
-        api_get_path(WEB_CODE_PATH)."mySpace/company_reports.php"
+        $webCodePath."mySpace/company_reports.php"
     );
     $actionsLeft .= Display::url(
         Display::return_icon(
@@ -250,7 +256,7 @@ if (api_is_drh()) {
             [],
             ICON_SIZE_MEDIUM
         ),
-        api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
+        $webCodePath."gradebook/certificate_report.php"
     );
 }
 
@@ -315,7 +321,7 @@ if ($export_csv) {
 $form = new FormValidator(
     'search_user',
     'get',
-    api_get_path(WEB_CODE_PATH).'mySpace/users.php'
+    $webCodePath.'mySpace/users.php'
 );
 $form->addElement(
     'select',

+ 1 - 1
main/social/my_skills_report.php

@@ -121,7 +121,7 @@ if ($isStudent) {
         $action = 'filterBySkill';
     }
 
-    $courses = CourseManager::get_courses_list();
+    $courses = CourseManager::getCoursesFollowedByUser($userId, DRH);
 
     $tableRows = [];
     $reportTitle = null;

+ 5 - 3
main/template/default/skill/drh_report.html.twig

@@ -16,13 +16,14 @@
     <div class="col-md-6">
         <form class="form-inline" method="post" action="{{ _p.web_self }}">
             <label for="course">{{ 'Courses' | get_lang }}</label>
-            <select name="course" id="course">
+            <select name="course" id="course" class="form-control">
                 <option value="0">{{ 'Select' | get_lang }}</option>
                 {% for course in courses %}
                     <option value="{{ course.id }}" {{ (course.id == selected_course) ? 'selected' : '' }}>{{ course.title }}</option>
                 {% endfor %}
             </select>
             <button type="submit" class="btn btn-default">
+                <span class="fa fa-filter" aria-hidden="true"></span>
                 {{ 'Filter' | get_lang }}
             </button>
         </form>
@@ -30,7 +31,7 @@
     <div class="col-md-6">
         <form class="form-inline" method="post" action="{{ _p.web_self }}">
             <label for="skill">{{ 'Skills' | get_lang }}</label>
-            <select name="skill" id="skill">
+            <select name="skill" id="skill" class="form-control">
                 <option value="0">{{ 'Select' | get_lang }}</option>
                 {% for skill in skills %}
                     <option value="{{ skill.id }}" {{ (skill.id == selected_skill) ? 'selected' : '' }}>
@@ -38,7 +39,8 @@
                     </option>
                 {% endfor %}
             </select>
-            <button type="submit" class="btn btn-default"><em class="fa fa-filter"></em>
+            <button type="submit" class="btn btn-default">
+                <span class="fa fa-filter" aria-hidden="true"></span>
                 {{ 'Filter' | get_lang }}
             </button>
         </form>