fix canonicalization and show only active children in form

This commit is contained in:
2021-10-08 11:30:35 +02:00
parent 58ddbfb67b
commit 9a708ca618
6 changed files with 113 additions and 32 deletions

View File

@@ -16,6 +16,7 @@ use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
@@ -138,6 +139,10 @@ class ThirdPartyType extends AbstractType
'placeholder' => 'thirdparty.choose profession',
'required' => false
])
->add('contactDataAnonymous', CheckboxType::class, [
'required' => false,
'label' => 'thirdparty.Contact data are confidential'
])
;
// Institutional ThirdParty (parent)
@@ -165,12 +170,13 @@ class ThirdPartyType extends AbstractType
'multiple' => true,
'attr' => ['class' => 'select2']
])
->add('children', ChillCollectionType::class, [
->add('activeChildren', ChillCollectionType::class, [
'entry_type' => ThirdPartyType::class,
'entry_options' => [
'is_child' => true,
'block_name' => 'children'
],
'block_name' => 'active_children',
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false,