Merge remote-tracking branch 'origin/features/edit-accompanying-period-social-work' into _vue_echanges

This commit is contained in:
2021-06-26 12:14:32 +02:00
99 changed files with 4656 additions and 375 deletions

View File

@@ -35,6 +35,7 @@ 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;
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
class ActivityType extends AbstractType
{
@@ -46,6 +47,10 @@ class ActivityType extends AbstractType
protected TranslatableStringHelper $translatableStringHelper;
protected SocialIssueRender $socialIssueRender;
protected SocialActionRender $socialActionRender;
protected array $timeChoices;
public function __construct (
@@ -54,7 +59,8 @@ class ActivityType extends AbstractType
ObjectManager $om,
TranslatableStringHelper $translatableStringHelper,
array $timeChoices,
SocialIssueRender $socialIssueRender
SocialIssueRender $socialIssueRender,
SocialActionRender $socialActionRender
) {
if (!$tokenStorage->getToken()->getUser() instanceof User) {
throw new \RuntimeException("you should have a valid user");
@@ -66,6 +72,7 @@ class ActivityType extends AbstractType
$this->translatableStringHelper = $translatableStringHelper;
$this->timeChoices = $timeChoices;
$this->socialIssueRender = $socialIssueRender;
$this->socialActionRender = $socialActionRender;
}
public function buildForm(FormBuilderInterface $builder, array $options): void
@@ -133,7 +140,7 @@ class ActivityType extends AbstractType
'required' => $activityType->isRequired('socialActions'),
'class' => SocialAction::class,
'choice_label' => function (SocialAction $socialAction) {
return $this->translatableStringHelper->localize($socialAction->getTitle());
return $this->socialActionRender->renderString($socialAction, []);
},
'multiple' => true,
'choices' => $accompanyingPeriod->getRecursiveSocialActions(),

View File

@@ -32,6 +32,7 @@ services:
- "@chill.main.helper.translatable_string"
- "%chill_activity.form.time_duration%"
- '@Chill\PersonBundle\Templating\Entity\SocialIssueRender'
- '@Chill\PersonBundle\Templating\Entity\SocialActionRender'
tags:
- { name: form.type, alias: chill_activitybundle_activity }

View File

@@ -38,7 +38,7 @@ Required: Obligatoire
Persons: Personnes
Users: Utilisateurs
Emergency: Urgent
Sent received: Envoyer / Recevoir
Sent received: Entrant / Sortant
Sent: Envoyer
Received: Recevoir
by: 'Par '