Fixes after merge

pull/3006/head
Julio Montoya 5 years ago
parent f1de3858cb
commit 246f6138f8
  1. 2
      config/packages/framework.yaml
  2. 20
      main/gradebook/lib/be/category.class.php
  3. 13
      src/CoreBundle/Controller/CourseController.php
  4. 7
      src/CoreBundle/Controller/UserController.php
  5. 30
      src/CourseBundle/Controller/CToolIntroController.php
  6. 1
      src/CourseBundle/Controller/SettingsController.php
  7. 12
      src/CourseBundle/Resources/config/routing.yml
  8. 6
      src/FaqBundle/Resources/config/routing.yml
  9. 2
      src/LtiBundle/Resources/config/routing.yml
  10. 11
      src/ThemeBundle/Controller/DefaultController.php
  11. 14
      src/ThemeBundle/Resources/views/CToolIntro/create.html.twig
  12. 8
      src/ThemeBundle/Resources/views/CToolIntro/grid.html.twig
  13. 12
      src/ThemeBundle/Resources/views/CToolIntro/update.html.twig
  14. 1
      src/ThemeBundle/Resources/views/Course/welcome.html.twig
  15. 4
      src/ThemeBundle/Resources/views/Index/index.html.twig

@ -7,7 +7,7 @@ framework:
php_errors: php_errors:
log: true log: true
templating: templating:
engines: ['twig', 'php'] engines: ['twig']
session: session:
# handler_id set to null will use default session handler from php.ini # handler_id set to null will use default session handler from php.ini
handler_id: session.handler.native_file handler_id: session.handler.native_file

@ -2584,26 +2584,6 @@ class Category implements GradebookItem
return $this; 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 * @return Category
*/ */

@ -7,7 +7,6 @@ use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Form\Type\CourseType; use Chamilo\CoreBundle\Form\Type\CourseType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -16,7 +15,7 @@ use Symfony\Component\Routing\Annotation\Route;
/** /**
* Class CourseController. * Class CourseController.
* *
* @Route("/course") * @Route("/courses")
* *
* @package Chamilo\CoreBundle\Controller * @package Chamilo\CoreBundle\Controller
*/ */
@ -27,8 +26,6 @@ class CourseController extends AbstractController
* *
* @Security("has_role('ROLE_TEACHER')") * @Security("has_role('ROLE_TEACHER')")
* *
* @Template
*
* @return Response * @return Response
*/ */
public function addAction(Request $request) public function addAction(Request $request)
@ -51,9 +48,10 @@ class CourseController extends AbstractController
); );
} }
return [ /*return [
'form' => $form->createView(), 'form' => $form->createView(),
]; ];*/
//return $this->render('ChamiloThemeBundle:Default:index.html.twig');
} }
/** /**
@ -64,10 +62,9 @@ class CourseController extends AbstractController
* class="ChamiloCoreBundle:Course", * class="ChamiloCoreBundle:Course",
* options={"repository_method" = "findOneByCode"} * options={"repository_method" = "findOneByCode"}
* ) * )
* @Template
*/ */
public function welcomeAction(Course $course) public function welcomeAction(Course $course)
{ {
return ['course' => $course]; return $this->render('@ChamiloTheme/Course/welcome.html.twig', ['course' => $course]);
} }
} }

@ -3,7 +3,6 @@
namespace Chamilo\CoreBundle\Controller; namespace Chamilo\CoreBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
/** /**
@ -19,15 +18,11 @@ class UserController extends BaseController
* @Route("/{username}", methods={"GET"}) * @Route("/{username}", methods={"GET"})
* *
* @param string $username * @param string $username
*
* @Template("ChamiloCoreBundle:User:profile.html.twig")
*
* @return array
*/ */
public function profileAction($username): array public function profileAction($username): array
{ {
$user = $this->container->get('fos_user.user_manager')->findUserByUsername($username); $user = $this->container->get('fos_user.user_manager')->findUserByUsername($username);
return ['user' => $user]; return $this->render('@ChamiloCore/User/profile.html.twig', ['user' => $user]);
} }
} }

