diff --git a/CHANGELOG.md b/CHANGELOG.md
index df4dab422..a438e9f09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@ and this project adheres to
* [activity][export] DX/Feature: use of an `ActivityTypeRepositoryInterface` instead of the old-style EntityRepository
* [person][export] Fixed: some inconsistency with date filter on accompanying courses
* [person][export] Fixed: use left join for related entities in accompanying course aggregators
+* [workflow] Feature: allow user to copy and send manually the access link for the workflow
+* [workflow] Feature: show the email addresses that received an access link for the workflow
## Test releases
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig
index bb0411371..bd9274739 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig
@@ -95,6 +95,15 @@
{% endif %}
+ {% if entity_workflow.currentStep.destEmail|length > 0 %}
+
{{ 'workflow.An access key was also sent to those addresses'|trans }} :
+
+ {% for e in entity_workflow.currentStep.destEmail -%}
+ - {{ e }}
+ {%- endfor %}
+
+ {% endif %}
+
{% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}
{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :
@@ -103,6 +112,21 @@
{% endfor %}
{% endif %}
+
+ {% if is_granted('CHILL_MAIN_WORKFLOW_LINK_SHOW', entity_workflow) %}
+ {{ 'workflow.This link grant any user to apply a transition'|trans }} :
+
+ {% set link = absolute_url(path('chill_main_workflow_grant_access_by_key', {'id': entity_workflow.currentStep.id, 'accessKey': entity_workflow.currentStep.accessKey})) %}
+
+ {% endif %}
+
+
{% endif %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig
index dda309da0..72aab397c 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig
@@ -81,6 +81,15 @@
{% endif %}
+ {% if entity_workflow.currentStep.destEmail|length > 0 %}
+ {{ 'workflow.An access key was also sent to those addresses'|trans }} :
+
+ {% for e in entity_workflow.currentStep.destEmail -%}
+ - {{ e }}
+ {%- endfor %}
+
+ {% endif %}
+
{% if step.destUserByAccessKey|length > 0 %}
{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :
diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php
index 40dc1b13c..ffcc1bb95 100644
--- a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php
+++ b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php
@@ -27,6 +27,8 @@ class EntityWorkflowVoter extends Voter
public const SEE = 'CHILL_MAIN_WORKFLOW_SEE';
+ public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW';
+
private EntityWorkflowManager $manager;
private Security $security;
@@ -80,6 +82,19 @@ class EntityWorkflowVoter extends Voter
case self::DELETE:
return $subject->getStep() === 'initial';
+ case self::SHOW_ENTITY_LINK:
+ if ($subject->getStep() === 'initial') {
+ return false;
+ }
+
+ $currentStep = $subject->getCurrentStepChained();
+
+ if ($currentStep->isFinal()) {
+ return false;
+ }
+
+ return $currentStep->getPrevious()->getTransitionBy() === $this->security->getUser();
+
default:
throw new UnexpectedValueException("attribute {$attribute} not supported");
}
@@ -91,6 +106,7 @@ class EntityWorkflowVoter extends Voter
self::SEE,
self::CREATE,
self::DELETE,
+ self::SHOW_ENTITY_LINK,
];
}
}
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
index 76dc27b39..d14b4a7c1 100644
--- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
@@ -455,7 +455,6 @@ workflow:
Delete workflow: Supprimer le workflow
Steps is not waiting for transition. Maybe someone apply the transition before you ?: L'étape que vous cherchez a déjà été modifiée par un autre utilisateur. Peut-être quelqu'un a-t-il modifié cette étape avant vous ?
You get access to this step: Vous avez acquis les droits pour appliquer une transition sur ce workflow.
- Those users are also granted to apply a transition by using an access key: Ces utilisateurs peuvent également valider cette étape, grâce à un lien d'accès
dest by email: Liens d'autorisation par email
dest by email help: Les adresses email mentionnées ici recevront un lien d'accès. Ce lien d'accès permettra à l'utilisateur de valider cette étape.
Add an email: Ajouter une adresse email
@@ -467,6 +466,11 @@ workflow:
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
For: Pour
You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire.
+ An access key was also sent to those addresses: Un lien d'accès a été envoyé à ces addresses
+ Those users are also granted to apply a transition by using an access key: Ces utilisateurs ont obtennu l'accès grâce au lien reçu par email
+ Access link copied: Lien d'accès copié
+ This link grant any user to apply a transition: Le lien d'accès suivant permet d'appliquer une transition
+ The workflow may be accssed through this link: Une transition peut être appliquée sur ce workflow grâce au lien d'accès suivant
Subscribe final: Recevoir une notification à l'étape finale