From 985d8f0eae9fc420d56fe1aabb0802742a107102 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 13 Dec 2021 15:31:46 +0100 Subject: [PATCH] thirdparty form: clean builder, and test if this kind input address --- src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php | 6 ------ .../Resources/views/ThirdParty/_form.html.twig | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index a32c0ade2..29069c67d 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -137,12 +137,6 @@ class ThirdPartyType extends AbstractType ->add('address', PickAddressType::class, [ 'label' => 'Address', ]) - ->add('address2', PickAddressType::class, [ - 'label' => 'Address', - 'use_valid_from' => true, - 'use_valid_to' => true, - 'mapped' => false, - ]) ->add('nameCompany', TextType::class, [ 'label' => 'thirdparty.NameCompany', 'required' => false, diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig index c53764871..6b3133fd5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig @@ -28,7 +28,9 @@ {{ form_widget(form.activeChildren) }} {% endif %} -{{ form_row(form.address) }} +{% if thirdParty.kind != 'contact' and thirdParty.kind != 'child' %} + {{ form_row(form.address) }} +{% endif %} {{ form_row(form.comment) }}