mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch '260-order-centers-dropdown' into 'master'
Resolve "Mettre en ordre alphabétique la liste des centres dans le dropdown du section 'utilisateurs' dans l'admin" Closes #260 See merge request Chill-Projet/chill-bundles!657
This commit is contained in:
commit
8ef001e67e
5
.changes/unreleased/UX-20240208-112235.yaml
Normal file
5
.changes/unreleased/UX-20240208-112235.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
kind: UX
|
||||
body: Order list of centers alphabetically in dropdown 'user' section admin.
|
||||
time: 2024-02-08T11:22:35.5079313+01:00
|
||||
custom:
|
||||
Issue: "260"
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Form\Type;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\PermissionsGroup;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -27,7 +28,13 @@ class ComposedGroupCenterType extends AbstractType
|
||||
'choice_label' => static fn (PermissionsGroup $group) => $group->getName(),
|
||||
])->add('center', EntityType::class, [
|
||||
'class' => Center::class,
|
||||
'choice_label' => static fn (Center $center) => $center->getName(),
|
||||
'query_builder' => static function (EntityRepository $er) {
|
||||
$qb = $er->createQueryBuilder('c');
|
||||
$qb->where($qb->expr()->eq('c.isActive', 'TRUE'))
|
||||
->orderBy('c.name', 'ASC');
|
||||
|
||||
return $qb;
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user