Explorar o código

Merge branch '1.10.x' into bootstrap

aragonc %!s(int64=9) %!d(string=hai) anos
pai
achega
da37977902

+ 45 - 0
app/Migrations/Schema/V110/Version20150819095300.php

@@ -0,0 +1,45 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+namespace Application\Migrations\Schema\V110;
+
+use Application\Migrations\AbstractMigrationChamilo;
+use Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Class Version20150819095300
+ *
+ * @package Application\Migrations\Schema\V11010
+ */
+class Version20150819095300 extends AbstractMigrationChamilo
+{
+
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $skillTable = $schema->getTable('skill');
+
+        $skillTable->addColumn(
+            'status',
+            \Doctrine\DBAL\Types\Type::INTEGER,
+            ['default' => 1]
+        );
+        $skillTable->addColumn(
+            'updated_at',
+            \Doctrine\DBAL\Types\Type::DATETIME
+        );
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+        $skillTable = $schema->getTable('skill');
+        $skillTable->dropColumn('status');
+        $skillTable->dropColumn('updated_at');
+    }
+
+}

+ 138 - 41
main/admin/skill_list.php

@@ -19,44 +19,141 @@ if (api_get_setting('allow_skills_tool') != 'true') {
     api_not_allowed();
 }
 
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
-
-$message = Session::has('message') ? Session::read('message') : null;
-
-$toolbar = Display::toolbarButton(
-    get_lang('CreateSkill'),
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php',
-    'plus',
-    'success',
-    ['title' => get_lang('CreateSkill')]
-);
-$toolbar .= Display::toolbarButton(
-    get_lang('SkillsWheel'),
-    api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php',
-    'bullseye',
-    'primary',
-    ['title' => get_lang('CreateSkill')]
-);
-$toolbar .= Display::toolbarButton(
-    get_lang('BadgesManagement'),
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php',
-    'certificate',
-    'warning',
-    ['title' => get_lang('BadgesManagement')]
-);
-
-/* View */
-$skill = new Skill();
-$skillList = $skill->get_all();
-
-$tpl = new Template(get_lang('ManageSkills'));
-$tpl->assign('message', $message);
-$tpl->assign('skills', $skillList);
-
-$content = $tpl->fetch('default/skill/list.tpl');
-
-$tpl->assign('actions', $toolbar);
-$tpl->assign('content', $content);
-$tpl->display_one_col_template();
-
-Session::erase('message');
+$action = isset($_GET['action']) ? $_GET['action'] : 'list';
+$skillId = isset($_GET['id']) ? intval($_GET['id']): 0;
+
+$entityManager = Database::getManager();
+
+switch ($action) {
+    case 'enable':
+        $skill = $entityManager->find('ChamiloCoreBundle:Skill', $skillId);
+        
+        if (is_null($skill)) {
+            Display::addFlash(
+                Display::return_message(
+                    get_lang('SkillNotFound'),
+                    'error'
+                )
+            );
+        } else {
+            $updatedAt = new DateTime(
+                api_get_utc_datetime(),
+                new DateTimeZone(_api_get_timezone())
+            );
+
+            $skill->setStatus(1);
+            $skill->setUpdatedAt($updatedAt);
+
+            $entityManager->persist($skill);
+            $entityManager->flush();
+
+            Display::addFlash(
+                Display::return_message(
+                    sprintf(get_lang('SkillXEnabled'), $skill->getName()),
+                    'success'
+                )
+            );
+        }
+
+        header('Location: ' . api_get_self());
+        exit;
+        break;
+    case 'disable':
+        $skill = $entityManager->find('ChamiloCoreBundle:Skill', $skillId);
+        
+        if (is_null($skill)) {
+            Display::addFlash(
+                Display::return_message(
+                    get_lang('SkillNotFound'),
+                    'error'
+                )
+            );
+        } else {
+            $updatedAt = new DateTime(
+                api_get_utc_datetime(),
+                new DateTimeZone(_api_get_timezone())
+            );
+
+            $skill->setStatus(0);
+            $skill->setUpdatedAt($updatedAt);
+
+            $entityManager->persist($skill);
+
+            $skillObj = new Skill();
+            $childrens = $skillObj->get_children($skill->getId());
+            
+            foreach ($childrens as $children) {
+                $skill = $entityManager->find(
+                    'ChamiloCoreBundle:Skill',
+                    $children['id']
+                );
+
+                if (empty($skill)) {
+                    continue;
+                }
+
+                $skill->setStatus(0);
+                $skill->setUpdatedAt($updatedAt);
+
+                $entityManager->persist($skill);
+            }
+
+            $entityManager->flush();
+
+            Display::addFlash(
+                Display::return_message(
+                    sprintf(get_lang('SkillXDisabled'), $skill->getName()),
+                    'success'
+                )
+            );
+        }
+
+        header('Location: ' . api_get_self());
+        exit;
+        break;
+    case 'list':
+        //no break
+    default:
+        $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
+
+        $message = Session::has('message') ? Session::read('message') : null;
+
+        $toolbar = Display::toolbarButton(
+            get_lang('CreateSkill'),
+            api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php',
+            'plus',
+            'success',
+            ['title' => get_lang('CreateSkill')]
+        );
+        $toolbar .= Display::toolbarButton(
+            get_lang('SkillsWheel'),
+            api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php',
+            'bullseye',
+            'primary',
+            ['title' => get_lang('CreateSkill')]
+        );
+        $toolbar .= Display::toolbarButton(
+            get_lang('BadgesManagement'),
+            api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php',
+            'shield',
+            'warning',
+            ['title' => get_lang('BadgesManagement')]
+        );
+
+        /* View */
+        $skill = new Skill();
+        $skillList = $skill->get_all();
+
+        $tpl = new Template(get_lang('ManageSkills'));
+        $tpl->assign('message', $message);
+        $tpl->assign('skills', $skillList);
+
+        $content = $tpl->fetch('default/skill/list.tpl');
+
+        $tpl->assign('actions', $toolbar);
+        $tpl->assign('content', $content);
+        $tpl->display_one_col_template();
+
+        Session::erase('message');
+        break;
+}

