diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php new file mode 100644 index 000000000..e02b6e4c3 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -0,0 +1,43 @@ +personResourceRepository = $personResourceRepository; + $this->personRepository = $personRepository; + } + + public function listAction($person_id) + { + dump($person_id); + $person = $this->personRepository->find($person_id); + dump($person); + return $this->render( + 'ChillPersonBundle:PersonResource:list.html.twig', + [ + 'person' => $person + ] + ); + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php index d83fa29dd..228309737 100644 --- a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php @@ -96,6 +96,16 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface 'order' => 100, ]); } + + $menu->addChild($this->translator->trans('person_resources_menu'), [ + 'route' => 'chill_person_resource_list', + 'routeParameters' => [ + 'person_id' => $parameters['person']->getId(), + ], + ]) + ->setExtras([ + 'order' => 99999, + ]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php new file mode 100644 index 000000000..1874bec05 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php @@ -0,0 +1,61 @@ +repository = $entityManager->getRepository(PersonResource::class); + } + + public function find($id): ?PersonResource + { + return $this->repository->find($id); + } + + /** + * @return PersonResource[] + */ + public function findAll(): array + { + return $this->repository->findAll(); + } + + /** + * @param mixed|null $limit + * @param mixed|null $offset + * + * @return PersonResource[] + */ + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array + { + return $this->repository->findBy($criteria, $orderBy, $limit, $offset); + } + + public function findOneBy(array $criteria): ?PersonResource + { + return $this->repository->findOneBy($criteria); + } + + public function getClassName(): string + { + return PersonResource::class; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig new file mode 100644 index 000000000..8e943c43a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig @@ -0,0 +1,32 @@ +{% extends "@ChillPerson/Person/layout.html.twig" %} + +{% set activeRouteKey = 'chill_person_resource_list' %} + +{% block title %}{{ 'Person resources'|trans|capitalize ~ ' ' ~ person|chill_entity_render_string }}{% endblock %} + +{% block personcontent %} + +{{ person }} +
+
+
+
Hello
+
there
+
+
+
How
+
are
+
+
+
+
+
you
+
doing
+
+
+
today
+
?
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index bbcb7c39b..3fbf38c0d 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -55,6 +55,10 @@ chill_person_accompanying_period_re_open: path: /{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open controller: Chill\PersonBundle\Controller\AccompanyingPeriodController::reOpenAction +chill_person_resource_list: + path: /{_locale}/person/resource/{person_id}/general + controller: Chill\PersonBundle\Controller\PersonResourceController::listAction + chill_person_address_list: path: /{_locale}/person/{person_id}/address/list controller: Chill\PersonBundle\Controller\PersonAddressController::listAction diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index a1083dc88..34a4cb0f7 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -223,6 +223,11 @@ Are you sure you want to remove the accompanying period "%id%" ?: Êtes-vous s The accompanying course has been successfully removed.: La période d'accompagnement a été supprimée. Concerned scopes: Services concernés +# person resource + +person_resources_menu: "Ressources" +Person resources: 'Réssources de la personne' + # pickAPersonType Pick a person: Choisir une personne