mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
only show active centers from the reachable centers for creation of person
This commit is contained in:
parent
f30b4ff452
commit
86315b1579
@ -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,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user