mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
issue 644: Use Vue AddPersons picker to select users
This commit is contained in:
parent
445a8ac8c7
commit
c73bb10dce
@ -15,10 +15,10 @@ namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
|||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
use Doctrine\ORM\Query\Expr\Andx;
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@ -63,13 +63,8 @@ class ByUserFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', EntityType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
'class' => User::class,
|
|
||||||
'choice_label' => function (User $u) {
|
|
||||||
return $this->userRender->renderString($u, []);
|
|
||||||
},
|
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
|||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
|
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
use Doctrine\ORM\Query\Expr\Andx;
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class UserFilter implements FilterInterface
|
class UserFilter implements FilterInterface
|
||||||
@ -58,13 +58,8 @@ class UserFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', EntityType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
'class' => User::class,
|
|
||||||
'choice_label' => function (User $u) {
|
|
||||||
return $this->userRender->renderString($u, []);
|
|
||||||
},
|
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
|
||||||
'label' => 'Creators',
|
'label' => 'Creators',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,3 @@ document.addEventListener('DOMContentLoaded', function(e) {
|
|||||||
loadDynamicPicker(document)
|
loadDynamicPicker(document)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,12 @@
|
|||||||
|
|
||||||
{% block title %}{{ export.title|trans }}{% endblock %}
|
{% block title %}{{ export.title|trans }}{% endblock %}
|
||||||
|
|
||||||
|
{% block css %}
|
||||||
|
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
|
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||||
{{ encore_entry_script_tags('page_export') }}
|
{{ encore_entry_script_tags('page_export') }}
|
||||||
{% if export_alias == 'count_social_work_actions' %}
|
{% if export_alias == 'count_social_work_actions' %}
|
||||||
{{ encore_entry_script_tags('vue_export_action_goal_result') }}
|
{{ encore_entry_script_tags('vue_export_action_goal_result') }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user