diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 56cda4e3a8..ffb2f9aa69 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -7,7 +7,7 @@ framework: php_errors: log: true templating: - engines: ['twig', 'php'] + engines: ['twig'] session: # handler_id set to null will use default session handler from php.ini handler_id: session.handler.native_file diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index 5913cdd063..025b058c17 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -2584,26 +2584,6 @@ class Category implements GradebookItem return $this; } - /** - * @return int - */ - public function getGradeBooksToValidateInDependence() - { - return $this->gradeBooksToValidateInDependence; - } - - /** - * @param int $value - * - * @return Category - */ - public function setGradeBooksToValidateInDependence($value) - { - $this->gradeBooksToValidateInDependence = $value; - - return $this; - } - /** * @return Category */ diff --git a/src/CoreBundle/Controller/CourseController.php b/src/CoreBundle/Controller/CourseController.php index 676e6e7fd3..cff9d99b4f 100644 --- a/src/CoreBundle/Controller/CourseController.php +++ b/src/CoreBundle/Controller/CourseController.php @@ -7,7 +7,6 @@ use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Form\Type\CourseType; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -16,7 +15,7 @@ use Symfony\Component\Routing\Annotation\Route; /** * Class CourseController. * - * @Route("/course") + * @Route("/courses") * * @package Chamilo\CoreBundle\Controller */ @@ -27,8 +26,6 @@ class CourseController extends AbstractController * * @Security("has_role('ROLE_TEACHER')") * - * @Template - * * @return Response */ public function addAction(Request $request) @@ -51,9 +48,10 @@ class CourseController extends AbstractController ); } - return [ + /*return [ 'form' => $form->createView(), - ]; + ];*/ + //return $this->render('ChamiloThemeBundle:Default:index.html.twig'); } /** @@ -64,10 +62,9 @@ class CourseController extends AbstractController * class="ChamiloCoreBundle:Course", * options={"repository_method" = "findOneByCode"} * ) - * @Template */ public function welcomeAction(Course $course) { - return ['course' => $course]; + return $this->render('@ChamiloTheme/Course/welcome.html.twig', ['course' => $course]); } } diff --git a/src/CoreBundle/Controller/UserController.php b/src/CoreBundle/Controller/UserController.php index aa40738863..71bec5e961 100644 --- a/src/CoreBundle/Controller/UserController.php +++ b/src/CoreBundle/Controller/UserController.php @@ -3,7 +3,6 @@ namespace Chamilo\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Routing\Annotation\Route; /** @@ -19,15 +18,11 @@ class UserController extends BaseController * @Route("/{username}", methods={"GET"}) * * @param string $username - * - * @Template("ChamiloCoreBundle:User:profile.html.twig") - * - * @return array */ public function profileAction($username): array { $user = $this->container->get('fos_user.user_manager')->findUserByUsername($username); - return ['user' => $user]; + return $this->render('@ChamiloCore/User/profile.html.twig', ['user' => $user]); } } diff --git a/src/CourseBundle/Controller/CToolIntroController.php b/src/CourseBundle/Controller/CToolIntroController.php index 887033e346..230aa52119 100644 --- a/src/CourseBundle/Controller/CToolIntroController.php +++ b/src/CourseBundle/Controller/CToolIntroController.php @@ -7,7 +7,6 @@ use APY\DataGridBundle\Grid\Action\RowAction; use APY\DataGridBundle\Grid\Source\Entity; use Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar\Introduction; use Chamilo\CourseBundle\Entity\CToolIntro; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; @@ -15,9 +14,8 @@ use Symfony\Component\Routing\Annotation\Route; /** * Class CToolIntroController. * - * @package Chamilo\CourseBundle\Controller - * * @author Julio Montoya + * * @Route("/introduction") */ class CToolIntroController extends ToolBaseController @@ -70,16 +68,12 @@ class CToolIntroController extends ToolBaseController // Return the response of the grid to the template return $grid->getGridResponse( - 'ChamiloCourseBundle:CToolIntro:grid.html.twig' + 'grid.html.twig' ); } /** * @Route("/{tool}/create") - * - * @Template("ChamiloCourseBundle:CToolIntro:create.html.twig") - * - * @return array */ public function createAction(Request $request, $tool) { @@ -127,14 +121,15 @@ class CToolIntroController extends ToolBaseController ); } - return ['form' => $form->createView(), 'tool' => $tool]; + return $this->render( + '@ChamiloTheme/CToolIntro/create.html.twig', + ['form' => $form->createView(), 'tool' => $tool] + ); } /** * @Route("/{iid}/update/", methods={"GET|POST"}) * - * @Template("ChamiloCourseBundle:CToolIntro:update.html.twig") - * * @return Response */ public function updateAction($iid, Request $request) @@ -178,11 +173,14 @@ class CToolIntroController extends ToolBaseController ); } - return [ - 'tool' => $tool, - 'iid' => $iid, - 'form' => $form->createView(), - ]; + return $this->render( + '@ChamiloTheme/CToolIntro/update.html.twig', + [ + 'tool' => $tool, + 'iid' => $iid, + 'form' => $form->createView(), + ] + ); } /** diff --git a/src/CourseBundle/Controller/SettingsController.php b/src/CourseBundle/Controller/SettingsController.php index 476a881368..98a1d1c8a1 100644 --- a/src/CourseBundle/Controller/SettingsController.php +++ b/src/CourseBundle/Controller/SettingsController.php @@ -24,6 +24,7 @@ class SettingsController extends AbstractController * * @param Request $request * @param string $namespace + * * @ParamConverter("course", class="ChamiloCoreBundle:Course", options={"repository_method" = "findOneByCode"}) * * @return Response diff --git a/src/CourseBundle/Resources/config/routing.yml b/src/CourseBundle/Resources/config/routing.yml index 3a085a5462..cafba432a1 100644 --- a/src/CourseBundle/Resources/config/routing.yml +++ b/src/CourseBundle/Resources/config/routing.yml @@ -10,7 +10,7 @@ core_tool: core_tool_document: path: /courses/{course}/document/{file} defaults: - _controller: ChamiloCoreBundle:Resource:show + _controller: Chamilo\CoreBundle\Controller\ResourceController::showAction requirements: file: .+ # allow "/" in {file} @@ -18,7 +18,7 @@ chamilo_course_tool_intro_create: path: /courses/{course}/introduction/{tool}/create/ methods: [GET, POST] defaults: - _controller: ChamiloCourseBundle:CToolIntro:create + _controller: Chamilo\CourseBundle\Controller\CToolIntroController::createAction requirements: tool: "[a-zA-Z_]+" @@ -26,13 +26,13 @@ chamilo_course_tool_intro_update: path: /courses/{course}/introduction/{tool}/update/ methods: [GET] defaults: - _controller: chamilo_course.controller.c_tool_intro:updateAction + _controller: Chamilo\CourseBundle\Controller\CToolIntroController::updateAction chamilo_course_tool_list: path: /courses/{course}/introduction methods: [GET] defaults: - _controller: chamilo_course.controller.tool:indexAction + _controller: Chamilo\CourseBundle\Controller\CToolIntroController::indexAction #chamilo_course.c_tool_intro: @@ -46,11 +46,11 @@ chamilo_course_tool_list: chamilo_course_settings: path: /courses/{course}/settings/{namespace} defaults: - _controller: ChamiloCourseBundle:Settings:update + _controller: Chamilo\CourseBundle\Controller\SettingsController::updateAction template: ChamiloCourseBundle:Settings:default.html.twig chamilo_course_tool_index: path: /courses/{course}/tools methods: [GET, POST, HEAD, DELETE] defaults: - _controller: chamilo_course.controller.tool:indexAction + _controller: Chamilo\CourseBundle\Controller\CToolIntroController::indexAction diff --git a/src/FaqBundle/Resources/config/routing.yml b/src/FaqBundle/Resources/config/routing.yml index f3a961d141..a3bc961cd4 100644 --- a/src/FaqBundle/Resources/config/routing.yml +++ b/src/FaqBundle/Resources/config/routing.yml @@ -1,12 +1,12 @@ faq_index: path: /faq - defaults: {_controller: 'ChamiloFaqBundle:Faq:index', categorySlug: null, questionSlug: null} + defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexAction', categorySlug: null, questionSlug: null} faq: path: /faq/{categorySlug}/{questionSlug} - defaults: {_controller: 'ChamiloFaqBundle:Faq:index', categorySlug: null, questionSlug: null} + defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexAction', categorySlug: null, questionSlug: null} # Shows the entire FAQ at once, without collapsing any categories or questions. Useful if your FAQ is not that big. faq_without_collapse: path: /faq-without-collapse/{categorySlug} - defaults: {_controller: 'ChamiloFaqBundle:Faq:indexWithoutCollapse', categorySlug: null} + defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexWithoutCollapseAction', categorySlug: null} diff --git a/src/LtiBundle/Resources/config/routing.yml b/src/LtiBundle/Resources/config/routing.yml index af8c29f683..c67c96f158 100644 --- a/src/LtiBundle/Resources/config/routing.yml +++ b/src/LtiBundle/Resources/config/routing.yml @@ -11,4 +11,4 @@ chamilo_lti_teacher_controller: chamilo_lti_service_controller: path: /lti/os defaults: - _controller: 'ChamiloLtiBundle:Service:outcomeService' + _controller: Chamilo\LtiBundle\Controller\ServiceController::outcomeServiceAction diff --git a/src/ThemeBundle/Controller/DefaultController.php b/src/ThemeBundle/Controller/DefaultController.php index cdfef1c9fc..264acf0811 100644 --- a/src/ThemeBundle/Controller/DefaultController.php +++ b/src/ThemeBundle/Controller/DefaultController.php @@ -4,7 +4,6 @@ namespace Chamilo\ThemeBundle\Controller; use Chamilo\ThemeBundle\Form\FormDemoModelType; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; /** @@ -14,20 +13,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; */ class DefaultController extends AbstractController { - /** - * @Template() - */ - public function indexAction() - { - return []; - } - /** * @return \Symfony\Component\HttpFoundation\Response */ public function dashboardAction() { - return $this->render('ChamiloThemeBundle:Default:index.html.twig'); + return $this->render('ChamiloThemeBundle:Default:index.html.twig'); } /** diff --git a/src/ThemeBundle/Resources/views/CToolIntro/create.html.twig b/src/ThemeBundle/Resources/views/CToolIntro/create.html.twig new file mode 100644 index 0000000000..de05db5b7e --- /dev/null +++ b/src/ThemeBundle/Resources/views/CToolIntro/create.html.twig @@ -0,0 +1,14 @@ +{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %} + +{% block page_title %} {{ title }}{% endblock %} +{#{% block page_subtitle %}{{ course.code }}{% endblock %}#} + +{% block content %} +

