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 %} + {% 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
    {{ 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}) }}