+ 93 - 26
main/admin/teacher_time_report.php

@@ -24,22 +24,56 @@ $toolName = get_lang('TeacherTimeReport');
 // Access restrictions.
 api_protect_admin_script();
 
+$form = new FormValidator('teacher_time_report');
+
 $startDate = new DateTime(api_get_local_time());
 $startDate->modify('first day of this month');
 
 $limitDate = new DateTime(api_get_local_time());
 
-$selectedCourse = isset($_REQUEST['course']) ? $_REQUEST['course'] : null;
-$selectedSession = isset($_REQUEST['session']) ? $_REQUEST['session'] : 0;
-$selectedTeacher = isset($_REQUEST['teacher']) ? $_REQUEST['teacher'] : 0;
-$selectedFrom = isset($_REQUEST['from']) && !empty($_REQUEST['from']) ? $_REQUEST['from'] : $startDate->format('Y-m-d');
-$selectedUntil = isset($_REQUEST['from']) && !empty($_REQUEST['until']) ? $_REQUEST['until'] : $limitDate->format('Y-m-d');
+$selectedCourse = null;
+$selectedSession = 0;
+$selectedTeacher = 0;
+$selectedFrom = $startDate->format('Y-m-d');
+$selectedUntil = $limitDate->format('Y-m-d');
+
+if ($form->validate()) {
+    $formValues = $form->getSubmitValues();
+
+    $selectedCourse = $formValues['course'];
+    $selectedSession = $formValues['session'];
+    $selectedTeacher = $formValues['teacher'];
+
+    if (!empty($formValues['from'])) {
+        $selectedFrom = $formValues['from'];
+    }
+
+    if (!empty($formValues['until'])) {
+        $selectedUntil = $formValues['until'];
+    }
+}
+
+$optionsCourses = [0 => get_lang('None')];
+$optionsSessions = [0 => get_lang('None')];
+$optionsTeachers = [0 => get_lang('None')];
 
 $courseList = CourseManager::get_courses_list(0, 0, 'title');
 $sessionsList = SessionManager::get_sessions_list(array(), array('name'));
 
 $teacherList = UserManager::getTeachersList();
 
