-
-
{{ doc.title }}
-
-
-
-
-
- {{ evaluation.accompanyingPeriodWork.socialAction|chill_entity_render_string }}
-
-{% if display_action is defined and display_action == true %}
- {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', evaluation.accompanyingPeriodWork) %}
-
- - {{ m.download_button(doc.storedObject, doc.title) }}
- {% if chill_document_is_editable(doc.storedObject) %}
+ {% if display_action is defined and display_action == true %}
+ {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', evaluation.accompanyingPeriodWork) %}
+
+ - {{ m.download_button(doc.storedObject, doc.title) }}
+ {% if chill_document_is_editable(doc.storedObject) %}
+ -
+ {{ doc.storedObject|chill_document_edit_button }}
+
+ {% endif %}
-
- {{ doc.storedObject|chill_document_edit_button }}
+
+ {{ 'Show'|trans }}
+
+
{% endif %}
- -
-
- {{ 'Show'|trans }}
-
-
-
{% endif %}
{% endif %}
diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php
index d7ce1ed4b..578d8e195 100644
--- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php
+++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php
@@ -48,6 +48,12 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW
{
$doc = $this->getRelatedEntity($entityWorkflow);
+ if (null === $doc) {
+ return [
+ 'persons' => [],
+ ];
+ }
+
return [
'persons' => $doc->getAccompanyingPeriodWorkEvaluation()
->getAccompanyingPeriodWork()->getPersons(),
@@ -58,6 +64,10 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW
{
$doc = $this->getRelatedEntity($entityWorkflow);
+ if (null === $doc) {
+ return $this->translator->trans('workflow.doc for evaluation deleted');
+ }
+
return $this->translator->trans(
'workflow.Doc for evaluation (n°%eval%)',
['%eval%' => $entityWorkflow->getRelatedEntityId()]
@@ -98,7 +108,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW
return [
'entity_workflow' => $entityWorkflow,
- 'evaluation' => $doc->getAccompanyingPeriodWorkEvaluation(),
+ 'evaluation' => null !== $doc ? $doc->getAccompanyingPeriodWorkEvaluation() : $doc,
'doc' => $doc,
];
}
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
index ae7687324..ab8ab0c67 100644
--- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
@@ -581,6 +581,7 @@ My accompanying periods in draft: Mes parcours brouillons
workflow:
Doc for evaluation (n°%eval%): Document de l'évaluation n°%eval%
+ doc for evaluation deleted: Document supprimé dans une évaluation
period_by_user_list:
Period by user: Parcours d'accompagnement par utilisateur