Commit 2a096431 authored by Julien Fastré's avatar Julien Fastré

Merge remote-tracking branch 'origin/upgrade-sf3' into upgrade-sf3

parents 4b0499cf 3459755d
Pipeline #46300 failed with stages
in 5 minutes and 48 seconds
This diff is collapsed.
......@@ -27,14 +27,16 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Chill\MainBundle\Form\Type\CenterType;
use Chill\PersonBundle\Form\Type\GenderType;
use Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer;
use Chill\PersonBundle\Form\CreationPersonType;
class CreationPersonType extends AbstractType
{
const NAME = 'chill_personbundle_person_creation';
const NAME = CreationPersonType::class;
const FORM_NOT_REVIEWED = 'not_reviewed';
const FORM_REVIEWED = 'reviewed' ;
......@@ -89,7 +91,7 @@ class CreationPersonType extends AbstractType
->add('birthdate', DateType::class, array('required' => false,
'widget' => 'single_text', 'format' => 'dd-MM-yyyy'))
->add('gender', GenderType::class, array(
'required' => true, 'empty_value' => null
'required' => true, 'placeholder' => null
))
->add('creation_date', DateType::class, array(
'required' => true,
......
......@@ -6,6 +6,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
/**
* A type to add a closing motive
......@@ -31,7 +32,7 @@ class ClosingMotiveType extends AbstractType
public function getParent()
{
return 'entity';
return EntityType::class;
}
public function configureOptions(OptionsResolver $resolver)
......@@ -45,8 +46,8 @@ class ClosingMotiveType extends AbstractType
$resolver->setDefaults(array(
'class' => 'ChillPersonBundle:AccompanyingPeriod\ClosingMotive',
'empty_data' => null,
'empty_value' => 'Choose a motive',
'property' => 'name['.$this->locale.']'
'placeholder' => 'Choose a motive',
'choice_label' => 'name['.$this->locale.']'
)
);
}
......
......@@ -28,9 +28,10 @@ class GenderType extends AbstractType {
$resolver->setDefaults(array(
'choices' => $a,
'choices_as_values' => true,
'expanded' => true,
'multiple' => false,
'empty_value' => null
'placeholder' => null
));
}
......
......@@ -75,7 +75,7 @@ class Select2MaritalStatusType extends AbstractType
$resolver->setDefaults(array(
'class' => 'Chill\PersonBundle\Entity\MaritalStatus',
'choices' => $choices
'choices' => array_combine(array_values($choices),array_keys($choices))
));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment