From a387305ef88a096996fff7efd2b86d1f85cb65d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 10 Feb 2022 00:12:55 +0100 Subject: [PATCH] remove scope in PersonDocumentType when disabled --- .../Form/PersonDocumentType.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index 69934cc70..0efcbe86a 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -64,9 +64,9 @@ class PersonDocumentType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - // if (null !== $document = $options['data']) { - // $isScopeConcerned = $this->scopeResolverDispatcher->isConcerned($document); - // } + if (null !== $document = $options['data']) { + $isScopeConcerned = $this->scopeResolverDispatcher->isConcerned($document); + } $builder ->add('title', TextType::class) @@ -89,12 +89,13 @@ class PersonDocumentType extends AbstractType return $entity ? $this->translatableStringHelper->localize($entity->getName()) : ''; }, ]); - // if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) { - // $builder->add('scope', ScopePickerType::class, [ - // 'center' => $options['center'], - // 'role' => $options['role'], - // ]); - // } + + if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) { + $builder->add('scope', ScopePickerType::class, [ + 'center' => $options['center'], + 'role' => $options['role'], + ]); + } } public function configureOptions(OptionsResolver $resolver)