+foreach ($courseList as $courseItem) {
+    $optionsCourses[$courseItem['code']] = $courseItem['title'];
+}
+
+foreach ($sessionsList as $sessionItem) {
+    $optionsSessions[$sessionItem['id']] = $sessionItem['name'];
+}
+
+foreach ($teacherList as $teacherItem) {
+    $optionsTeachers[$teacherItem['user_id']] = $teacherItem['completeName'];
+}
+
 $withFilter = false;
 
 $reportTitle = get_lang('TimeReportIncludingAllCoursesAndSessionsByTeacher');
@@ -212,29 +246,27 @@ if (!empty($selectedTeacher)) {
 
     $coursesInSession = SessionManager::getCoursesListByCourseCoach($selectedTeacher);
 
-    foreach ($coursesInSession as $course) {
-        $session = api_get_session_info($course['id_session']);
-        $sessionData = array(
-            'id' => $session['id'],
-            'name' => $session['name']
-        );
-
-        $courseInfo = api_get_course_info_by_id($course['c_id']);
+    foreach ($coursesInSession as $userCourseSubscription) {
+        $course = $userCourseSubscription->getCourse();
+        $session = $userCourseSubscription->getSession();
 
         $totalTime = UserManager::getTimeSpentInCourses(
             $selectedTeacher,
-            $course['c_id'],
-            $session['id'],
+            $course->getId(),
+            $session->getId(),
             $selectedFrom,
             $selectedUntil
         );
         $formattedTime = api_format_time($totalTime);
 
         $timeReport->data[] = array(
-            'session' => $sessionData,
+            'session' => [
+                'id' => $session->getId(),
+                'name' => $session->getName()
+            ],
             'course' => array(
-                'id' => $course['c_id'],
-                'name' => $courseInfo['title']
+                'id' => $course->getId(),
+                'name' => $course->getTitle()
             ),
             'coach' => $teacherData,
             'totalTime' => $formattedTime
@@ -294,19 +326,52 @@ if (isset($_GET['export'])) {
     die;
 }
 
-// view
-//hack for daterangepicker
-$startDate->modify('+1 day');
-$limitDate->modify('+1 day');
+$form->addSelect(
+    'course',
+    get_lang('Course'),
+    $optionsCourses,
+    ['id' => 'courses']
+);
+$form->addSelect(
+    'session',
+    get_lang('Session'),
+    $optionsSessions,
+    ['id' => 'session']
+);
+$form->addSelect(
+    'teacher',
+    get_lang('Teacher'),
+    $optionsTeachers,
+    ['id' => 'teacher']
+);
+$form->addDateRangePicker(
+    'daterange',
+    get_lang('Date'),
+    false,
+    [
+        'id' => 'daterange',
+        'maxDate' => $limitDate->format('Y-m-d'),
+        'format' => 'YYYY-MM-DD',
+        'timePicker' => 'false',
+        'value' => "$selectedFrom / $selectedUntil"
+    ]
+);
+$form->addButtonFilter(get_lang('Filter'));
+$form->addHidden('from', '');
+$form->addHidden('until', '');
+$form->setDefaults([
+    'course' => $selectedCourse,
+    'session' => $selectedSession,
+    'teacher' => $selectedTeacher,
+    'date_range' => "$selectedFrom / $selectedUntil",
+    'from' => $selectedFrom,
+    'until' => $selectedUntil
+]);
 
 $tpl = new Template($toolName);
 $tpl->assign('reportTitle', $reportTitle);
 $tpl->assign('reportSubTitle', $reportSubTitle);
 
-$tpl->assign('filterStartDate', $startDate->format('Y-m-d'));
-$tpl->assign('filterEndDate', $limitDate->format('Y-m-d'));
-$tpl->assign('filterMaxDate', $limitDate->format('Y-m-d'));
-
 $tpl->assign('selectedCourse', $selectedCourse);
 $tpl->assign('selectedSession', $selectedSession);
 $tpl->assign('selectedTeacher', $selectedTeacher);
@@ -319,6 +384,8 @@ $tpl->assign('courses', $courseList);
 $tpl->assign('sessions', $sessionsList);
 $tpl->assign('courseCoaches', $teacherList);
 
+$tpl->assign('form', $form->returnForm());
+
 $tpl->assign('rows', $timeReport->data);
 
 $contentTemplate = $tpl->get_template('admin/teacher_time_report.tpl');

+ 28 - 2
main/inc/lib/formvalidator/Element/DateRangePicker.php

@@ -61,15 +61,41 @@ class DateRangePicker extends HTML_QuickForm_text
                     endDate: '".$dates['end']."', ";
         }
 
+        $minDate = null;
+        if (!empty($this->getAttribute('minDate'))) {
+            $minDate = "
+                minDate: '{$this->getAttribute('minDate')}',
+            ";
+        }
+
+        $maxDate = null;
+        if (!empty($this->getAttribute('maxDate'))) {
+            $maxDate = "
+                maxDate: '{$this->getAttribute('maxDate')}',
+            ";
+        }
+
+        $format = 'YYYY-MM-DD HH:mm';
+        if (!empty($this->getAttribute('format'))) {
+            $format = $this->getAttribute('format');
+        }
+
+        $timePicker = 'true';
+        if (!empty($this->getAttribute('timePicker'))) {
+            $timePicker = $this->getAttribute('timePicker');
+        }
+
         //timeFormat: 'hh:mm'
         $js .= "<script>
             $(function() {
                 $('#$id').daterangepicker({
-                    format: 'YYYY-MM-DD HH:mm',
-                    timePicker: true,
+                    format: '$format',
+                    timePicker: $timePicker,
                     timePickerIncrement: 30,
                     timePicker12Hour: false,
                     $defaultDates
+                    $maxDate
+                    $minDate
                     ranges: {
                          '".addslashes(get_lang('Today'))."': [moment(), moment()],
                          '".addslashes(get_lang('ThisWeek'))."': [moment().weekday(1), moment().weekday(5)],

+ 16 - 9
main/inc/lib/sessionmanager.lib.php

@@ -1,6 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
+
 /**
  * Class SessionManager
  *
@@ -5620,8 +5622,11 @@ class SessionManager
         $courseSessionList = self::getCoursesListByCourseCoach($coachId);
         $sessionsByCoach = array();
         if (!empty($courseSessionList)) {
-            foreach ($courseSessionList as $courseSession) {
-                $sessionsByCoach[$courseSession['id_session']] = api_get_session_info($courseSession['id_session']);
+            foreach ($courseSessionList as $userCourseSubscription) {
+                $session = $userCourseSubscription->getSession();
+                $sessionsByCoach[$session->getId()] = api_get_session_info(
+                    $session->getId()
+                );
             }
         }
 
@@ -5777,13 +5782,15 @@ class SessionManager
      */
     public static function getCoursesListByCourseCoach($coachId)
     {
-        $table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
-        return  Database::select('*', $table, array(
-            'where' => array(
-                'user_id = ? AND ' => $coachId,
-                'status = ?' => 2,
-            ),
-        ));
+        $entityManager = Database::getManager();
+        $scuRepo = $entityManager->getRepository(
+            'ChamiloCoreBundle:SessionRelCourseRelUser'
+        );
+
+        return $scuRepo->findBy([
+            'user' => $coachId,
+            'status' => SessionRelCourseRelUser::STATUS_COURSE_COACH
+        ]);
     }
 
 	/**

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

@@ -612,7 +612,8 @@ class Skill extends Model
                     ss.parent_id,
                     ss.relation_type,
                     s.icon,
-                    s.short_code
+                    s.short_code,
+                    s.status
                 FROM {$this->table} s
                 INNER JOIN {$this->table_skill_rel_skill} ss
                 ON (s.id = ss.skill_id) $id_condition
@@ -955,7 +956,7 @@ class Skill extends Model
                     // 2nd node
                     $skills[$skill_id] = $skill_info;
                     // Uncomment code below to hide the searched skill
-                    $skills[$skill_id]['data']['parent_id'] =  $skill_info['parent_id'];
+                    $skills[$skill_id]['data']['parent_id'] =  $skill_info['extra']['parent_id'];
                     $skills[$skill_id]['parent_id'] =  1;
                 }
             }

+ 2 - 0
main/lang/english/trad4all.inc.php

@@ -7504,4 +7504,6 @@ $ViewMyCoursesListBySessionComment = "Enable an additional 'My courses' page whe
 $DownloadCertificatePdf = "Download certificate in PDF";
 $EnterPassword = "Enter password";
 $DownloadReportPdf = "Download report in PDF";
+$SkillXEnabled = "Skill \"%s\" enabled";
+$SkillXDisabled = "Skill \"%s\" disabled";
 ?>

+ 2 - 0
main/lang/spanish/trad4all.inc.php

@@ -7528,4 +7528,6 @@ $ViewMyCoursesListBySessionComment = "Activa una página \"Mis cursos\" adiciona
 $DownloadCertificatePdf = "Descargar certificado en PDF";
 $EnterPassword = "Ingresar contraseña";
 $DownloadReportPdf = "Descargar reporte en PDF";
+$SkillXEnabled = "Competencia \"%s\" habilitada";
+$SkillXDisabled = "Competencia \"%s\" deshabilitada";
 ?>

+ 4 - 65
main/template/default/admin/teacher_time_report.tpl

@@ -18,25 +18,11 @@
                 $('#session').prop('selectedIndex', 0);
             });
 
-            $('#daterange').daterangepicker({
-                format: 'YYYY-MM-DD',
-                startDate: new Date('{{ filterStartDate }}'),
-                endDate: new Date('{{ filterEndDate }}'),
-                maxDate: new Date('{{ filterMaxDate }}'),
-                separator: ' / ',
-                locale: {
-                    applyLabel: "{{ 'Ok' | get_lang }}",
-                    cancelLabel: "{{ 'Cancel' | get_lang }}",
-                    fromLabel: "{{ 'From' | get_lang }}",
-                    toLabel: "{{ 'Until' | get_lang }}",
-                    customRangeLabel: "{{ 'CustomRange' | get_lang }}"
-                }
-            });
             $('#daterange').on('apply.daterangepicker', function (ev, picker) {
-                $('#from').val(picker.startDate.format('YYYY-MM-DD'));
-                $('#until').val(picker.endDate.format('YYYY-MM-DD'));
+                $('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
+                $('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
             }).on('cancel.daterangepicker', function (ev, picker) {
-                $('#daterange, #from, #until').val('');
+                $('#daterange, [name="from"], [name="until"]').val('');
             });
         });
     </script>
@@ -52,54 +38,7 @@
             </span>
         </div>
         <h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
-        <form class="form-horizontal" method="post">
-            <div class="control-group">
-                <label class="control-label" for="course">{{ 'Course' | get_lang }}</label>
-                <div class="controls">
-                    <select name="course" id="course">
-                        <option value="0">{{ 'None' | get_lang }}</option>
-                        {% for course in courses %}
-                            <option value="{{ course.code }}" {{ (course.code == selectedCourse) ? 'selected' : '' }}>{{ course.title }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label" for="session">{{ 'Session' | get_lang }}</label>
-                <div class="controls">
-                    <select name="session" id="session">
-                        <option value="0">{{ 'None' | get_lang }}</option>
-                        {% for session in sessions %}
-                            <option value="{{ session.id }}" {{ (session.id == selectedSession) ? 'selected' : '' }}>{{ session.name }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label" for="inputPassword">{{ 'Teacher' | get_lang }}</label>
-                <div class="controls">
-                    <select name="teacher" id="teacher">
-                        <option value="0">{{ 'None' | get_lang }}</option>
-                        {% for teacher in courseCoaches %}
-                            <option value="{{ teacher.user_id }}" {{ (teacher.user_id == selectedTeacher) ? 'selected' : '' }}>{{ teacher.completeName }}</option>
-                        {% endfor %}
-                    </select>
-                </div>
-            </div>
-            <div class="control-group">
-                <label class="control-label" for="inputPassword">{{ 'Date' | get_lang }}</label>
-                <div class="controls">
-                    <input type="text" id="daterange"  value="{{ selectedFrom }} / {{ selectedUntil }}">
-                    <input type="hidden" id="from" name="from" value="{{ selectedFrom }}">
-                    <input type="hidden" id="until" name="until" value="{{ selectedUntil }}">
-                </div>
-            </div>
-            <div class="control-group">
-                <div class="controls">
-                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> {{ 'Filter' | get_lang }}</button>
-                </div>
-            </div>
-        </form>
+        {{ form }}
         <h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
         <table class="table">
             <thead>

+ 48 - 36
main/template/default/skill/list.tpl

@@ -2,41 +2,53 @@
     <h1>{{ "ManageSkills" | get_lang }}</h1>
 </header>
 
-<table class="table table-hover table-striped">
-    <thead>
-        <tr>
-            <th>{{ "Name" | get_lang }}</th>
-            <th>{{ "ShortCode" | get_lang }}</th>
-            <th>{{ "Description" | get_lang }}</th>
-            <th>{{ "Options" | get_lang }}</th>
-        </tr>
-    </thead>
-    <tfoot>
-        <tr>
-            <th>{{ "Name" | get_lang }}</th>
-            <th>{{ "ShortName" | get_lang }}</th>
-            <th>{{ "Description" | get_lang }}</th>
-            <th>{{ "Options" | get_lang }}</th>
-        </tr>
-    </tfoot>
-    <tbody>
-        {% for skill in skills %}
+<div class="table table-responsive">
+    <table class="table table-hover table-striped">
+        <thead>
             <tr>
-                <td>{{ skill.name }}</td>
-                <td>{{ skill.short_code }}</td>
-                <td>{{ skill.description }}</td>
-                <td>
-                    <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-default">
-                        <i class="fa fa-edit"></i> {{ "Edit" | get_lang }}
-                    </a>
-                    <a href="{{ _p.web_main }}admin/skill_create.php?parent={{ skill.id }}" class="btn btn-default">
-                        <i class="fa fa-plus"></i> {{ "CreateChildSkill" | get_lang }}
-                    </a>
-                    <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" class="btn btn-default">
-                        <i class="fa fa-plus"></i> {{ "CreateBadge" | get_lang }}
-                    </a>
-                </td>
+                <th>{{ "Name" | get_lang }}</th>
+                <th>{{ "ShortCode" | get_lang }}</th>
+                <th>{{ "Description" | get_lang }}</th>
+                <th>{{ "Options" | get_lang }}</th>
             </tr>
-        {% endfor %}
-    </tbody>
-</table>
+        </thead>
+        <tfoot>
+            <tr>
+                <th width="200">{{ "Name" | get_lang }}</th>
+                <th class="text-center">{{ "ShortName" | get_lang }}</th>
+                <th width="300">{{ "Description" | get_lang }}</th>
+                <th class="text-right">{{ "Options" | get_lang }}</th>
+            </tr>
+        </tfoot>
+        <tbody>
+            {% for skill in skills %}
+                <tr>
+                    <td width="200">{{ skill.name }}</td>
+                    <td class="text-center">{{ skill.short_code }}</td>
+                    <td width="300">{{ skill.description }}</td>
+                    <td class="text-right">
+                        <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-primary btn-sm">
+                            <i class="fa fa-edit fa-fw"></i> {{ "Edit" | get_lang }}
+                        </a>
+                        <a href="{{ _p.web_main }}admin/skill_create.php?parent={{ skill.id }}" class="btn btn-primary btn-sm">
+                            <i class="fa fa-plus fa-fw"></i> {{ "CreateChildSkill" | get_lang }}
+                        </a>
+                        <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" class="btn btn-primary btn-sm">
+                            <i class="fa fa-shield fa-fw"></i> {{ "CreateBadge" | get_lang }}
+                        </a>
+
+                        {% if skill.status == 0 %}
+                            <a href="{{ _p.web_self ~ '?' ~ {"action": "enable", "id": skill.id}|url_encode() }}" class="btn btn-success btn-sm">
+                                <i class="fa fa-check-circle-o fa-fw"></i> {{ 'Enable' }}
+                            </a>
+                        {% else %}
+                            <a href="{{ _p.web_self ~ '?' ~ {"action": "disable", "id": skill.id}|url_encode() }}" class="btn btn-danger btn-sm">
+                                <i class="fa fa-ban fa-fw"></i> {{ 'Disable' }}
+                            </a>
+                        {% endif %}
+                    </td>
+                </tr>
+            {% endfor %}
+        </tbody>
+    </table>
+</div>

+ 3 - 1
main/template/default/skill/skill_wheel.tpl

@@ -228,7 +228,9 @@ $(document).ready(function() {
     });
 
      /* URL link when searching skills */
-    $("#skill_holder").on("click", "a.load_wheel", function() {
+    $("#skill_holder").on("click", "a.load_wheel", function(e) {
+        e.preventDefault();
+
         skill_id = $(this).attr('rel');
         skill_to_load_from_get = 0;
         load_nodes(skill_id, main_depth);

+ 3 - 3
plugin/advanced_subscription/views/admin_view.tpl

@@ -23,13 +23,13 @@
             <p class="separate-badge">
                 <span class="badge badge-dis">{{ session.vacancies }}</span>
                 {{ "Vacancies" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p>
-            <p class="separate-badge">
-                <span class="badge badge-recom">{{ session.recommended_number_of_participants }}</span>
-                {{ "RecommendedNumberOfParticipants" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p>
             <p class="separate-badge">
                 <span class="badge badge-info">{{ session.nbr_users }}</span>
                 {{ 'UsersNumber'|get_lang }}
             </p>
+            <p class="separate-badge">
+                <span class="badge badge-recom">{{ session.recommended_number_of_participants }}</span>
+                {{ "RecommendedNumberOfParticipants" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p>
             <h4>{{ "PublicationEndDate" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> <p>{{ session.publication_end_date }}</p>
             <h4>{{ "Mode" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> <p>{{ session.mode }}</p>
         </div>

+ 56 - 0
src/Chamilo/CoreBundle/Entity/Skill.php

@@ -54,6 +54,20 @@ class Skill
      */
     private $criteria;
 
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="status", type="integer", nullable=false, options={"default": 1})
+     */
+    private $status;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="updated_at", type="datetime", nullable=false)
+     */
+    private $updatedAt;
+
     /**
      * @var integer
      *
@@ -203,6 +217,48 @@ class Skill
         return $this->criteria;
     }
 
+    /**
+     * Set status
+     * @param integer $status
+     * @return \Chamilo\CoreBundle\Entity\Skill
+     */
+    public function setStatus($status)
+    {
+        $this->status = $status;
+
+        return $this;
+    }
+
+    /**
+     * Get status
+     * @return integer
+     */
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    /**
+     * Set updatedAt
+     * @param \DateTime $updatedAt The update datetime
+     * @return \Chamilo\CoreBundle\Entity\Skill
+     */
+    public function setUpdatedAt(\DateTime $updatedAt)
+    {
+        $this->updatedAt = $updatedAt;
+
+        return $this;
+    }
+
+    /**
+     * Get updatedAt
+     * @return \DateTime
+     */
+    public function getUpdatedAt()
+    {
+        return $this->updatedAt;
+    }
+
     /**
      * Get id
      *