From 2b968b9a5bbfd240332995da267b9f639c261975 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 8 Feb 2024 11:20:21 +0100 Subject: [PATCH 1/2] order centers dropdown alphabetically --- .../Form/Type/ComposedGroupCenterType.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php index 1f6e08571..92a1e43e5 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php @@ -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; + }, ]); } From 458df45fa5e2b3ddc1350971fff45bd2a6e8ed4a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 8 Feb 2024 11:22:48 +0100 Subject: [PATCH 2/2] Add changie --- .changes/unreleased/UX-20240208-112235.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/unreleased/UX-20240208-112235.yaml diff --git a/.changes/unreleased/UX-20240208-112235.yaml b/.changes/unreleased/UX-20240208-112235.yaml new file mode 100644 index 000000000..429e71f3c --- /dev/null +++ b/.changes/unreleased/UX-20240208-112235.yaml @@ -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"