From 86315b15793328ec3766973ed959abb4d46679f5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 11 Sep 2023 14:43:52 +0200 Subject: [PATCH] only show active centers from the reachable centers for creation of person --- src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php | 4 +++- src/Bundle/ChillMainBundle/config/routes.yaml | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index 83e957623..6a82818f6 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -61,6 +61,8 @@ class PickCenterType extends AbstractType { $centers = $this->getReachableCenters($options['role'], $options['scopes']); + $centersActive = array_filter($centers, fn(Center $c) => $c->getIsActive()); + if (count($centers) <= 1) { $multiple = $options['choice_options']['multiple'] ?? false; $builder->add('center', HiddenType::class); @@ -75,7 +77,7 @@ class PickCenterType extends AbstractType $options['choice_options'], [ 'class' => Center::class, - 'choices' => $centers, + 'choices' => $centersActive, ] ) ); diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index 7e2af7a7f..5bbc381d1 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -10,10 +10,6 @@ chill_main_admin_scope: resource: "@ChillMainBundle/config/routes/scope.yaml" prefix: "{_locale}/admin/scope" -#chill_main_admin: -# resource: "@ChillMainBundle/config/routes/center.yaml" -# prefix: "{_locale}/admin/center" - chill_main_exports: resource: "@ChillMainBundle/config/routes/exports.yaml" prefix: "{_locale}/exports"