mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
fix return path in tasks
This commit is contained in:
@@ -24,7 +24,7 @@ use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
@@ -35,13 +35,13 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
protected $translator;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
|
||||
public function __construct(
|
||||
AuthorizationCheckerInterface $authorizationChecker,
|
||||
TranslatorInterface $translator)
|
||||
@@ -50,7 +50,7 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
switch($menuId) {
|
||||
@@ -69,15 +69,15 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
}
|
||||
|
||||
public function buildPersonMenu($menu, $parameters){
|
||||
|
||||
|
||||
//var $person \Chill\PersonBundle\Entity\Person */
|
||||
$person = $parameters['person'] ?? null;
|
||||
|
||||
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $person)) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Tasks'), [
|
||||
'route' => 'chill_task_singletask_list',
|
||||
'routeParameters' =>
|
||||
'routeParameters' =>
|
||||
[ 'person_id' => $person->getId() ]
|
||||
])
|
||||
->setExtra('order', 400);
|
||||
@@ -85,18 +85,18 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
}
|
||||
|
||||
public function buildAccompanyingCourseMenu($menu, $parameters){
|
||||
|
||||
|
||||
$course = $parameters['accompanyingCourse'];
|
||||
|
||||
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Tasks'), [
|
||||
'route' => 'chill_task_singletask_courselist',
|
||||
'routeParameters' =>
|
||||
[ 'course_id' => $course->getId() ]
|
||||
'route' => 'chill_task_singletask_by-course_list',
|
||||
'routeParameters' =>
|
||||
[ 'id' => $course->getId() ]
|
||||
])
|
||||
->setExtra('order', 400);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user