mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-04 03:08:25 +00:00 
			
		
		
		
	implementation in thirdpartyType
This commit is contained in:
		@@ -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,
 | 
			
		||||
                ])
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user