diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 55157b1ab..8287a8814 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Chill\MainBundle\Form\Type\Export; -use Chill\MainBundle\Center\GroupingCenterInterface; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Regroupment; use Chill\MainBundle\Export\ExportManager; @@ -72,8 +71,10 @@ final class PickCenterType extends AbstractType return $c->getName(); }, 'data' => $centers, - ]) - ->add('regroupment', EntityType::class, [ + ]); + + if (count($this->regroupmentRepository->findAllActive()) > 0) { + $builder->add('regroupment', EntityType::class, [ 'class' => Regroupment::class, 'label' => 'regroupment', 'multiple' => true, @@ -83,6 +84,7 @@ final class PickCenterType extends AbstractType return $r->getName(); }, ]); + } $builder->setDataMapper(new ExportPickCenterDataMapper()); } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig index e08ec84d9..9e37dc2cd 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig @@ -41,9 +41,10 @@
{{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-action btn-create' }, 'label' : 'Go to export options' } ) }}