Fixed: show list of workflow, event if some social action associated to a workflow are deleted

This commit is contained in:
Julien Fastré 2022-12-14 13:37:49 +01:00
parent 2dec6a017d
commit 58ede06dfe
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 27 additions and 16 deletions

View File

@ -1,3 +1,8 @@
{% if work is null %}
<div class="alert alert-warning">
{{ 'workflow.SocialAction deleted'|trans }}
</div>
{% else %}
<div class="flex-table accompanying_course_work-list">
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
'w': work,
@ -15,3 +20,4 @@
</li>
</ul>
{% endif %}
{% endif %}

View File

@ -56,6 +56,10 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte
{
$work = $this->getRelatedEntity($entityWorkflow);
if (null === $work) {
return $this->translator->trans('workflow.SocialAction deleted');
}
return
$this->translator->trans('workflow.Work (n°%w%)', ['%w%' => $entityWorkflow->getRelatedEntityId()])
. ' - ' . $this->translatableStringHelper->localize($work->getSocialAction()->getTitle());

View File

@ -967,6 +967,7 @@ Number of periods: Nombre de parcours
workflow:
Doc for evaluation (n°%eval%): Document de l'évaluation n°%eval%
doc for evaluation deleted: Document supprimé dans une évaluation
SocialAction deleted: Action sociale supprimée
period_by_user_list:
Period by user: Parcours d'accompagnement par utilisateur