diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index b738cc8c7..532bc7b5b 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\UserJob; +use Chill\MainBundle\Form\Type\ChillDateTimeType; use Chill\MainBundle\Form\Type\PickCivilityType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\EntityRepository; @@ -31,6 +32,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\Regex; +use Symfony\Contracts\Translation\TranslatorInterface; class UserType extends AbstractType { @@ -38,12 +40,16 @@ class UserType extends AbstractType private TranslatableStringHelper $translatableStringHelper; + private TranslatorInterface $translator; + public function __construct( TranslatableStringHelper $translatableStringHelper, - ParameterBagInterface $parameterBag + ParameterBagInterface $parameterBag, + TranslatorInterface $translator ) { $this->translatableStringHelper = $translatableStringHelper; $this->parameterBag = $parameterBag; + $this->translator = $translator; } public function buildForm(FormBuilderInterface $builder, array $options) @@ -110,6 +116,11 @@ class UserType extends AbstractType return $qb; }, + ]) + ->add('absenceStart', ChillDateTimeType::class, [ + 'required' => false, + 'input' => 'datetime_immutable', + 'label' => $this->translator->trans('absence.Absence start'), ]); // @phpstan-ignore-next-line