mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
use pickDynamicUserType
This commit is contained in:
parent
4c125865cf
commit
6d382f93e8
@ -17,6 +17,7 @@ use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use DateInterval;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
@ -68,22 +69,27 @@ final class AsideActivityFormType extends AbstractType
|
||||
];
|
||||
|
||||
$builder
|
||||
->add(
|
||||
'agent',
|
||||
EntityType::class,
|
||||
[
|
||||
'label' => 'For agent',
|
||||
'required' => true,
|
||||
'class' => User::class,
|
||||
'data' => $this->storage->getToken()->getUser(),
|
||||
'query_builder' => static function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('u')->where('u.enabled = true');
|
||||
},
|
||||
'attr' => ['class' => 'select2 '],
|
||||
'placeholder' => 'Choose the agent for whom this activity is created',
|
||||
'choice_label' => 'username',
|
||||
]
|
||||
)
|
||||
// ->add(
|
||||
// 'agent',
|
||||
// EntityType::class,
|
||||
// [
|
||||
// 'label' => 'For agent',
|
||||
// 'required' => true,
|
||||
// 'class' => User::class,
|
||||
// 'data' => $this->storage->getToken()->getUser(),
|
||||
// 'query_builder' => static function (EntityRepository $er) {
|
||||
// return $er->createQueryBuilder('u')->where('u.enabled = true');
|
||||
// },
|
||||
// 'attr' => ['class' => 'select2 '],
|
||||
// 'placeholder' => 'Choose the agent for whom this activity is created',
|
||||
// 'choice_label' => 'username',
|
||||
// ]
|
||||
// )
|
||||
->add('agent', PickUserDynamicType::class, [
|
||||
'multiple' => true,
|
||||
'label' => 'For agent',
|
||||
'required' => true,
|
||||
])
|
||||
->add(
|
||||
'date',
|
||||
ChillDateType::class,
|
||||
|
@ -1,5 +1,15 @@
|
||||
{% extends '@ChillMain/Admin/layout.html.twig' %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
@ -8,4 +18,5 @@
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user