mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
able to see the workflow if the evaluation document has been deleted
This commit is contained in:
parent
d9bb18e042
commit
a1baf99294
@ -59,7 +59,13 @@ class EntityWorkflowVoter extends Voter
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->security->isGranted($entityAttribute, $handler->getRelatedEntity($subject));
|
||||
$relatedEntity = $handler->getRelatedEntity($subject);
|
||||
|
||||
if (null === $relatedEntity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->security->isGranted($entityAttribute, $relatedEntity);
|
||||
|
||||
case self::DELETE:
|
||||
return $subject->getStep() === 'initial';
|
||||
|
@ -1,5 +1,10 @@
|
||||
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
|
||||
|
||||
{% if doc is null %}
|
||||
<div class="alert alert-warning">
|
||||
{{ 'workflow.doc for evaluation deleted'|trans }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex-table accompanying_course_work-list">
|
||||
<div class="item-bloc evaluation-item bg-chill-llight-gray">
|
||||
<div class="item-row mb-2">
|
||||
@ -131,3 +136,4 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user