mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
only show active centers from the reachable centers for creation of person
This commit is contained in:
@@ -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,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user