mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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\CallbackTransformer;
|
||||
use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer;
|
||||
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
||||
|
||||
class ActivityType extends AbstractType
|
||||
{
|
||||
@ -53,7 +54,8 @@ class ActivityType extends AbstractType
|
||||
AuthorizationHelper $authorizationHelper,
|
||||
ObjectManager $om,
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
array $timeChoices
|
||||
array $timeChoices,
|
||||
SocialIssueRender $socialIssueRender
|
||||
) {
|
||||
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
||||
throw new \RuntimeException("you should have a valid user");
|
||||
@ -64,6 +66,7 @@ class ActivityType extends AbstractType
|
||||
$this->om = $om;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->timeChoices = $timeChoices;
|
||||
$this->socialIssueRender = $socialIssueRender;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
@ -108,7 +111,7 @@ class ActivityType extends AbstractType
|
||||
'required' => $activityType->isRequired('socialIssues'),
|
||||
'class' => SocialIssue::class,
|
||||
'choice_label' => function (SocialIssue $socialIssue) {
|
||||
return $this->translatableStringHelper->localize($socialIssue->getTitle());
|
||||
return $this->socialIssueRender->renderString($socialIssue, []);
|
||||
},
|
||||
'multiple' => true,
|
||||
'choices' => $accompanyingPeriod->getRecursiveSocialIssues(),
|
||||
|
@ -31,6 +31,7 @@ services:
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "%chill_activity.form.time_duration%"
|
||||
- '@Chill\PersonBundle\Templating\Entity\SocialIssueRender'
|
||||
tags:
|
||||
- { name: form.type, alias: chill_activitybundle_activity }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user