mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
implementation in thirdpartyType
This commit is contained in:
parent
25264447bc
commit
20104f1b3b
@ -11,11 +11,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ThirdPartyBundle\Form;
|
namespace Chill\ThirdPartyBundle\Form;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\Civility;
|
|
||||||
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
||||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||||
use Chill\MainBundle\Form\Type\PickAddressType;
|
use Chill\MainBundle\Form\Type\PickAddressType;
|
||||||
use Chill\MainBundle\Form\Type\PickCenterType;
|
use Chill\MainBundle\Form\Type\PickCenterType;
|
||||||
|
use Chill\MainBundle\Form\Type\PickCivilityType;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
@ -101,16 +101,8 @@ class ThirdPartyType extends AbstractType
|
|||||||
// Contact Person ThirdParty (child)
|
// Contact Person ThirdParty (child)
|
||||||
if (ThirdParty::KIND_CONTACT === $options['kind'] || ThirdParty::KIND_CHILD === $options['kind']) {
|
if (ThirdParty::KIND_CONTACT === $options['kind'] || ThirdParty::KIND_CHILD === $options['kind']) {
|
||||||
$builder
|
$builder
|
||||||
->add('civility', EntityType::class, [
|
->add('civility', PickCivilityType::class, [
|
||||||
'label' => 'thirdparty.Civility',
|
'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',
|
'placeholder' => 'thirdparty.choose civility',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user