From 89655065ffc5f8e7ef64ffca39f96881a72de025 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos <1697880+AngelFQC@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:42:46 -0500 Subject: [PATCH] Skill: Replace links to new skill wheel page --- public/main/inc/lib/userportal.lib.php | 3 ++- public/main/skills/skill_list.php | 2 +- public/main/template/default/skill/drh_report.html.twig | 2 +- public/main/template/default/skill/profile.html.twig | 6 +++--- src/CoreBundle/Controller/Admin/IndexBlocksController.php | 2 +- src/CoreBundle/Controller/IndexController.php | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/public/main/inc/lib/userportal.lib.php b/public/main/inc/lib/userportal.lib.php index 7cbd422ca9..62ba9dd109 100644 --- a/public/main/inc/lib/userportal.lib.php +++ b/public/main/inc/lib/userportal.lib.php @@ -5,6 +5,7 @@ use Chamilo\CoreBundle\Component\Utils\ActionIcon; use Chamilo\CoreBundle\Component\Utils\ObjectIcon; use Chamilo\CoreBundle\Component\Utils\ToolIcon; +use Chamilo\CoreBundle\Framework\Container; /** * Class IndexManager. @@ -216,7 +217,7 @@ class IndexManager if (($allowSkillsManagement && api_is_drh()) || api_is_platform_admin()) { $items[] = [ 'icon' => Display::getMdiIcon(ActionIcon::EDIT_BADGE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('My skills')), - 'link' => api_get_path(WEB_CODE_PATH).'skills/skills_wheel.php', + 'link' => Container::getRouter()->generate('skill_wheel'), 'title' => get_lang('Manage skills'), ]; } diff --git a/public/main/skills/skill_list.php b/public/main/skills/skill_list.php index e016974eea..4a0fae0e02 100644 --- a/public/main/skills/skill_list.php +++ b/public/main/skills/skill_list.php @@ -126,7 +126,7 @@ switch ($action) { $toolbar .= Display::url( Display::getMdiIcon(ObjectIcon::WHEEL, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Skills wheel')), - api_get_path(WEB_CODE_PATH).'skills/skills_wheel.php', + Container::getRouter()->generate('skill_wheel'), ['title' => get_lang('Skills wheel')] ); diff --git a/public/main/template/default/skill/drh_report.html.twig b/public/main/template/default/skill/drh_report.html.twig index d63e663e5e..5cfff63c18 100644 --- a/public/main/template/default/skill/drh_report.html.twig +++ b/public/main/template/default/skill/drh_report.html.twig @@ -4,7 +4,7 @@ {{ 'Skills wheel'|trans }} {% if allow_drh_skills_management %} - + {{ 'Manage skills'|trans }} {% endif %} diff --git a/public/main/template/default/skill/profile.html.twig b/public/main/template/default/skill/profile.html.twig index b60ca34918..976303980e 100644 --- a/public/main/template/default/skill/profile.html.twig +++ b/public/main/template/default/skill/profile.html.twig @@ -1,4 +1,4 @@ -{% if search_skill_list is not null %} +{% if search_skill_list is defined and search_skill_list is not null %}

{{ "Skills"|trans }}

{% endif %} -{% if profiles is not null %} +{% if profiles is defined and profiles is not null %}

{{ "Skill profiles"|trans }}

{% endfor %} {% else %} - {% if search_skill_list is null %} + {% if search_skill_list is defined and search_skill_list is null %}
{{ "No results found"|trans }}
{% endif %} {% endif %} diff --git a/src/CoreBundle/Controller/Admin/IndexBlocksController.php b/src/CoreBundle/Controller/Admin/IndexBlocksController.php index 6b914f91da..ddda390f18 100644 --- a/src/CoreBundle/Controller/Admin/IndexBlocksController.php +++ b/src/CoreBundle/Controller/Admin/IndexBlocksController.php @@ -580,7 +580,7 @@ class IndexBlocksController extends BaseController $items = []; $items[] = [ 'class' => 'item-skill-wheel', - 'url' => $this->generateUrl('legacy_main', ['name' => 'skills/skills_wheel.php']), + 'route' => ['name' => 'SkillWheel'], 'label' => $this->translator->trans('Skills wheel'), ]; $items[] = [ diff --git a/src/CoreBundle/Controller/IndexController.php b/src/CoreBundle/Controller/IndexController.php index 5a61735ff1..7b418c8376 100644 --- a/src/CoreBundle/Controller/IndexController.php +++ b/src/CoreBundle/Controller/IndexController.php @@ -31,7 +31,7 @@ class IndexController extends BaseController #[Route('/social', name: 'chamilo_core_socialnetwork', options: ['expose' => true])] #[Route('/admin', name: 'admin', options: ['expose' => true])] #[Route('/p/{slug}', name: 'public_page')] - #[Route('/skill/wheel', name: 'skill')] + #[Route('/skill/wheel', name: 'skill_wheel')] public function index(): Response { return $this->render('@ChamiloCore/Layout/no_layout.html.twig', ['content' => '']);