mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Add support for user signatures in workflow transitions
This update introduces the ability to specify user signatures in workflow transitions. It allows a nullable user to be declared that may be requested to apply a signature. The code now handles the use-case of signing a transition by a user in addition to previous functionality of having it signed by a "Person" entity. Corresponding tests are also updated to validate this new feature.
This commit is contained in:
@@ -413,8 +413,13 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStep(string $step, WorkflowTransitionContextDTO $transitionContextDTO, string $transition, \DateTimeImmutable $transitionAt, ?User $byUser = null): self
|
||||
{
|
||||
public function setStep(
|
||||
string $step,
|
||||
WorkflowTransitionContextDTO $transitionContextDTO,
|
||||
string $transition,
|
||||
\DateTimeImmutable $transitionAt,
|
||||
?User $byUser = null
|
||||
): self {
|
||||
$previousStep = $this->getCurrentStep();
|
||||
|
||||
$previousStep
|
||||
@@ -437,8 +442,12 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
$newStep->addDestEmail($email);
|
||||
}
|
||||
|
||||
foreach ($transitionContextDTO->futurePersonSignatures as $personSignature) {
|
||||
new EntityWorkflowStepSignature($newStep, $personSignature);
|
||||
if (null !== $transitionContextDTO->futureUserSignature) {
|
||||
new EntityWorkflowStepSignature($newStep, $transitionContextDTO->futureUserSignature);
|
||||
} else {
|
||||
foreach ($transitionContextDTO->futurePersonSignatures as $personSignature) {
|
||||
new EntityWorkflowStepSignature($newStep, $personSignature);
|
||||
}
|
||||
}
|
||||
|
||||
// copy the freeze
|
||||
|
Reference in New Issue
Block a user