mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
fix deprecations: replace many strings by fqcn
This commit is contained in:
@@ -9,6 +9,7 @@ use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
|
||||
class AccompanyingPeriodType extends AbstractType
|
||||
{
|
||||
@@ -22,13 +23,13 @@ class AccompanyingPeriodType extends AbstractType
|
||||
if ($options['period_action'] !== 'close') {
|
||||
$builder
|
||||
->add('openingDate', 'date', array(
|
||||
"required" => true,
|
||||
"required" => true,
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy'
|
||||
));
|
||||
}
|
||||
|
||||
// the closingDate should be seen only if period_action = close
|
||||
|
||||
// the closingDate should be seen only if period_action = close
|
||||
// or period_action = update AND accopanying period is already closed
|
||||
$builder->addEventListener(
|
||||
FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) {
|
||||
@@ -49,13 +50,13 @@ class AccompanyingPeriodType extends AbstractType
|
||||
$form->add('closingMotive', 'closing_motive');
|
||||
}
|
||||
});
|
||||
|
||||
$builder->add('remark', 'textarea', array(
|
||||
|
||||
$builder->add('remark', TextareaType::class, array(
|
||||
'required' => false
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param OptionsResolverInterface $resolver
|
||||
*/
|
||||
@@ -71,7 +72,7 @@ class AccompanyingPeriodType extends AbstractType
|
||||
->addAllowedValues(array('period_action' => array(
|
||||
'update', 'open', 'close', 'create')));
|
||||
}
|
||||
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['action'] = $options['period_action'];
|
||||
|
Reference in New Issue
Block a user