@ -7,7 +7,6 @@ use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Source\Entity; use APY\DataGridBundle\Grid\Source\Entity;
use Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar\Introduction; use Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar\Introduction;
use Chamilo\CourseBundle\Entity\CToolIntro; use Chamilo\CourseBundle\Entity\CToolIntro;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
@ -15,9 +14,8 @@ use Symfony\Component\Routing\Annotation\Route;
/** /**
* Class CToolIntroController. * Class CToolIntroController.
* *
* @package Chamilo\CourseBundle\Controller
*
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*
* @Route("/introduction") * @Route("/introduction")
*/ */
class CToolIntroController extends ToolBaseController class CToolIntroController extends ToolBaseController
@ -70,16 +68,12 @@ class CToolIntroController extends ToolBaseController
// Return the response of the grid to the template // Return the response of the grid to the template
return $grid->getGridResponse( return $grid->getGridResponse(
'ChamiloCourseBundle:CToolIntro:grid.html.twig' 'grid.html.twig'
); );
} }
/** /**
* @Route("/{tool}/create") * @Route("/{tool}/create")
*
* @Template("ChamiloCourseBundle:CToolIntro:create.html.twig")
*
* @return array
*/ */
public function createAction(Request $request, $tool) 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"}) * @Route("/{iid}/update/", methods={"GET|POST"})
* *
* @Template("ChamiloCourseBundle:CToolIntro:update.html.twig")
*
* @return Response * @return Response
*/ */
public function updateAction($iid, Request $request) public function updateAction($iid, Request $request)
@ -178,11 +173,14 @@ class CToolIntroController extends ToolBaseController
); );
} }
return [ return $this->render(
'tool' => $tool, '@ChamiloTheme/CToolIntro/update.html.twig',
'iid' => $iid, [
'form' => $form->createView(), 'tool' => $tool,
]; 'iid' => $iid,
'form' => $form->createView(),
]
);
} }
/** /**

@ -24,6 +24,7 @@ class SettingsController extends AbstractController
* *
* @param Request $request * @param Request $request
* @param string $namespace * @param string $namespace
*
* @ParamConverter("course", class="ChamiloCoreBundle:Course", options={"repository_method" = "findOneByCode"}) * @ParamConverter("course", class="ChamiloCoreBundle:Course", options={"repository_method" = "findOneByCode"})
* *
* @return Response * @return Response

@ -10,7 +10,7 @@ core_tool:
core_tool_document: core_tool_document:
path: /courses/{course}/document/{file} path: /courses/{course}/document/{file}
defaults: defaults:
_controller: ChamiloCoreBundle:Resource:show _controller: Chamilo\CoreBundle\Controller\ResourceController::showAction
requirements: requirements:
file: .+ # allow "/" in {file} file: .+ # allow "/" in {file}
@ -18,7 +18,7 @@ chamilo_course_tool_intro_create:
path: /courses/{course}/introduction/{tool}/create/ path: /courses/{course}/introduction/{tool}/create/
methods: [GET, POST] methods: [GET, POST]
defaults: defaults:
_controller: ChamiloCourseBundle:CToolIntro:create _controller: Chamilo\CourseBundle\Controller\CToolIntroController::createAction
requirements: requirements:
tool: "[a-zA-Z_]+" tool: "[a-zA-Z_]+"
@ -26,13 +26,13 @@ chamilo_course_tool_intro_update:
path: /courses/{course}/introduction/{tool}/update/ path: /courses/{course}/introduction/{tool}/update/
methods: [GET] methods: [GET]
defaults: defaults:
_controller: chamilo_course.controller.c_tool_intro:updateAction _controller: Chamilo\CourseBundle\Controller\CToolIntroController::updateAction
chamilo_course_tool_list: chamilo_course_tool_list:
path: /courses/{course}/introduction path: /courses/{course}/introduction
methods: [GET] methods: [GET]
defaults: defaults:
_controller: chamilo_course.controller.tool:indexAction _controller: Chamilo\CourseBundle\Controller\CToolIntroController::indexAction
#chamilo_course.c_tool_intro: #chamilo_course.c_tool_intro:
@ -46,11 +46,11 @@ chamilo_course_tool_list:
chamilo_course_settings: chamilo_course_settings:
path: /courses/{course}/settings/{namespace} path: /courses/{course}/settings/{namespace}
defaults: defaults:
_controller: ChamiloCourseBundle:Settings:update _controller: Chamilo\CourseBundle\Controller\SettingsController::updateAction
template: ChamiloCourseBundle:Settings:default.html.twig template: ChamiloCourseBundle:Settings:default.html.twig
chamilo_course_tool_index: chamilo_course_tool_index:
path: /courses/{course}/tools path: /courses/{course}/tools
methods: [GET, POST, HEAD, DELETE] methods: [GET, POST, HEAD, DELETE]
defaults: defaults:
_controller: chamilo_course.controller.tool:indexAction _controller: Chamilo\CourseBundle\Controller\CToolIntroController::indexAction

@ -1,12 +1,12 @@
faq_index: faq_index:
path: /faq path: /faq
defaults: {_controller: 'ChamiloFaqBundle:Faq:index', categorySlug: null, questionSlug: null} defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexAction', categorySlug: null, questionSlug: null}
faq: faq:
path: /faq/{categorySlug}/{questionSlug} 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. # Shows the entire FAQ at once, without collapsing any categories or questions. Useful if your FAQ is not that big.
faq_without_collapse: faq_without_collapse:
path: /faq-without-collapse/{categorySlug} path: /faq-without-collapse/{categorySlug}
defaults: {_controller: 'ChamiloFaqBundle:Faq:indexWithoutCollapse', categorySlug: null} defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexWithoutCollapseAction', categorySlug: null}

@ -11,4 +11,4 @@ chamilo_lti_teacher_controller:
chamilo_lti_service_controller: chamilo_lti_service_controller:
path: /lti/os path: /lti/os
defaults: defaults:
_controller: 'ChamiloLtiBundle:Service:outcomeService' _controller: Chamilo\LtiBundle\Controller\ServiceController::outcomeServiceAction

@ -4,7 +4,6 @@
namespace Chamilo\ThemeBundle\Controller; namespace Chamilo\ThemeBundle\Controller;
use Chamilo\ThemeBundle\Form\FormDemoModelType; use Chamilo\ThemeBundle\Form\FormDemoModelType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/** /**
@ -14,20 +13,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
*/ */
class DefaultController extends AbstractController class DefaultController extends AbstractController
{ {
/**
* @Template()
*/
public function indexAction()
{
return [];
}
/** /**
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function dashboardAction() public function dashboardAction()
{ {
return $this->render('ChamiloThemeBundle:Default:index.html.twig'); return $this->render('ChamiloThemeBundle:Default:index.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 %}
<h4>{{ tool }}</h4>
<form method="post"
action="{{ path('chamilo_course_ctoolintro_create', {'course': course.code, 'tool' : tool}) }}">
{{ form_widget(form) }}
</form>
{% endblock %}

@ -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 %}

@ -0,0 +1,12 @@
{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %}
{% block page_title %} {{ title }}{% endblock %}
{% block content %}
<h4>{{ tool }}</h4>
<form method="post"
action="{{ path('chamilo_course_ctoolintro_update', {'course': course.code, 'tool' : tool, 'iid' : iid }) }}">
{{ form_widget(form) }}
</form>
{% endblock %}

@ -0,0 +1 @@
Welcome to course {{ course.code }}!

@ -6,13 +6,13 @@
<section class="section-slider pb-5 pt-5"> <section class="section-slider pb-5 pt-5">
<div class="container"> <div class="container">
{% if chamilo_settings_get('announcement.hide_global_announcements_when_not_connected') == 'false' %} {% 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 %} {% endif %}
</div> </div>
</section> </section>
<section class="section-welcome pb-5 pt-5"> <section class="section-welcome pb-5 pt-5">
<div class="container"> <div class="container">
{{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': 'welcome'} )) }} {{ render(controller('Chamilo\\PageBundle\\Controller\\PageController::renderPageAction', {'slug': 'welcome'} )) }}
</div> </div>
</section> </section>
<section class="section-content"> <section class="section-content">

Loading…
Cancel
Save