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:
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

@ -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
*/

@ -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]);
}
}

@ -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]);
}
}

@ -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 <gugli100@gmail.com>
*
* @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(),
]
);
}
/**

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

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

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

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

@ -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');
}
/**

@ -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">
<div class="container">
{% 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 %}
</div>
</section>
<section class="section-welcome pb-5 pt-5">
<div class="container">
{{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': 'welcome'} )) }}
{{ render(controller('Chamilo\\PageBundle\\Controller\\PageController::renderPageAction', {'slug': 'welcome'} )) }}
</div>
</section>
<section class="section-content">

Loading…
Cancel
Save