mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
[FEATURE] allow adding of user filters in filter order - template still to be done
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Form\Type\Listing;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
@@ -120,6 +121,35 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
|
||||
|
||||
$builder->add($singleCheckBoxBuilder);
|
||||
}
|
||||
|
||||
if ([] !== $helper->getUserPickers()) {
|
||||
$userPickersBuilder = $builder->create('userPicker', null, ['compound' => true]);
|
||||
|
||||
foreach ($helper->getUserPickers() as $name => [
|
||||
'label' => $label, 'options' => $options
|
||||
]) {
|
||||
$userPicker = $userPickersBuilder->create($name, null, [
|
||||
'compound' => true,
|
||||
'label' => $label,
|
||||
]);
|
||||
|
||||
$userPicker->add(
|
||||
$name,
|
||||
PickUserDynamicType::class,
|
||||
[
|
||||
'multiple' => true,
|
||||
'label' => $label,
|
||||
...$options,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$userPickersBuilder->add($userPicker);
|
||||
}
|
||||
|
||||
$builder->add($userPickersBuilder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
|
Reference in New Issue
Block a user