person: create a person with address (php form)

This commit is contained in:
nobohan
2022-04-19 14:56:41 +02:00
parent 84038c0ff2
commit 4bc8da9655
6 changed files with 66 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Event\CustomizeFormEvent;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillPhoneNumberType;
use Chill\MainBundle\Form\Type\PickAddressType;
use Chill\MainBundle\Form\Type\PickCenterType;
use Chill\MainBundle\Form\Type\PickCivilityType;
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
@@ -25,7 +26,9 @@ use libphonenumber\PhoneNumberType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -77,6 +80,15 @@ final class CreationPersonType extends AbstractType
])
->add('email', EmailType::class, [
'required' => false,
])
->add('addressForm', CheckboxType::class, [
'label' => 'Create a household and add an address',
'required' => false,
'mapped' => false
])
->add('address', PickAddressType::class, [
'required' => false,
'mapped' => false
]);
if ($this->askCenters) {