mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Merge remote-tracking branch 'origin/upgrade-sf3' into upgrade-sf3
This commit is contained in:
commit
2a096431fc
@ -54,7 +54,7 @@ class AccompanyingPeriodController extends Controller
|
||||
$person->addAccompanyingPeriod(
|
||||
$accompanyingPeriod);
|
||||
|
||||
$form = $this->createForm(new AccompanyingPeriodType(),
|
||||
$form = $this->createForm(AccompanyingPeriodType::class,
|
||||
$accompanyingPeriod, array('period_action' => 'create'));
|
||||
|
||||
$request = $this->getRequest();
|
||||
@ -111,7 +111,7 @@ class AccompanyingPeriodController extends Controller
|
||||
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person,
|
||||
'You are not allowed to update this person');
|
||||
|
||||
$form = $this->createForm(new AccompanyingPeriodType(),
|
||||
$form = $this->createForm(AccompanyingPeriodType::class,
|
||||
$accompanyingPeriod, array('period_action' => 'update'));
|
||||
$request = $this->getRequest();
|
||||
|
||||
@ -167,7 +167,7 @@ class AccompanyingPeriodController extends Controller
|
||||
}
|
||||
|
||||
$current = $person->getCurrentAccompanyingPeriod();
|
||||
$form = $this->createForm(new AccompanyingPeriodType(), $current, array(
|
||||
$form = $this->createForm(AccompanyingPeriodType::class, $current, array(
|
||||
'period_action' => 'close'
|
||||
));
|
||||
|
||||
@ -267,7 +267,7 @@ class AccompanyingPeriodController extends Controller
|
||||
|
||||
$accompanyingPeriod = new AccompanyingPeriod(new \DateTime());
|
||||
|
||||
$form = $this->createForm(new AccompanyingPeriodType(),
|
||||
$form = $this->createForm(AccompanyingPeriodType::class,
|
||||
$accompanyingPeriod, array('period_action' => 'open'));
|
||||
|
||||
if ($request->getMethod() === 'POST') {
|
||||
|
@ -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))
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user