mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Use SocialIssueRenderer->renderString for displaying socialIssues
This commit is contained in:
parent
39dca2a9ca
commit
e52c94aabd
@ -35,6 +35,7 @@ use Chill\MainBundle\Form\Type\ChillDateType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\CallbackTransformer;
|
use Symfony\Component\Form\CallbackTransformer;
|
||||||
use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer;
|
use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer;
|
||||||
|
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
||||||
|
|
||||||
class ActivityType extends AbstractType
|
class ActivityType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -53,7 +54,8 @@ class ActivityType extends AbstractType
|
|||||||
AuthorizationHelper $authorizationHelper,
|
AuthorizationHelper $authorizationHelper,
|
||||||
ObjectManager $om,
|
ObjectManager $om,
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
TranslatableStringHelper $translatableStringHelper,
|
||||||
array $timeChoices
|
array $timeChoices,
|
||||||
|
SocialIssueRender $socialIssueRender
|
||||||
) {
|
) {
|
||||||
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
||||||
throw new \RuntimeException("you should have a valid user");
|
throw new \RuntimeException("you should have a valid user");
|
||||||
@ -64,6 +66,7 @@ class ActivityType extends AbstractType
|
|||||||
$this->om = $om;
|
$this->om = $om;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
$this->timeChoices = $timeChoices;
|
$this->timeChoices = $timeChoices;
|
||||||
|
$this->socialIssueRender = $socialIssueRender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
@ -108,7 +111,7 @@ class ActivityType extends AbstractType
|
|||||||
'required' => $activityType->isRequired('socialIssues'),
|
'required' => $activityType->isRequired('socialIssues'),
|
||||||
'class' => SocialIssue::class,
|
'class' => SocialIssue::class,
|
||||||
'choice_label' => function (SocialIssue $socialIssue) {
|
'choice_label' => function (SocialIssue $socialIssue) {
|
||||||
return $this->translatableStringHelper->localize($socialIssue->getTitle());
|
return $this->socialIssueRender->renderString($socialIssue, []);
|
||||||
},
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'choices' => $accompanyingPeriod->getRecursiveSocialIssues(),
|
'choices' => $accompanyingPeriod->getRecursiveSocialIssues(),
|
||||||
|
@ -31,6 +31,7 @@ services:
|
|||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@chill.main.helper.translatable_string"
|
- "@chill.main.helper.translatable_string"
|
||||||
- "%chill_activity.form.time_duration%"
|
- "%chill_activity.form.time_duration%"
|
||||||
|
- '@Chill\PersonBundle\Templating\Entity\SocialIssueRender'
|
||||||
tags:
|
tags:
|
||||||
- { name: form.type, alias: chill_activitybundle_activity }
|
- { name: form.type, alias: chill_activitybundle_activity }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user