diff --git a/src/Bundle/ChillMainBundle/Form/AbsenceType.php b/src/Bundle/ChillMainBundle/Form/AbsenceType.php index e5e92398e..e23e350c9 100644 --- a/src/Bundle/ChillMainBundle/Form/AbsenceType.php +++ b/src/Bundle/ChillMainBundle/Form/AbsenceType.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Form; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillDateTimeType; +use Chill\MainBundle\Form\Type\ChillDateType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -20,20 +21,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AbsenceType extends AbstractType { - private TranslatorInterface $translator; - - public function __construct(TranslatorInterface $translator) - { - $this->translator = $translator; - } - public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('absenceStart', ChillDateTimeType::class, [ + ->add('absenceStart', ChillDateType::class, [ 'required' => true, 'input' => 'datetime_immutable', - 'label' => $this->translator->trans('absence.Absence start'), + 'label' => 'absence.Absence start', ]); } diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index 532bc7b5b..f37c48a92 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -16,6 +16,7 @@ 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\ChillDateType; use Chill\MainBundle\Form\Type\PickCivilityType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\EntityRepository; @@ -40,16 +41,12 @@ class UserType extends AbstractType private TranslatableStringHelper $translatableStringHelper; - private TranslatorInterface $translator; - public function __construct( TranslatableStringHelper $translatableStringHelper, - ParameterBagInterface $parameterBag, - TranslatorInterface $translator + ParameterBagInterface $parameterBag ) { $this->translatableStringHelper = $translatableStringHelper; $this->parameterBag = $parameterBag; - $this->translator = $translator; } public function buildForm(FormBuilderInterface $builder, array $options) @@ -117,10 +114,10 @@ class UserType extends AbstractType return $qb; }, ]) - ->add('absenceStart', ChillDateTimeType::class, [ + ->add('absenceStart', ChillDateType::class, [ 'required' => false, 'input' => 'datetime_immutable', - 'label' => $this->translator->trans('absence.Absence start'), + 'label' => 'absence.Absence start', ]); // @phpstan-ignore-next-line