mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[workflow] Feature: allow user to retrieve the access link for the
workflow + show dest email for a workflow
This commit is contained in:
parent
a91b35298a
commit
fd0e541e3f
@ -11,6 +11,8 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
|
* [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
|
## Test releases
|
||||||
|
|
||||||
|
@ -95,6 +95,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if entity_workflow.currentStep.destEmail|length > 0 %}
|
||||||
|
<p><b>{{ 'workflow.An access key was also sent to those addresses'|trans }} :</b></p>
|
||||||
|
<ul>
|
||||||
|
{% for e in entity_workflow.currentStep.destEmail -%}
|
||||||
|
<li><a href="mailto:{{ e|escape('html_attr') }}">{{ e }}</a></li>
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}
|
{% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}
|
||||||
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :</b></p>
|
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
@ -103,6 +112,21 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_MAIN_WORKFLOW_LINK_SHOW', entity_workflow) %}
|
||||||
|
<p><b>{{ 'workflow.This link grant any user to apply a transition'|trans }} :</b></p>
|
||||||
|
|
||||||
|
{% set link = absolute_url(path('chill_main_workflow_grant_access_by_key', {'id': entity_workflow.currentStep.id, 'accessKey': entity_workflow.currentStep.accessKey})) %}
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="text" readonly value="{{ link|e('html_attr') }}" class="form-control">
|
||||||
|
<button class="btn btn-secondary" type="button" id="button-copy" onclick="navigator.clipboard.writeText('{{ link|e('html_attr') }}').then(() => { window.alert({{ ('"' ~ 'workflow.Access link copied'|trans ~ ' !"') |e('html_attr') }})});"><i class="fa fa-files-o"></i></button>
|
||||||
|
<a class="btn btn-secondary" type="button" id="button-email"
|
||||||
|
href="mailto:?body={{ ((('workflow.The workflow may be accssed through this link'|trans)~':')|e('url')) ~ '%0D%0A%0D%0A' ~ link|e('url') }}"><i class="fa fa-envelope"></i></a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -81,6 +81,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if entity_workflow.currentStep.destEmail|length > 0 %}
|
||||||
|
<p><b>{{ 'workflow.An access key was also sent to those addresses'|trans }} :</b></p>
|
||||||
|
<ul>
|
||||||
|
{% for e in entity_workflow.currentStep.destEmail -%}
|
||||||
|
<li><a href="mailto:{{ e|escape('html_attr') }}">{{ e }}</a></li>
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if step.destUserByAccessKey|length > 0 %}
|
{% if step.destUserByAccessKey|length > 0 %}
|
||||||
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :</b></p>
|
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -27,6 +27,8 @@ class EntityWorkflowVoter extends Voter
|
|||||||
|
|
||||||
public const SEE = 'CHILL_MAIN_WORKFLOW_SEE';
|
public const SEE = 'CHILL_MAIN_WORKFLOW_SEE';
|
||||||
|
|
||||||
|
public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW';
|
||||||
|
|
||||||
private EntityWorkflowManager $manager;
|
private EntityWorkflowManager $manager;
|
||||||
|
|
||||||
private Security $security;
|
private Security $security;
|
||||||
@ -80,6 +82,19 @@ class EntityWorkflowVoter extends Voter
|
|||||||
case self::DELETE:
|
case self::DELETE:
|
||||||
return $subject->getStep() === 'initial';
|
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:
|
default:
|
||||||
throw new UnexpectedValueException("attribute {$attribute} not supported");
|
throw new UnexpectedValueException("attribute {$attribute} not supported");
|
||||||
}
|
}
|
||||||
@ -91,6 +106,7 @@ class EntityWorkflowVoter extends Voter
|
|||||||
self::SEE,
|
self::SEE,
|
||||||
self::CREATE,
|
self::CREATE,
|
||||||
self::DELETE,
|
self::DELETE,
|
||||||
|
self::SHOW_ENTITY_LINK,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,6 @@ workflow:
|
|||||||
Delete workflow: Supprimer le 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 ?
|
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.
|
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: 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.
|
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
|
Add an email: Ajouter une adresse email
|
||||||
@ -466,6 +465,11 @@ workflow:
|
|||||||
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
Previous workflow transitionned help: Workflows où vous avez exécuté une action.
|
||||||
For: Pour
|
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.
|
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
|
Subscribe final: Recevoir une notification à l'étape finale
|
||||||
|
Loading…
x
Reference in New Issue
Block a user