mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
@@ -7,6 +7,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
|
||||
class AccompanyingPeriodType extends AbstractType
|
||||
{
|
||||
@@ -38,6 +40,8 @@ class AccompanyingPeriodType extends AbstractType
|
||||
//if the period_action is "close, should not be shown"
|
||||
($options['period_action'] === 'close')
|
||||
OR
|
||||
($options['period_action'] === 'create')
|
||||
OR
|
||||
($options['period_action'] === 'update' AND !$accompanyingPeriod->isOpen())
|
||||
) {
|
||||
$form->add('closingDate', 'date', array('required' => true,
|
||||
@@ -65,7 +69,12 @@ class AccompanyingPeriodType extends AbstractType
|
||||
->setRequired(array('period_action'))
|
||||
->addAllowedTypes(array('period_action' => 'string'))
|
||||
->addAllowedValues(array('period_action' => array(
|
||||
'update', 'open', 'close')));
|
||||
'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