From 20104f1b3b92f52917f9c90d2f169d95f425b095 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 16 Feb 2022 16:58:37 +0100 Subject: [PATCH] implementation in thirdpartyType --- .../ChillThirdPartyBundle/Form/ThirdPartyType.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index b4ab8655d..7ca5188b1 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -11,11 +11,11 @@ declare(strict_types=1); namespace Chill\ThirdPartyBundle\Form; -use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\PickAddressType; use Chill\MainBundle\Form\Type\PickCenterType; +use Chill\MainBundle\Form\Type\PickCivilityType; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\ThirdPartyBundle\Entity\ThirdParty; @@ -101,16 +101,8 @@ class ThirdPartyType extends AbstractType // Contact Person ThirdParty (child) if (ThirdParty::KIND_CONTACT === $options['kind'] || ThirdParty::KIND_CHILD === $options['kind']) { $builder - ->add('civility', EntityType::class, [ + ->add('civility', PickCivilityType::class, [ 'label' => 'thirdparty.Civility', - 'class' => Civility::class, - 'choice_label' => function (Civility $civility): string { - return $this->translatableStringHelper->localize($civility->getName()); - }, - 'query_builder' => static function (EntityRepository $er): QueryBuilder { - return $er->createQueryBuilder('c') - ->where('c.active = true'); - }, 'placeholder' => 'thirdparty.choose civility', 'required' => false, ])