diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php index f5ce07c8e..4dcb03489 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php @@ -35,7 +35,8 @@ final class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler implemen { return [ 'notification' => $notification, - 'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($notification->getRelatedEntityId()), + 'document' => $doc = $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($notification->getRelatedEntityId()), + 'evaluation' => $doc?->getAccompanyingPeriodWorkEvaluation(), ]; } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index b4df52254..0341e42e5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -1,32 +1,123 @@ -{% macro recordAction(document) %} - {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} -
- - - - - - -
{{ document.title }}{{ mm.mimeIcon(document.storedObject.type) }} - -
-
-{% endmacro %} {% if document is not null %} - + {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
{% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW', document) %} -
- {% include '@ChillPerson/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig' with { - 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork, - 'd': document.storedObject, - 'displayContent': 'short', - 'recordAction': _self.recordAction(document), - 'onlyone' : true, - 'evalId': document.accompanyingPeriodWorkEvaluation.id - } %} + {% set doc = document %} +
+
+

{{ "Document"|trans }}: {{ doc.title }}

+
+
+

+ + + {{ evaluation.accompanyingPeriodWork.socialAction|chill_entity_render_string }} +
    +
  • + {{ 'accompanying_course_work.start_date'|trans ~ ' : ' }} + {{ evaluation.accompanyingPeriodWork.startDate|format_date('short') }} +
  • + {% if evaluation.accompanyingPeriodWork.endDate %} +
  • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ evaluation.accompanyingPeriodWork.endDate|format_date('short') }} +
  • + {% endif %} +
+
+

+
+
+
+

+ {{ 'Participants'|trans }} +

+
+
+ {% for p in evaluation.accompanyingPeriodWork.persons %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: p.id }, + action: 'show', + displayBadge: true, + buttonText: p|chill_entity_render_string, + isDead: p.deathdate is not null + } %} + {% endfor %} +
+
+
+ + + + + + + + + + + +
+

+ {{ 'Évaluation'|trans }} +

+
+
    +
  • + {{ evaluation.evaluation.title|localize_translatable_string }} +
      +
    • + {{ 'accompanying_course_work.start_date'|trans ~ ' : ' }} + {{ evaluation.startDate|format_date('short') }} +
    • + {% if evaluation.endDate %} +
    • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ evaluation.endDate|format_date('short') }} +
    • + {% endif %} + {% if evaluation.maxDate %} +
    • + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ evaluation.maxDate|format_date('short') }} +
    • + {% endif %} + {% if evaluation.warningInterval and evaluation.warningInterval.d > 0 %} +
    • + {% set days = (evaluation.warningInterval.d + evaluation.warningInterval.m * 30) %} + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }} +
    • + {% endif %} +
    • + {% if evaluation.createdBy is not null %} + créé par + {{ evaluation.createdBy.username }} + {% endif %} + {% if evaluation.createdAt is not null %} + {{ 'le'|trans }} + {{ evaluation.createdAt|format_date('short') }} + {% endif %} +
    • +
    + {% if evaluation.comment %} +
    + {{ evaluation.comment }} +
    + {% endif %} +
  • +
+
+
+
+
    +
  • + +
  • +
+
{% else %}