diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 444c663fc..97678af50 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -650,8 +650,8 @@ final class ActivityController extends AbstractController throw $this->createNotFoundException('Accompanying Period not found'); } - // TODO Add permission - // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + // TODO Add permission + // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); } else { throw $this->createNotFoundException('Person or Accompanying Period not found'); } diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 768a0fabe..91827267c 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -178,7 +178,6 @@ class ActivityContext implements 'placeholder' => $this->translator->trans('Any third party selected'), ]); } - } public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index 29e8c81a3..b8923267a 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -215,11 +215,13 @@ class AccompanyingPeriodContext implements $thirdParties = array_merge( array_filter([$entity->getRequestorThirdParty()]), - array_filter(array_map( + array_filter( + array_map( fn (Resource $r): ?ThirdParty => $r->getThirdParty(), $entity->getResources()->filter( static fn (Resource $r): bool => null !== $r->getThirdParty() - )->toArray()) + )->toArray() + ) ) ); diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php index efd687ec9..86e2f8ae9 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php @@ -123,13 +123,14 @@ class AccompanyingPeriodWorkEvaluationContext implements $thirdParties = array_merge( array_filter($entity->getAccompanyingPeriodWork()->getThirdParties()->toArray()), array_filter([$entity->getAccompanyingPeriodWork()->getHandlingThierParty()]), - array_filter(array_map( + array_filter( + array_map( fn (Resource $r): ?ThirdParty => $r->getThirdParty(), $entity->getAccompanyingPeriodWork()->getAccompanyingPeriod()->getResources()->filter( static fn (Resource $r): bool => null !== $r->getThirdParty() - )->toArray()) + )->toArray() + ) ) - ); $options = $template->getOptions(); @@ -145,9 +146,6 @@ class AccompanyingPeriodWorkEvaluationContext implements 'placeholder' => $this->translator->trans('Any third party selected'), ]); } - - - } public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php index 30faa97fd..cc46c3341 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php @@ -177,18 +177,21 @@ final class PersonContext implements PersonContextInterface ]); $thirdParties = array_merge( - array_filter(array_map( + array_filter( + array_map( fn (ResidentialAddress $r): ?ThirdParty => $r->getHostThirdParty(), $this ->residentialAddressRepository ->findCurrentResidentialAddressByPerson($entity) - ) + ) ), - array_filter(array_map( + array_filter( + array_map( fn (PersonResource $r): ?ThirdParty => $r->getThirdParty(), $entity->getResources()->filter( static fn (PersonResource $r): bool => null !== $r->getThirdParty() - )->toArray()) + )->toArray() + ) ) ); diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 6c4984f33..b1446a543 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -117,7 +117,7 @@ class ThirdPartyType extends AbstractType 'label' => 'thirdparty.Contact data are confidential', ]); - // Institutional ThirdParty (parent) + // Institutional ThirdParty (parent) } else { $builder ->add('nameCompany', TextType::class, [