mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
finalize members lists
This commit is contained in:
42
src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php
Normal file
42
src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php
Normal 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'
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user