From d3127bed6d03a478dab4ef01e59a0cf4806e8177 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 14 Dec 2021 14:57:11 +0100 Subject: [PATCH] thirdparty: add address on kind = contact --- src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php | 6 +++--- .../Resources/views/ThirdParty/_form.html.twig | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 29069c67d..4146e98a3 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -134,9 +134,6 @@ class ThirdPartyType extends AbstractType // Institutional ThirdParty (parent) } else { $builder - ->add('address', PickAddressType::class, [ - 'label' => 'Address', - ]) ->add('nameCompany', TextType::class, [ 'label' => 'thirdparty.NameCompany', 'required' => false, @@ -164,6 +161,9 @@ class ThirdPartyType extends AbstractType if (ThirdParty::KIND_CHILD !== $options['kind']) { $builder + ->add('address', PickAddressType::class, [ + 'label' => 'Address', + ]) ->add('typesAndCategories', PickThirdPartyTypeCategoryType::class, [ 'label' => 'thirdparty.Categories', ]) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig index 6b3133fd5..6b76b5cb0 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/_form.html.twig @@ -28,7 +28,7 @@ {{ form_widget(form.activeChildren) }} {% endif %} -{% if thirdParty.kind != 'contact' and thirdParty.kind != 'child' %} +{% if form.address is defined %} {{ form_row(form.address) }} {% endif %}