From ecb8ef0146fb4ea0b32731f10a03453d9c1ae24c Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Tue, 21 Mar 2023 14:34:38 +0100 Subject: [PATCH 01/55] add notification service for AccompanyingPeriodWork in show --- ...ompanyingPeriodWorkNotificationHandler.php | 46 +++++++++++++++++++ .../AccompanyingCourseWork/_item.html.twig | 7 +++ .../AccompanyingCourseWork/show.html.twig | 27 +++++++++-- .../showInNotification.html.twig | 28 +++++++++++ .../showInNotification.html.twig | 1 + .../config/services/notification.yaml | 3 ++ 6 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php new file mode 100644 index 000000000..dbb30e983 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php @@ -0,0 +1,46 @@ +accompanyingPeriodWorkRepository = $accompanyingPeriodWorkRepository; + } + + public function getTemplate(Notification $notification, array $options = []): string + { + return 'ChillPersonBundle:AccompanyingCourseWork:showInNotification.html.twig'; + } + + public function getTemplateData(Notification $notification, array $options = []): array + { + return [ + 'notification' => $notification, + 'work' => $this->accompanyingPeriodWorkRepository->find($notification->getRelatedEntityId()), + ]; + } + + public function supports(Notification $notification, array $options = []): bool + { + return $notification->getRelatedEntityClass() === AccompanyingPeriodWork::class; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 001ac1661..728554aaf 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -129,6 +129,13 @@ {% if displayAction is defined and displayAction == true %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig new file mode 100644 index 000000000..70a1a0980 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig @@ -0,0 +1,28 @@ +{% macro recordAction(work) %} +
  • + +
  • +{% endmacro %} +{% if work is not null %} +
    + {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', work) %} + {% else %} + {% endif %} + {% include 'ChillPersonBundle:AccompanyingCourseWork:_item.html.twig' with { + 'itemBlocClass': 'bg-chill-llight-gray', + 'displayAction': true, + 'displayContent': 'short', + 'displayFontSmall': true, + 'w': work + } %} +
    + {{ 'This is the minimal period details'|trans ~ ': ' ~ work.id }}
    + {{ 'You are getting a notification for a period you are not allowed to see'|trans }} +
    +
    +{% else %} +
    + {{ 'You are getting a notification for a period which does not exists any more'|trans }} +
    +{% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig index 630dcf100..d6d13cd17 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig @@ -6,6 +6,7 @@ {% endmacro %} {% if period is not null %} + {{ dump(period) }}
    {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %} {% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with { diff --git a/src/Bundle/ChillPersonBundle/config/services/notification.yaml b/src/Bundle/ChillPersonBundle/config/services/notification.yaml index a7c9f4142..7fd64bfbf 100644 --- a/src/Bundle/ChillPersonBundle/config/services/notification.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/notification.yaml @@ -2,3 +2,6 @@ services: Chill\PersonBundle\Notification\AccompanyingPeriodNotificationHandler: autowire: true autoconfigure: true + Chill\PersonBundle\Notification\AccompanyingPeriodWorkNotificationHandler: + autowire: true + autoconfigure: true From 457d71b4f3e0870555bd3ebc12b840d09a633ee6 Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Tue, 21 Mar 2023 16:03:22 +0100 Subject: [PATCH 02/55] add service + template pour documents --- ...eriodWorkEvaluationNotificationHandler.php | 46 +++++++++++++++++++ .../_objectifs_results_evaluations.html.twig | 6 ++- .../showEvaluationInNotification.html.twig | 24 ++++++++++ .../config/services/notification.yaml | 3 ++ 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php new file mode 100644 index 000000000..63e395a98 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php @@ -0,0 +1,46 @@ +accompanyingPeriodWorkEvaluationRepository = $accompanyingPeriodWorkEvaluationRepository; + } + + public function getTemplate(Notification $notification, array $options = []): string + { + return 'ChillPersonBundle:AccompanyingCourseWork:showEvaluationInNotification.html.twig'; + } + + public function getTemplateData(Notification $notification, array $options = []): array + { + return [ + 'notification' => $notification, + 'evaluation' => $this->accompanyingPeriodWorkEvaluationRepository->find($notification->getRelatedEntityId()), + ]; + } + + public function supports(Notification $notification, array $options = []): bool + { + return $notification->getRelatedEntityClass() === AccompanyingPeriodWorkEvaluation::class; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 0dd0cc84a..3778f312b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -129,13 +129,15 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} - {% if e.documents|length > 0 %} {% for d in e.documents %} + {% endfor %} @@ -143,7 +145,7 @@ {% else %} {{ 'No document found'|trans }} {% endif %} - + {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig new file mode 100644 index 000000000..d35cf44c3 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig @@ -0,0 +1,24 @@ +{% macro recordAction(evaluation) %} +
  • + +
  • +{% endmacro %} +{% if evaluation is not null %} +
    + {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', evaluation) %} + {% else %} + {% endif %} + {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { + 'w': evaluation.accompanyingPeriodWork + } %} +
    + {{ 'This is the minimal period details'|trans ~ ': ' ~ evaluation.id }}
    + {{ 'You are getting a notification for a period you are not allowed to see'|trans }} +
    +
    +{% else %} +
    + {{ 'You are getting a notification for a period which does not exists any more'|trans }} +
    +{% endif %} diff --git a/src/Bundle/ChillPersonBundle/config/services/notification.yaml b/src/Bundle/ChillPersonBundle/config/services/notification.yaml index 7fd64bfbf..360873bee 100644 --- a/src/Bundle/ChillPersonBundle/config/services/notification.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/notification.yaml @@ -5,3 +5,6 @@ services: Chill\PersonBundle\Notification\AccompanyingPeriodWorkNotificationHandler: autowire: true autoconfigure: true + Chill\PersonBundle\Notification\AccompanyingPeriodWorkEvaluationNotificationHandler: + autowire: true + autoconfigure: true From 1a759cabe4fc369ba6bd6eac99303d774b6816ee Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Wed, 22 Mar 2023 18:11:41 +0100 Subject: [PATCH 03/55] changing evaluation for document -> no render for twig --- ...kEvaluationDocumentNotificationHandler.php} | 18 +++++++++--------- .../_objectifs_results_evaluations.html.twig | 4 +++- ...EvaluationDocumentInNotification.html.twig} | 12 +++++++----- .../config/services/notification.yaml | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) rename src/Bundle/ChillPersonBundle/Notification/{AccompanyingPeriodWorkEvaluationNotificationHandler.php => AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php} (60%) rename src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/{showEvaluationInNotification.html.twig => showEvaluationDocumentInNotification.html.twig} (81%) diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php similarity index 60% rename from src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php rename to src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php index 63e395a98..1f3ed0fb6 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php @@ -14,33 +14,33 @@ namespace Chill\PersonBundle\Notification; use Chill\MainBundle\Entity\Notification; use Chill\MainBundle\Notification\NotificationHandlerInterface; -use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; -use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationRepository; +use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument; +use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocumentRepository; -final class AccompanyingPeriodWorkEvaluationNotificationHandler implements NotificationHandlerInterface +final class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler implements NotificationHandlerInterface { - private AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository; + private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository; - public function __construct(AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository) + public function __construct(AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository) { - $this->accompanyingPeriodWorkEvaluationRepository = $accompanyingPeriodWorkEvaluationRepository; + $this->accompanyingPeriodWorkEvaluationDocumentRepository = $accompanyingPeriodWorkEvaluationDocumentRepository; } public function getTemplate(Notification $notification, array $options = []): string { - return 'ChillPersonBundle:AccompanyingCourseWork:showEvaluationInNotification.html.twig'; + return 'ChillPersonBundle:AccompanyingCourseWork:showEvaluationDocumentInNotification.html.twig'; } public function getTemplateData(Notification $notification, array $options = []): array { return [ 'notification' => $notification, - 'evaluation' => $this->accompanyingPeriodWorkEvaluationRepository->find($notification->getRelatedEntityId()), + 'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($notification->getRelatedEntityId()), ]; } public function supports(Notification $notification, array $options = []): bool { - return $notification->getRelatedEntityClass() === AccompanyingPeriodWorkEvaluation::class; + return $notification->getRelatedEntityClass() === AccompanyingPeriodWorkEvaluationDocument::class; } } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 3778f312b..029e347b1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -130,13 +130,15 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} {% if e.documents|length > 0 %} +
    {{ d.title }} {{ mm.mimeIcon(d.storedObject.type) }} + + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }}
    {% for d in e.documents %} + {{ dump(d) }} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig similarity index 81% rename from src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig rename to src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index d35cf44c3..b9fd07a11 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -1,19 +1,21 @@ -{% macro recordAction(evaluation) %} +{% macro recordAction(document) %}
  • {% endmacro %} -{% if evaluation is not null %} +{% if document is not null %}
    - {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', evaluation) %} + {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', document) %} {% else %} {% endif %} + {{ dump(document) }} {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { - 'w': evaluation.accompanyingPeriodWork + + 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork } %}
    - {{ 'This is the minimal period details'|trans ~ ': ' ~ evaluation.id }}
    + {{ 'This is the minimal period details'|trans ~ ': ' ~ document.id }}
    {{ 'You are getting a notification for a period you are not allowed to see'|trans }}
    diff --git a/src/Bundle/ChillPersonBundle/config/services/notification.yaml b/src/Bundle/ChillPersonBundle/config/services/notification.yaml index 360873bee..f5d227429 100644 --- a/src/Bundle/ChillPersonBundle/config/services/notification.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/notification.yaml @@ -5,6 +5,6 @@ services: Chill\PersonBundle\Notification\AccompanyingPeriodWorkNotificationHandler: autowire: true autoconfigure: true - Chill\PersonBundle\Notification\AccompanyingPeriodWorkEvaluationNotificationHandler: + Chill\PersonBundle\Notification\AccompanyingPeriodWorkEvaluationDocumentNotificationHandler: autowire: true autoconfigure: true From e850f67b0095aeac8601af69fe04074a1442134e Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 23 Mar 2023 14:59:32 +0100 Subject: [PATCH 04/55] rajout du voter, pour document et action dans la notif -> affiche les documents mais aussi le fais de partager dans notification create --- .../AccompanyingCourseWork/_item.html.twig | 2 +- .../_objectifs_results_evaluations.html.twig | 7 +++---- .../AccompanyingCourseWork/show.html.twig | 4 ++-- ...EvaluationDocumentInNotification.html.twig | 20 +++++++++---------- .../showInNotification.html.twig | 6 +++--- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 728554aaf..76c61407d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -131,7 +131,7 @@
    • - diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 029e347b1..4f5d36230 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -133,13 +133,12 @@
    {{ d.title }} {{ mm.mimeIcon(d.storedObject.type) }} - + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }}
    {% for d in e.documents %} - {{ dump(d) }} - + {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig index 016ac10bb..bd83310b7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig @@ -46,11 +46,11 @@
  • - +
  • {% else %} - + {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index b9fd07a11..83ba7bf91 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -6,18 +6,18 @@ {% endmacro %} {% if document is not null %}
    - {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', document) %} + {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW', document) %} + {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { + 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork, + 'd': document.storedObject, + 'displayContent': 'long', + } %} {% else %} +
    + {{ 'This is the minimal period details'|trans ~ ': ' ~ document.id }}
    + {{ 'You are getting a notification for a period you are not allowed to see'|trans }} +
    {% endif %} - {{ dump(document) }} - {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { - - 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork - } %} -
    - {{ 'This is the minimal period details'|trans ~ ': ' ~ document.id }}
    - {{ 'You are getting a notification for a period you are not allowed to see'|trans }} -
    {% else %}
    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig index 70a1a0980..311692030 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig @@ -6,9 +6,7 @@ {% endmacro %} {% if work is not null %}
    - {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', work) %} - {% else %} - {% endif %} + {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE', work) %} {% include 'ChillPersonBundle:AccompanyingCourseWork:_item.html.twig' with { 'itemBlocClass': 'bg-chill-llight-gray', 'displayAction': true, @@ -16,10 +14,12 @@ 'displayFontSmall': true, 'w': work } %} + {% else %}
    {{ 'This is the minimal period details'|trans ~ ': ' ~ work.id }}
    {{ 'You are getting a notification for a period you are not allowed to see'|trans }}
    + {% endif %}
    {% else %}
    From afb25276ee40e3f1adaa4871d5d19735853c2a18 Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 23 Mar 2023 15:32:30 +0100 Subject: [PATCH 05/55] enleve l'id en bas de page --- .../Resources/views/AccompanyingCourseWork/show.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig index bd83310b7..73b871260 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig @@ -55,7 +55,7 @@ {% endif %}
    - {{ work.id }} + {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', work) %}
  • Date: Thu, 30 Mar 2023 14:31:02 +0200 Subject: [PATCH 06/55] switching to new syntax --- .../AccompanyingPeriodNotificationHandler.php | 2 +- ...dWorkEvaluationDocumentNotificationHandler.php | 2 +- .../AccompanyingPeriodWorkNotificationHandler.php | 2 +- ...showEvaluationDocumentInNotification.html.twig | 15 ++++++++++----- .../showInNotification.html.twig | 2 +- .../showInNotification.html.twig | 3 +-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php index 486209453..2492e9a41 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php @@ -27,7 +27,7 @@ final class AccompanyingPeriodNotificationHandler implements NotificationHandler public function getTemplate(Notification $notification, array $options = []): string { - return 'ChillPersonBundle:AccompanyingPeriod:showInNotification.html.twig'; + return '@ChillPerson/AccompanyingPeriod/showInNotification.html.twig'; } public function getTemplateData(Notification $notification, array $options = []): array diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php index 1f3ed0fb6..f5ce07c8e 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php @@ -28,7 +28,7 @@ final class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler implemen public function getTemplate(Notification $notification, array $options = []): string { - return 'ChillPersonBundle:AccompanyingCourseWork:showEvaluationDocumentInNotification.html.twig'; + return '@ChillPerson/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig'; } public function getTemplateData(Notification $notification, array $options = []): array diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php index dbb30e983..b111c131f 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php @@ -28,7 +28,7 @@ final class AccompanyingPeriodWorkNotificationHandler implements NotificationHan public function getTemplate(Notification $notification, array $options = []): string { - return 'ChillPersonBundle:AccompanyingCourseWork:showInNotification.html.twig'; + return '@ChillPerson/AccompanyingCourseWork/showInNotification.html.twig'; } public function getTemplateData(Notification $notification, array $options = []): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index 83ba7bf91..f4c9c1bf7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -5,13 +5,18 @@
  • {% endmacro %} {% if document is not null %} +
    {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW', document) %} - {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { - 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork, - 'd': document.storedObject, - 'displayContent': 'long', - } %} +
    + {% include '@ChillPerson/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig' with { + 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork, + 'd': document.storedObject, + 'displayContent': 'short', + 'recordAction': _self.recordAction(document) + } %} +
    + {% else %}
    {{ 'This is the minimal period details'|trans ~ ': ' ~ document.id }}
    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig index 311692030..4ee561381 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig @@ -7,7 +7,7 @@ {% if work is not null %}
    {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE', work) %} - {% include 'ChillPersonBundle:AccompanyingCourseWork:_item.html.twig' with { + {% include "@ChillPerson/AccompanyingCourseWork/_item.html.twig" with { 'itemBlocClass': 'bg-chill-llight-gray', 'displayAction': true, 'displayContent': 'short', diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig index d6d13cd17..37563c947 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/showInNotification.html.twig @@ -6,10 +6,9 @@ {% endmacro %} {% if period is not null %} - {{ dump(period) }}
    {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %} - {% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with { + {% include "@ChillPerson/AccompanyingPeriod/_list_item.html.twig" with { 'recordAction': _self.recordAction(notification.relatedEntityId), 'itemBlocClass': 'bg-chill-llight-gray' } %} From 3576f7f14f415c7ce3d1706ac8940a2a9723134a Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 30 Mar 2023 14:32:00 +0200 Subject: [PATCH 07/55] Finishing evaluation document view and fixing dropdown in show --- .../AccompanyingCourseWork/_item.html.twig | 134 +++++++++--------- .../_objectifs_results_evaluations.html.twig | 12 +- .../AccompanyingCourseWork/index.html.twig | 3 +- .../AccompanyingCourseWork/show.html.twig | 4 +- ...EvaluationDocumentInNotification.html.twig | 17 ++- .../showInNotification.html.twig | 6 +- 6 files changed, 100 insertions(+), 76 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 76c61407d..2a6dea8a1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -5,7 +5,8 @@ # - displayAction: [true|false] default: false # - displayFontSmall: [true|false] default: false #} -
    +

    @@ -111,8 +112,9 @@

    {% if displayContent is not defined or displayContent == 'short' %} -
    {# - # This is for 'long' version of content - # Note: this include is wrapped in a flex-table container. - # We start by closing the flex-table so we can add more. - # At the end we leave the last flex-table open, as it will be closed in the container. +# This is for 'long' version of content +# Note: this include is wrapped in a flex-table container. +# We start by closing the flex-table so we can add more. +# At the end we leave the last flex-table open, as it will be closed in the container. #} {% if displayContent is defined and displayContent == 'long' %} +
    + +{% if w.results|length > 0 or w.goals|length > 0 or w.accompanyingPeriodWorkEvaluations|length > 0 %} +

    {{ 'Dispositifs' }}

    + +
    {# new flex-table wrapper #} +
    + {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { + 'displayContent': displayContent + } %} +
    +{% endif %} - {% if w.results|length > 0 or w.goals|length > 0 or w.accompanyingPeriodWorkEvaluations|length > 0 %} -

    {{ 'Dispositifs' }}

    +

    {{ 'Comments'|trans }}

    -
    {# new flex-table wrapper #} -
    - {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { - 'displayContent': displayContent - } %} -
    +
    +
    +

    Public

    + {% if w.note is not empty %} +
    + {{ w.note|chill_entity_render_box({'metadata': true }) }} +
    + {% else %} + {{ 'No comment associated'|trans }} + {% endif %} +
    + {% if w.privateComment.hasCommentForUser(app.user) %} +
    +

    Privé

    +
    + {{ w.privateComment.commentForUser(app.user)|chill_markdown_to_html }} +
    {% endif %} - -

    {{ 'Comments'|trans }}

    - -
    -
    -

    Public

    - {% if w.note is not empty %} -
    - {{ w.note|chill_entity_render_box({'metadata': true }) }} -
    - {% else %} - {{ 'No comment associated'|trans }} - {% endif %} -
    - {% if w.privateComment.hasCommentForUser(app.user) %} -
    -

    Privé

    -
    - {{ w.privateComment.commentForUser(app.user)|chill_markdown_to_html }} -
    -
    - {% endif %} {# Here flex-table stay open ! read above #} -{% endif %} + {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 4f5d36230..e66dde463 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -118,9 +118,15 @@ {% endif %} {% endif %} + + + {% if recordAction is defined %} + {{ recordAction }} + {% endif %} + {% if displayContent is defined and displayContent == 'long' %} {% if e.comment is not empty %} @@ -136,9 +142,9 @@
    - + {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig index 9214bd30d..ab1989f63 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig @@ -26,7 +26,8 @@ 'displayAction': true, 'displayContent': 'short', 'displayFontSmall': true, - 'itemBlocClass': '' + 'itemBlocClass': '', + 'displayNotification': true } %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig index 73b871260..96b47e6c9 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig @@ -43,10 +43,10 @@ {% else %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index f4c9c1bf7..6d5d22a7d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -1,8 +1,17 @@ {% macro recordAction(document) %} -
  • - -
  • + {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} +
    + +
    {{ d.title }} {{ mm.mimeIcon(d.storedObject.type) }} - - + + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }}
    {{ d.title }} {{ mm.mimeIcon(d.storedObject.type) }} - - + + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }}
    + + + + + +
    {{ document.title }}{{ mm.mimeIcon(document.storedObject.type) }}
    +
    {% endmacro %} {% if document is not null %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig index 4ee561381..9b06e306c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig @@ -1,7 +1,8 @@ {% macro recordAction(work) %}
  • - +
  • {% endmacro %} {% if work is not null %} @@ -12,6 +13,7 @@ 'displayAction': true, 'displayContent': 'short', 'displayFontSmall': true, + 'displayNotification:':true, 'w': work } %} {% else %} From ba43b6b02579406da96131827ccb749567f59016 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 25 Apr 2023 15:41:28 +0200 Subject: [PATCH 08/55] Fix: align ux design styles to chill theme --- .../views/Button/button_group.html.twig | 2 +- .../AccompanyingCourseWork/_item.html.twig | 2 +- .../_objectifs_results_evaluations.html.twig | 17 +++++++++-------- .../views/AccompanyingCourseWork/show.html.twig | 11 +++++------ ...owEvaluationDocumentInNotification.html.twig | 17 +++++++++-------- .../showInNotification.html.twig | 2 +- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Button/button_group.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Button/button_group.html.twig index f83cafd51..2babe1ad9 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Button/button_group.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Button/button_group.html.twig @@ -1,5 +1,5 @@ {%- import "@ChillDocStore/Macro/macro.html.twig" as m -%} -
    {% if displayNotification is defined and displayNotification == true %}
  • - diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index e66dde463..4ab0b6e08 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -118,9 +118,7 @@
  • {% endif %} {% endif %} - - {% if recordAction is defined %} @@ -136,16 +134,19 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} {% if e.documents|length > 0 %} - - +
    {% for d in e.documents %} - + - - {% endfor %}
    {{ d.title }} {{ mm.mimeIcon(d.storedObject.type) }} - + + + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }} {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }}
    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig index 96b47e6c9..8d508539d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig @@ -35,7 +35,6 @@ {{ 'Back to the list'|trans }} -
  • {{ macro.workflowButton(work) }}
  • {% if accompanyingCourse.hasUser and accompanyingCourse.user is not same as(app.user) %} @@ -46,21 +45,21 @@ {{ 'notification.Notify referrer'|trans }}
  • - "{{ 'notification.Notify any'|trans }}" + {{ 'notification.Notify any'|trans }}
  • {% else %} - + - {% endif %}
    +
  • {{ macro.workflowButton(work) }}
  • {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', work) %}
  • - + >{{ 'Edit'|trans }}
  • {% endif %} {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE', work) %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index 6d5d22a7d..4ea70d9f0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -1,23 +1,24 @@ {% macro recordAction(document) %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
    - - +
    - - - + + + title="{{ 'See the document'|trans }}"> +
    {{ document.title }}{{ mm.mimeIcon(document.storedObject.type) }}{{ document.title }}{{ mm.mimeIcon(document.storedObject.type) }} +
    {% endmacro %} {% if document is not null %} -
    +
    {% 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, diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig index 9b06e306c..fdafcc040 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showInNotification.html.twig @@ -6,7 +6,7 @@ {% endmacro %} {% if work is not null %} -
    +
    {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE', work) %} {% include "@ChillPerson/AccompanyingCourseWork/_item.html.twig" with { 'itemBlocClass': 'bg-chill-llight-gray', From 67b32341d17209061c2c00f3527338df71862027 Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 27 Apr 2023 10:58:31 +0200 Subject: [PATCH 09/55] adding referer in list action --- .../AccompanyingCourseWork/_item.html.twig | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 7891d8cd4..4c056eec5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -133,10 +133,23 @@
      {% if displayNotification is defined and displayNotification == true %}
    • - - - +
      + {% if accompanyingCourse.hasUser and accompanyingCourse.user is not same as(app.user) %} + + + {% else %} + + + {% endif %} +
    • {% endif %}
    • {{ macro.workflowButton(w) }}
    • From 0a2f41c8a0acd6587638a93b2a44f4859c28618b Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 27 Apr 2023 10:59:09 +0200 Subject: [PATCH 10/55] adding button notification in edit view of a work. --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 755e4455c..e6ee7de79 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -296,7 +296,13 @@ @go-to-generate-workflow="goToGenerateWorkflow" > - +
    • + +
    diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 57305095d..fc2891ca6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -3,6 +3,7 @@ # - displayContent: [short|long] default: short #} {% if w.results|length > 0 %} + @@ -64,9 +65,11 @@ - {% for e in w.accompanyingPeriodWorkEvaluations %} - - + + - - {% endfor %} + + + {% endfor %} + {% endif %}

    {{ 'accompanying_course_work.goal'|trans }}

    + {% if onlyone %} + {% for e in w.accompanyingPeriodWorkEvaluations %} + {% if evalId is defined and evalId == e.id %} +
    • {{ e.evaluation.title|localize_translatable_string }} @@ -78,13 +81,15 @@ {% if e.endDate %}
    • - {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} {{ e.endDate|format_date('short') }}
    • {% else %} {% if displayContent is defined and displayContent == 'long' %}
    • - {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} {{ 'Not given'|trans }}
    • {% endif %} @@ -92,13 +97,15 @@ {% if e.maxDate %}
    • - {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} {{ e.maxDate|format_date('short') }}
    • {% else %} {% if displayContent is defined and displayContent == 'long' %}
    • - {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} {{ 'Not given'|trans }}
    • {% endif %} @@ -107,13 +114,15 @@ {% if e.warningInterval and e.warningInterval.d > 0 %}
    • {% set days = (e.warningInterval.d + e.warningInterval.m * 30) %} - {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} {{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }}
    • {% else %} {% if displayContent is defined and displayContent == 'long' %}
    • - {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} {{ 'Not given'|trans }}
    • {% endif %} @@ -122,55 +131,145 @@ {% if e.timeSpent is not null and e.timeSpent > 0 %}
    • {% set minutes = (e.timeSpent / 60) %} - {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'duration.minute'|trans({ '{m}' : minutes }) }} + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'duration.minute'|trans({ '{m}' : minutes }) }}
    • {% elseif displayContent is defined and displayContent == 'long' %}
    • - {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'Not given'|trans }}
    • {% endif %}
    - {% if recordAction is defined %} - {{ recordAction }} - {% endif %} + {% endif %} - {% if displayContent is defined and displayContent == 'long' %} - {% if e.comment is not empty %} -
    {{ e.comment|chill_entity_render_box }}
    + {% endfor %} + {% if recordAction is defined %} + {{ recordAction }} + {% endif %} + {% else %} + {% for e in w.accompanyingPeriodWorkEvaluations %} +
    +
      +
    • + {{ e.evaluation.title|localize_translatable_string }} +
        +
      • + {{ 'accompanying_course_work.start_date'|trans ~ ' : ' }} + {{ e.startDate|format_date('short') }} +
      • + + {% if e.endDate %} +
      • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ e.endDate|format_date('short') }} +
      • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
      • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
      • + {% endif %} + {% endif %} + + {% if e.maxDate %} +
      • + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ e.maxDate|format_date('short') }} +
      • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
      • + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
      • + {% endif %} + {% endif %} + + {% if e.warningInterval and e.warningInterval.d > 0 %} +
      • + {% set days = (e.warningInterval.d + e.warningInterval.m * 30) %} + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }} +
      • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
      • + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
      • + {% endif %} + {% endif %} + + {% if e.timeSpent is not null and e.timeSpent > 0 %} +
      • + {% set minutes = (e.timeSpent / 60) %} + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'duration.minute'|trans({ '{m}' : minutes }) }} +
      • + {% elseif displayContent is defined and displayContent == 'long' %} +
      • + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
      • + {% endif %} +
      +
    • +
    + {% if recordAction is defined %} + {{ recordAction }} {% endif %} - {% import "@ChillDocStore/Macro/macro.html.twig" as m %} - {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} - {% if e.documents|length > 0 %} - - {% for d in e.documents %} - - - - - - {% endfor %} -
    {{ d.title }}{{ mm.mimeIcon(d.storedObject.type) }} - - {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }} -
    - {% else %} - {{ 'No document found'|trans }} + {% if displayContent is defined and displayContent == 'long' %} + + {% if e.comment is not empty %} +
    {{ e.comment|chill_entity_render_box }}
    + {% endif %} + + {% import "@ChillDocStore/Macro/macro.html.twig" as m %} + {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} + {% if e.documents|length > 0 %} + + {% for d in e.documents %} + + + + + + {% endfor %} +
    {{ d.title }}{{ mm.mimeIcon(d.storedObject.type) }} + + {{ d.storedObject|chill_document_button_group(d.title, is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w), {'small': true}) }} +
    + {% else %} + {{ 'No document found'|trans }} + {% endif %} + + {% endif %} - - - {% endif %} -
    {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig index 4ea70d9f0..b4df52254 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig @@ -23,7 +23,9 @@ 'w': document.accompanyingPeriodWorkEvaluation.accompanyingPeriodWork, 'd': document.storedObject, 'displayContent': 'short', - 'recordAction': _self.recordAction(document) + 'recordAction': _self.recordAction(document), + 'onlyone' : true, + 'evalId': document.accompanyingPeriodWorkEvaluation.id } %}
    From 1a66a081425475f5aa54559fbac2afa9db9632b7 Mon Sep 17 00:00:00 2001 From: Lucas Silva Date: Thu, 27 Apr 2023 16:01:35 +0200 Subject: [PATCH 12/55] Button in vue edit --- .../components/FormEvaluation.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 7dcb595a3..6d40acae5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -103,6 +103,11 @@
    -
      - -
    • - -
    • -
    • - -
    • +
        +
      • + +
      • - - + + +
      • +
      • + + +
      • @@ -219,7 +232,10 @@ const i18n = { template_title: "Nom du template", browse: "Ajouter un document", replace: "Remplacer", - download: "Télécharger le fichier existant" + download: "Télécharger le fichier existant", + notification_notify_referrer: "Notifier le référent", + notification_notify_any: "Notifier d'autres utilisateurs", + notification_send: "Envoyer une notification", } } }; @@ -265,7 +281,8 @@ export default { }, computed: { ...mapState([ - 'isPosting' + 'isPosting', + 'work' ]), getTemplatesAvailables() { return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); @@ -395,10 +412,14 @@ export default { return this.$store.dispatch('submit', callback) .catch(e => { console.log(e); throw e; }); }, - goToGenerateDocumentNotification(document){ + goToGenerateDocumentNotification(document, tos){ const callback = (data) => { - let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); - window.location.assign(`/fr/notification/create?entityClass=Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument&entityId=${document.id}&returnPath=/fr/person/accompanying-period/work/${evaluation.id}/edit`) + let evaluation = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key); + if (tos === true) { + window.location.assign(`/fr/notification/create?entityClass=Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument&entityId=${document.id}&tos[0]=${this.$store.state.work.accompanyingPeriod.user.id}&returnPath=/fr/person/accompanying-period/work/${evaluation.id}/edit`) + } else { + window.location.assign(`/fr/notification/create?entityClass=Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument&entityId=${document.id}&returnPath=/fr/person/accompanying-period/work/${evaluation.id}/edit`) + } }; return this.$store.dispatch('submit', callback) .catch(e => {console.log(e); throw e}); From 53aa887da5c4168c1abe2f0ada16ee8fe009dc82 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 23 May 2023 18:10:29 +0200 Subject: [PATCH 16/55] Fixed: [vue] add condition to use dropdown or single button --- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 12 ++++++------ .../components/FormEvaluation.vue | 13 +++++++------ .../vuejs/AccompanyingCourseWorkEdit/store.js | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 128148f8a..072944192 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -298,12 +298,7 @@
      • - - @@ -463,6 +458,7 @@ export default { 'isPosting', 'errors', 'templatesAvailablesForAction', + 'me', ]), ...mapGetters([ 'hasResultsForAction', @@ -520,6 +516,10 @@ export default { this.$store.commit('setPersonsPickedIds', v); } }, + AmIRefferer() { + return (!(this.work.accompanyingPeriod.user && this.me + && (this.work.accompanyingPeriod.user.id !== this.me.id))); + } }, methods: { toggleSelect() { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 1673c2f33..7d6678ec7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -116,12 +116,8 @@ >
      • - @@ -282,8 +278,13 @@ export default { computed: { ...mapState([ 'isPosting', - 'work' + 'work', + 'me', ]), + AmIRefferer() { + return (!(this.$store.state.work.accompanyingPeriod.user && this.$store.state.me + && (this.$store.state.work.accompanyingPeriod.user.id !== this.$store.state.me.id))); + }, getTemplatesAvailables() { return this.$store.getters.getTemplatesAvailablesForEvaluation(this.evaluation.evaluation); }, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 47e4b2d3f..9a46b741a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -35,6 +35,7 @@ const store = createStore({ referrers: window.accompanyingCourseWork.referrers, isPosting: false, errors: [], + me: null }, getters: { socialAction(state) { @@ -130,6 +131,9 @@ const store = createStore({ } }, mutations: { + setWhoAmiI(state, me) { + state.me = me; + }, setEvaluationsPicked(state, evaluations) { state.evaluationsPicked = evaluations.map((e, index) => { var k = Object.assign(e, { @@ -385,6 +389,19 @@ const store = createStore({ }, }, actions: { + getWhoAmI({ commit }) { + let url = `/api/1.0/main/whoami.json`; + window.fetch(url) + .then(response => { + if (response.ok) { + return response.json(); + } + throw { m: 'Error while retriving results for goal', s: response.status, b: response.body }; + }) + .then(data => { + commit('setWhoAmiI', data); + }); + }, updateThirdParty({ commit }, payload) { commit('updateThirdParty', payload); }, @@ -514,6 +531,7 @@ store.commit('setEvaluationsPicked', window.accompanyingCourseWork.accompanyingP store.dispatch('getReachablesResultsForAction'); store.dispatch('getReachablesGoalsForAction'); store.dispatch('getReachablesEvaluationsForAction'); +store.dispatch('getWhoAmI'); store.state.evaluationsPicked.forEach(evaluation => { store.dispatch('fetchTemplatesAvailablesForEvaluation', evaluation.evaluation) From fec2dd0f74e852f48fd2bb4102eafc2147468a11 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 24 May 2023 19:51:52 +0200 Subject: [PATCH 17/55] enable debug --- .../public/vuejs/_components/Entity/PersonRenderBox.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue index 740eb0039..1833222e8 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -207,7 +207,7 @@