-
- {% for acp in acps %}
- {% set app = person.findParticipationForPeriod(acp) %}
-
+ {% for acp in acps %}
+ {% set app = person.findParticipationForPeriod(acp) %}
+
+
+
+
+
-
- {% if acp.emergency %}
- {{- 'Emergency'|trans|upper -}}
- {% endif %}
- {% if acp.confidential %}
- {{- 'Confidential'|trans|upper -}}
- {% endif %}
-
- {% if acp.step == 'DRAFT' %}
-
- {{ 'course.draft'|trans }}
-
- {% endif %}
- {% if acp.requestorPerson == person %}
-
-
- {{ 'Requestor'|trans({'gender': person.gender}) }}
-
-
- {% endif %}
-
-
+
+
{% if app != null %}
- {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
+
+ {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
+
+ {% endif %}
+
+ {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
+ {% if notif_counter.total > 0 %}
+ {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }}
{% endif %}
-
- {% if acp.user is not null %}
+
+ {% if acp.emergency %}
+ {{- 'Emergency'|trans|upper -}}
+ {% endif %}
+
+ {% if acp.confidential %}
+ {{- 'Confidential'|trans|upper -}}
+ {% endif %}
+
+ {% if acp.step == 'DRAFT' %}
+ {{ 'course.draft'|trans }}
+ {% endif %}
+
+
+
+
+ {% if acp.user is not null %}
+
+
+
{{ 'Referrer'|trans }}
+
+
-
ref:
{{ acp.user|chill_entity_render_box }}
- {% endif %}
-
-
- {{ 'File number'|trans }} {{ acp.id }}
-
- {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
- {% if notif_counter.total > 0 %}
-
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }}
- {% endif %}
-
-
-
- {% for issue in acp.socialIssues %}
- {{ issue|chill_entity_render_box }}
- {% endfor %}
-
-
-
-
-
- {% if acp.currentParticipations|length > 1 %}
-
-
-
- {{ 'Participants'|trans }}
-
-
-
- {% set participating = false %}
- {% for part in acp.currentParticipations %}
- {% if part.person.id != person.id %}
- {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
- targetEntity: { name: 'person', id: part.person.id },
- action: 'show',
- displayBadge: true,
- buttonText: part.person|chill_entity_render_string,
- isDead: part.person.deathdate is not null
- } %}
- {% else %}
- {% set participating = true %}
- {% endif %}
- {% endfor %}
- {% if participating %}
- {{ 'person.and_himself'|trans({'gender': person.gender}) }}
- {% endif %}
-
-
{% endif %}
- {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
-
-
-
- {% if acp.requestorPerson is not null %}
- {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
- {% else %}
- {{ 'Requestor'|trans({'gender': 'other'})}}
- {% endif %}
-
-
-
- {% if acp.requestorThirdParty is not null %}
+
+ {% if acp.socialIssues|length > 0 %}
+
+
+
{{ 'Social issues'|trans }}
+
+
+ {% for issue in acp.socialIssues %}
+ {{ issue|chill_entity_render_box }}
+ {% endfor %}
+
+
+ {% endif %}
+
+ {# ????
+ {% if acp.requestorPerson == person %}
+
+
+
+
+
+
+
+
+ {{ 'Requestor'|trans({'gender': person.gender}) }}
+
+
+
+ {% endif %}
+ #}
+
+ {% if acp.currentParticipations|length > 1 %}
+
+
+
+ {{ 'Participants'|trans }}
+
+
+
+ {% set participating = false %}
+ {% for part in acp.currentParticipations %}
+ {% if part.person.id != person.id %}
+ {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
+ targetEntity: { name: 'person', id: part.person.id },
+ action: 'show',
+ displayBadge: true,
+ buttonText: part.person|chill_entity_render_string,
+ isDead: part.person.deathdate is not null
+ } %}
+ {% else %}
+ {% set participating = true %}
+ {% endif %}
+ {% endfor %}
+ {% if participating %}
+ {{ 'person.and_himself'|trans({'gender': person.gender}) }}
+ {% endif %}
+
+
+ {% endif %}
+
+ {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
+
+
+
+ {% if acp.requestorPerson is not null %}
+ {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
+ {% else %}
+ {{ 'Requestor'|trans({'gender': 'other'})}}
+ {% endif %}
+
+
+
+ {% if acp.requestorThirdParty is not null %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id },
action: 'show',
displayBadge: true,
buttonText: acp.requestorThirdParty|chill_entity_render_string
} %}
- {% else %}
- {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
- targetEntity: { name: 'person', id: acp.requestorPerson.id },
- action: 'show',
- displayBadge: true,
- buttonText: acp.requestorPerson|chill_entity_render_string,
- isDead: acp.requestorPerson.deathdate is not null
- } %}
- {% endif %}
-
+ {% else %}
+ {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
+ targetEntity: { name: 'person', id: acp.requestorPerson.id },
+ action: 'show',
+ displayBadge: true,
+ buttonText: acp.requestorPerson|chill_entity_render_string,
+ isDead: acp.requestorPerson.deathdate is not null
+ } %}
+ {% endif %}
- {% endif %}
- {% endfor %}
+
+ {% endif %}
+
+
-
+ {% endfor %}
{% endif %}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig
index 3ff3fe47b..9bdc3a479 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig
@@ -301,10 +301,8 @@ This view should receive those arguments:
{% endif %}
{% if person.updatedBy %}
-
- {{ 'Last updated by'|trans}}: {{ person.updatedBy|chill_entity_render_box }},
- {{ 'on'|trans ~ person.updatedAt|format_datetime('long', 'short') }}
-
+ {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
+ {{ macro.updatedBy(person) }}
{% endif %}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig
new file mode 100644
index 000000000..57cf503b8
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig
@@ -0,0 +1,17 @@
+
+ {% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
+ 'w': work,
+ 'itemBlocClass': 'bg-chill-llight-gray'
+ } %}
+
+
+{% if display_action is defined and display_action == true %}
+
+{% endif %}
\ No newline at end of file
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.title.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.title.html.twig
new file mode 100644
index 000000000..2cc640c82
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.title.html.twig
@@ -0,0 +1,19 @@
+{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
+
+
+
+ {% if concerne is defined and concerne == true %}
+ {{ 'Concerne'|trans }}:
+ {% endif %}
+
+ {{ 'workflow.Work (n°%w%)'|trans({'%w%': work.id }) }}
+
+ {% if description is defined and description == true %}
+ {{ ' — ' ~ work.socialAction|chill_entity_render_string }}
+ {% endif %}
+
+
+ {% if breadcrumb is defined and breadcrumb == true %}
+ {{ m.breadcrumb(_context) }}
+ {% endif %}
+
\ No newline at end of file
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.html.twig
new file mode 100644
index 000000000..989052a0a
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.html.twig
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+ {{ 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 %}
+
+
+
+
+
+
+
+
+
+
+ {{ 'É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 %}
+ -
+ créé par
+ {{ evaluation.createdBy.username }}
+ {{ 'le'|trans }}
+ {{ evaluation.createdAt|format_date('short') }}
+
+
+ {% if evaluation.comment %}
+
+ {{ evaluation.comment }}
+
+ {% endif %}
+
+
+ |
+
+
+
+
+
+ {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
+ {{ macro.updatedBy(evaluation) }}
+
+
+
+
+{% if display_action is defined and display_action == true %}
+ {# TODO add acl #}
+
+{% endif %}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.title.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.title.html.twig
new file mode 100644
index 000000000..4b52acc24
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.title.html.twig
@@ -0,0 +1,19 @@
+{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
+
+
+
+ {% if concerne is defined and concerne == true %}
+ {{ 'Concerne'|trans }}:
+ {% endif %}
+
+ {{ 'workflow.Evaluation (n°%eval%)'|trans({'%eval%': evaluation.id}) }}
+
+ {% if description is defined and description == true %}
+ {{ ' — ' ~ evaluation.evaluation.title|localize_translatable_string }}
+ {% endif %}
+
+
+ {% if breadcrumb is defined and breadcrumb == true %}
+ {{ m.breadcrumb(_context) }}
+ {% endif %}
+
diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php
new file mode 100644
index 000000000..eb6af5caa
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php
@@ -0,0 +1,51 @@
+security = $security;
+ }
+
+ protected function supports($attribute, $subject)
+ {
+ return $subject instanceof AccompanyingPeriodWorkEvaluation
+ && self::SEE === $attribute;
+ }
+
+ /**
+ * @param string $attribute
+ * @param AccompanyingPeriodWorkEvaluation $subject
+ */
+ protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
+ {
+ switch ($attribute) {
+ case self::SEE:
+ return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $subject->getAccompanyingPeriodWork());
+
+ default:
+ throw new UnexpectedValueException("attribute {$attribute} is not supported");
+ }
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php
new file mode 100644
index 000000000..279873fe5
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php
@@ -0,0 +1,57 @@
+security = $security;
+ }
+
+ protected function supports($attribute, $subject): bool
+ {
+ return $subject instanceof AccompanyingPeriodWork
+ && in_array($attribute, $this->getRoles(), true);
+ }
+
+ /**
+ * @param string $attribute
+ * @param AccompanyingPeriodWork $subject
+ */
+ protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
+ {
+ switch ($attribute) {
+ case self::SEE:
+ return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod());
+
+ default:
+ throw new UnexpectedValueException("attribute {$attribute} is not supported");
+ }
+ }
+
+ private function getRoles(): array
+ {
+ return [self::SEE];
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php
new file mode 100644
index 000000000..1e4649dd7
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php
@@ -0,0 +1,74 @@
+registry = $registry;
+ $this->entityWorkflowRepository = $entityWorkflowRepository;
+ $this->metadataExtractor = $metadataExtractor;
+ }
+
+ /**
+ * @param AccompanyingPeriodWorkEvaluation $object
+ */
+ public function normalize($object, ?string $format = null, array $context = []): array
+ {
+ $initial = $this->normalizer->normalize($object, $format, array_merge(
+ $context,
+ [self::IGNORE_EVALUATION => spl_object_hash($object)]
+ ));
+
+ // then, we add normalization for things which are not into the entity
+
+ $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
+ AccompanyingPeriodWorkEvaluation::class,
+ $object->getId()
+ );
+
+ $workflows = $this->entityWorkflowRepository->findBy([
+ 'relatedEntityClass' => AccompanyingPeriodWorkEvaluation::class,
+ 'relatedEntityId' => $object->getId(),
+ ]);
+ $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context);
+
+ return $initial;
+ }
+
+ public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ {
+ return 'json' === $format
+ && $data instanceof AccompanyingPeriodWorkEvaluation
+ && !array_key_exists(self::IGNORE_EVALUATION, $context);
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php
new file mode 100644
index 000000000..25f45d9df
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php
@@ -0,0 +1,85 @@
+registry = $registry;
+ $this->entityWorkflowRepository = $entityWorkflowRepository;
+ $this->metadataExtractor = $metadataExtractor;
+ }
+
+ /**
+ * @param AccompanyingPeriodWork $object
+ *
+ * @throws ExceptionInterface
+ *
+ * @return array|ArrayObject|bool|float|int|string|null
+ */
+ public function normalize($object, ?string $format = null, array $context = [])
+ {
+ $initial = $this->normalizer->normalize($object, $format, array_merge(
+ $context,
+ [self::IGNORE_WORK => spl_object_hash($object)]
+ ));
+
+ // then, we add normalization for things which are not into the entity
+
+ $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
+ AccompanyingPeriodWork::class,
+ $object->getId()
+ );
+
+ $initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor(
+ AccompanyingPeriodWorkEvaluation::class
+ );
+
+ $workflows = $this->entityWorkflowRepository->findBy([
+ 'relatedEntityClass' => AccompanyingPeriodWork::class,
+ 'relatedEntityId' => $object->getId(),
+ ]);
+ $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context);
+
+ return $initial;
+ }
+
+ public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ {
+ return 'json' === $format
+ && $data instanceof AccompanyingPeriodWork
+ && !array_key_exists(self::IGNORE_WORK, $context);
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php
new file mode 100644
index 000000000..1b5ac32b7
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php
@@ -0,0 +1,70 @@
+registry = $registry;
+ $this->metadataExtractor = $metadataExtractor;
+ }
+
+ /**
+ * @param EntityWorkflow $object
+ *
+ * @throws ExceptionInterface
+ *
+ * @return array|ArrayObject|bool|float|int|string|void|null
+ */
+ public function normalize($object, ?string $format = null, array $context = []): array
+ {
+ $data = $this->normalizer->normalize($object, $format, array_merge(
+ $context,
+ [self::IGNORE_ENTITY_WORKFLOW => spl_object_hash($object)]
+ ));
+
+ $workflow = $this->registry->get($object, $object->getWorkflowName());
+
+ $data['workflow'] = $this->metadataExtractor->buildArrayPresentationForWorkflow($workflow);
+ $data['current_place'] = $this->metadataExtractor->buildArrayPresentationForPlace($object);
+ $data['current_place_at'] = $this->normalizer->normalize($object->getCurrentStepCreatedAt(), 'json', ['groups' => ['read']]);
+ $data['current_place_by'] = $this->normalizer->normalize($object->getCurrentStepCreatedBy(), 'json', ['groups' => ['read']]);
+
+ return $data;
+ }
+
+ public function supportsNormalization($data, ?string $format = null, array $context = []): bool
+ {
+ return 'json' === $format
+ && $data instanceof EntityWorkflow
+ && !array_key_exists(self::IGNORE_ENTITY_WORKFLOW, $context);
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php
new file mode 100644
index 000000000..46aed46b4
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php
@@ -0,0 +1,71 @@
+repository = $repository;
+ }
+
+ public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluation
+ {
+ return $this->repository->find($entityWorkflow->getRelatedEntityId());
+ }
+
+ public function getRoleShow(EntityWorkflow $entityWorkflow): ?string
+ {
+ return AccompanyingPeriodWorkEvaluationVoter::SEE;
+ }
+
+ public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string
+ {
+ return '@ChillPerson/Workflow/_evaluation.html.twig';
+ }
+
+ public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array
+ {
+ return [
+ 'entity_workflow' => $entityWorkflow,
+ 'evaluation' => $this->getRelatedEntity($entityWorkflow),
+ ];
+ }
+
+ public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
+ {
+ return '@ChillPerson/Workflow/_evaluation.title.html.twig';
+ }
+
+ public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
+ {
+ return $this->getTemplateData($entityWorkflow, $options);
+ }
+
+ public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool
+ {
+ return $entityWorkflow->getRelatedEntityClass() === AccompanyingPeriodWorkEvaluation::class;
+ }
+
+ public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool
+ {
+ return false;
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php
new file mode 100644
index 000000000..cdb70f49c
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php
@@ -0,0 +1,70 @@
+repository = $repository;
+ }
+
+ public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?object
+ {
+ return $this->repository->find($entityWorkflow->getRelatedEntityId());
+ }
+
+ public function getRoleShow(EntityWorkflow $entityWorkflow): ?string
+ {
+ return null;
+ }
+
+ public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string
+ {
+ return '@ChillPerson/Workflow/_accompanying_period_work.html.twig';
+ }
+
+ public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array
+ {
+ return [
+ 'entity_workflow' => $entityWorkflow,
+ 'work' => $this->getRelatedEntity($entityWorkflow),
+ ];
+ }
+
+ public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
+ {
+ return '@ChillPerson/Workflow/_accompanying_period_work.title.html.twig';
+ }
+
+ public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
+ {
+ return $this->getTemplateData($entityWorkflow, $options);
+ }
+
+ public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool
+ {
+ return $entityWorkflow->getRelatedEntityClass() === AccompanyingPeriodWork::class;
+ }
+
+ public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool
+ {
+ return false;
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/config/services.yaml b/src/Bundle/ChillPersonBundle/config/services.yaml
index 6133068a4..f989b5dda 100644
--- a/src/Bundle/ChillPersonBundle/config/services.yaml
+++ b/src/Bundle/ChillPersonBundle/config/services.yaml
@@ -93,3 +93,8 @@ services:
autowire: true
autoconfigure: true
resource: '../Validator/Constraints/AccompanyingPeriod'
+
+ Chill\PersonBundle\Workflow\:
+ autowire: true
+ autoconfigure: true
+ resource: '../Workflow/'
diff --git a/src/Bundle/ChillPersonBundle/config/services/security.yaml b/src/Bundle/ChillPersonBundle/config/services/security.yaml
index 0094e180b..ca719b0b6 100644
--- a/src/Bundle/ChillPersonBundle/config/services/security.yaml
+++ b/src/Bundle/ChillPersonBundle/config/services/security.yaml
@@ -26,6 +26,14 @@ services:
tags:
- { name: security.voter }
+ Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkVoter:
+ autowire: true
+ autoconfigure: true
+
+ Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkEvaluationVoter:
+ autowire: true
+ autoconfigure: true
+
Chill\PersonBundle\Security\Authorization\HouseholdVoter:
autowire: true
autoconfigure: true