finalize members lists

This commit is contained in:
2021-06-07 17:03:45 +02:00
parent 604e78f35e
commit 5cb076495a
9 changed files with 201 additions and 36 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Chill\PersonBundle\Form;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
class HouseholdMemberType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('startDate', ChillDateType::class, [
'label' => 'household.Start date',
'input' => 'datetime_immutable',
])
->add('endDate', ChillDateType::class, [
'label' => 'household.End date',
'input' => 'datetime_immutable',
'required' => false
])
;
if ($options['data']->getPosition()->isAllowHolder()) {
$builder
->add('holder', ChoiceType::class, [
'label' => 'household.holder',
'choices' => [
'household.is holder' => true,
'household.is not holder' => false
]
]);
}
$builder
->add('comment', ChillTextareaType::class, [
'label' => 'household.Comment'
])
;
}
}