mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
FEATURE [admin][absence] add possibility for admin to set absence of a user
This commit is contained in:
parent
44ef21f940
commit
2c5c815f68
@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Center;
|
|||||||
use Chill\MainBundle\Entity\Location;
|
use Chill\MainBundle\Entity\Location;
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Entity\UserJob;
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
|
use Chill\MainBundle\Form\Type\ChillDateTimeType;
|
||||||
use Chill\MainBundle\Form\Type\PickCivilityType;
|
use Chill\MainBundle\Form\Type\PickCivilityType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
@ -31,6 +32,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
use Symfony\Component\Validator\Constraints\Length;
|
use Symfony\Component\Validator\Constraints\Length;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Regex;
|
use Symfony\Component\Validator\Constraints\Regex;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class UserType extends AbstractType
|
class UserType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -38,12 +40,16 @@ class UserType extends AbstractType
|
|||||||
|
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
private TranslatableStringHelper $translatableStringHelper;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
TranslatableStringHelper $translatableStringHelper,
|
||||||
ParameterBagInterface $parameterBag
|
ParameterBagInterface $parameterBag,
|
||||||
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
$this->parameterBag = $parameterBag;
|
$this->parameterBag = $parameterBag;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
@ -110,6 +116,11 @@ class UserType extends AbstractType
|
|||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
},
|
},
|
||||||
|
])
|
||||||
|
->add('absenceStart', ChillDateTimeType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'input' => 'datetime_immutable',
|
||||||
|
'label' => $this->translator->trans('absence.Absence start'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// @phpstan-ignore-next-line
|
// @phpstan-ignore-next-line
|
||||||
|
Loading…
x
Reference in New Issue
Block a user