mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
FIX [translations][types] remove redundant translator and change datetime field to date field
This commit is contained in:
parent
86b5f4dfac
commit
f76c031ff3
@ -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',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user