mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 17:28:23 +00:00 
			
		
		
		
	accompanying period: hide activity entries from the menu if accompanyin period is DRAFT
This commit is contained in:
		| @@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Menu; | ||||
|  | ||||
| use Chill\MainBundle\Routing\LocalMenuBuilderInterface; | ||||
| use Chill\MainBundle\Security\Authorization\AuthorizationHelper; | ||||
| use Chill\PersonBundle\Entity\AccompanyingPeriod; | ||||
| use Knp\Menu\MenuItem; | ||||
| use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; | ||||
| use Symfony\Contracts\Translation\TranslatorInterface; | ||||
| @@ -34,21 +35,13 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface | ||||
|     { | ||||
|         $period = $parameters['accompanyingCourse']; | ||||
|  | ||||
|         if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) { | ||||
|         $menu->addChild($this->translator->trans('Activity list'), [ | ||||
|             'route' => 'chill_activity_activity_list', | ||||
|             'routeParameters' => [ | ||||
|                 'accompanying_period_id' => $period->getId(), | ||||
|             ]]) | ||||
|             ->setExtras(['order' => 40]); | ||||
|  | ||||
|         $menu->addChild($this->translator->trans('Add a new activity'), [ | ||||
|             'route' => 'chill_activity_activity_select_type', | ||||
|             'routeParameters' => [ | ||||
|                 'accompanying_period_id' => $period->getId(), | ||||
|             ]]) | ||||
|             ->setExtras(['order' => 41]); | ||||
|  | ||||
|  | ||||
|  | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user