{{ tool }}

+ +
+ + {{ form_widget(form) }} +
+{% endblock %} \ No newline at end of file diff --git a/src/ThemeBundle/Resources/views/CToolIntro/grid.html.twig b/src/ThemeBundle/Resources/views/CToolIntro/grid.html.twig new file mode 100644 index 0000000000..66e7fdd7df --- /dev/null +++ b/src/ThemeBundle/Resources/views/CToolIntro/grid.html.twig @@ -0,0 +1,8 @@ +{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %} + +{% block page_title %} {{ title }}{% endblock %} +{#{% block page_subtitle %}{{ course.code }}{% endblock %}#} + +{% block content %} + {{ grid(grid) }} +{% endblock %} \ No newline at end of file diff --git a/src/ThemeBundle/Resources/views/CToolIntro/update.html.twig b/src/ThemeBundle/Resources/views/CToolIntro/update.html.twig new file mode 100644 index 0000000000..774fa7c592 --- /dev/null +++ b/src/ThemeBundle/Resources/views/CToolIntro/update.html.twig @@ -0,0 +1,12 @@ +{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %} + +{% block page_title %} {{ title }}{% endblock %} + +{% block content %} +

{{ tool }}

+ +
+ {{ form_widget(form) }} +
+{% endblock %} \ No newline at end of file diff --git a/src/ThemeBundle/Resources/views/Course/welcome.html.twig b/src/ThemeBundle/Resources/views/Course/welcome.html.twig new file mode 100644 index 0000000000..82dca1e952 --- /dev/null +++ b/src/ThemeBundle/Resources/views/Course/welcome.html.twig @@ -0,0 +1 @@ +Welcome to course {{ course.code }}! \ No newline at end of file diff --git a/src/ThemeBundle/Resources/views/Index/index.html.twig b/src/ThemeBundle/Resources/views/Index/index.html.twig index 620bb323fa..7f74787d92 100644 --- a/src/ThemeBundle/Resources/views/Index/index.html.twig +++ b/src/ThemeBundle/Resources/views/Index/index.html.twig @@ -6,13 +6,13 @@
{% if chamilo_settings_get('announcement.hide_global_announcements_when_not_connected') == 'false' %} - {{ render(controller('ChamiloCoreBundle:News:news')) }} + {{ render(controller('Chamilo\\CoreBundle\\Controller\\NewsController::newsAction')) }} {% endif %}
- {{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': 'welcome'} )) }} + {{ render(controller('Chamilo\\PageBundle\\Controller\\PageController::renderPageAction', {'slug': 'welcome'} )) }}