mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 02:53:50 +00:00
Partage d'export enregistré et génération asynchrone des exports
This commit is contained in:
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Repository\SocialWork\SocialActionRepository;
|
||||
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\OptionsResolver\Options;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PickSocialActionType extends AbstractType
|
||||
@@ -28,14 +29,23 @@ class PickSocialActionType extends AbstractType
|
||||
->setDefaults([
|
||||
'class' => SocialAction::class,
|
||||
'choices' => $this->actionRepository->findAllActive(),
|
||||
'choice_label' => fn (SocialAction $sa) => $this->actionRender->renderString($sa, []),
|
||||
'placeholder' => 'Pick a social action',
|
||||
'required' => false,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'label' => 'Social actions',
|
||||
'multiple' => false,
|
||||
'show_social_issue_parenthesis' => false,
|
||||
'show_deactivated' => false,
|
||||
])
|
||||
->setAllowedTypes('multiple', ['bool']);
|
||||
->setNormalizer('choice_label', fn (Options $options, $value) => fn (SocialAction $sa) => $this->actionRender->renderString(
|
||||
$sa,
|
||||
[
|
||||
SocialActionRender::SHOW_SOCIAL_ISSUE => $options['show_social_issue_parenthesis'],
|
||||
SocialActionRender::SHOW_DEACTIVATED => $options['show_deactivated'],
|
||||
]
|
||||
))
|
||||
->setAllowedTypes('multiple', ['bool'])
|
||||
->setAllowedTypes('show_social_issue_parenthesis', ['bool']);
|
||||
}
|
||||
|
||||
public function getParent(): string
|
||||
|
Reference in New Issue
Block a user