mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Feature: [rolling date] do not show the fixed date input, unless the fixed date
value is picked
This commit is contained in:
@@ -16,6 +16,8 @@ use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
@@ -59,8 +61,13 @@ class PickRollingDateType extends AbstractType
|
||||
if (RollingDate::T_FIXED_DATE === $data->getRoll() && null === $data->getFixedDate()) {
|
||||
$context
|
||||
->buildViolation('rolling_date.When fixed date is selected, you must provide a date')
|
||||
->atPath('roll')
|
||||
->atPath('fixedDate')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['uniqid'] = uniqid('rollingdate-');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user