Changed name of PersonMenuBuilder

More general name since it also contains the AccompanyingPeriod task menu entry now.
This commit is contained in:
Julie Lenaerts 2021-09-17 14:49:43 +02:00
parent 01ae50aca7
commit 17b6f287dc
2 changed files with 25 additions and 27 deletions

View File

@ -28,7 +28,7 @@ use Symfony\Component\Translation\TranslatorInterface;
* *
* @author Julien Fastré <julien.fastre@champs-libres.coop> * @author Julien Fastré <julien.fastre@champs-libres.coop>
*/ */
class PersonMenuBuilder implements LocalMenuBuilderInterface class MenuBuilder implements LocalMenuBuilderInterface
{ {
/** /**
* *
@ -86,12 +86,10 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
public function buildAccompanyingCourseMenu($menu, $parameters){ public function buildAccompanyingCourseMenu($menu, $parameters){
//var $person \Chill\PersonBundle\Entity\Person */
$course = $parameters['accompanyingCourse']; $course = $parameters['accompanyingCourse'];
//TODO: implement voter again?
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) { if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
$menu->addChild( $menu->addChild(
$this->translator->trans('Tasks'), [ $this->translator->trans('Tasks'), [
'route' => 'chill_task_singletask_courselist', 'route' => 'chill_task_singletask_courselist',
@ -99,7 +97,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
[ 'course_id' => $course->getId() ] [ 'course_id' => $course->getId() ]
]) ])
->setExtra('order', 400); ->setExtra('order', 400);
// } }
} }
public static function getMenuIds(): array public static function getMenuIds(): array

View File

@ -1,23 +1,23 @@
services: services:
Chill\TaskBundle\Menu\UserMenuBuilder: Chill\TaskBundle\Menu\UserMenuBuilder:
arguments: arguments:
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
$counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask' $counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask'
$translator: '@Symfony\Component\Translation\TranslatorInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface'
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
tags: tags:
- { name: 'chill.menu_builder' } - { name: "chill.menu_builder" }
Chill\TaskBundle\Menu\PersonMenuBuilder: Chill\TaskBundle\Menu\MenuBuilder:
arguments: arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface'
tags: tags:
- { name: 'chill.menu_builder' } - { name: "chill.menu_builder" }
Chill\TaskBundle\Menu\SectionMenuBuilder: Chill\TaskBundle\Menu\SectionMenuBuilder:
arguments: arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface'
tags: tags:
- { name: 'chill.menu_builder' } - { name: "chill.menu_builder" }