mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
FEATURE [form] adjust symfony form to use text type
This commit is contained in:
parent
ac4c821290
commit
bea839663f
@ -20,14 +20,10 @@ use Chill\MainBundle\Form\Type\PickCivilityType;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
|
||||
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyTypeCategoryType;
|
||||
use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter;
|
||||
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
@ -111,17 +107,8 @@ class ThirdPartyType extends AbstractType
|
||||
'placeholder' => 'thirdparty.choose civility',
|
||||
'required' => false,
|
||||
])
|
||||
->add('profession', EntityType::class, [
|
||||
->add('profession', TextType::class, [
|
||||
'label' => 'thirdparty.Profession',
|
||||
'class' => ThirdPartyProfession::class,
|
||||
'choice_label' => function (ThirdPartyProfession $profession): string {
|
||||
return $this->translatableStringHelper->localize($profession->getName());
|
||||
},
|
||||
'query_builder' => static function (EntityRepository $er): QueryBuilder {
|
||||
return $er->createQueryBuilder('p')
|
||||
->where('p.active = true');
|
||||
},
|
||||
'placeholder' => 'thirdparty.choose profession',
|
||||
'required' => false,
|
||||
])
|
||||
->add('contactDataAnonymous', CheckboxType::class, [
|
||||
|
Loading…
x
Reference in New Issue
Block a user