mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
When a user applies a signature in a workflow, the signer is the futureDestUser of the next step
See: - Vendee/accent-suivi-developpement#1252 - https://champs-libres.openproject.com/wp/768 - OP#768
This commit is contained in:
@@ -97,16 +97,20 @@ class SignatureStepStateChanger
|
||||
return;
|
||||
}
|
||||
|
||||
$previousUser = $this->getPreviousSender($signature->getStep());
|
||||
if ('person' === $signature->getSignerKind()) {
|
||||
$futureUser = $this->getPreviousSender($signature->getStep());
|
||||
} else {
|
||||
$futureUser = $signature->getSigner();
|
||||
}
|
||||
|
||||
if (null === $previousUser) {
|
||||
if (null === $futureUser) {
|
||||
$this->logger->info(self::LOG_PREFIX.'No previous user, will not apply a transition', ['signatureId' => $signature->getId()]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$transitionDto = new WorkflowTransitionContextDTO($entityWorkflow);
|
||||
$transitionDto->futureDestUsers[] = $previousUser;
|
||||
$transitionDto->futureDestUsers[] = $futureUser;
|
||||
|
||||
$workflow->apply($entityWorkflow, $transition, [
|
||||
'context' => $transitionDto,
|
||||
|
Reference in New Issue
Block a user