Redirect to workflow show page if document already signed

Verify the state of the signature. If isSigned is true, redirection to
workflow show page.
This commit is contained in:
Julie Lenaerts 2024-08-07 14:18:34 +02:00 committed by Julien Fastré
parent ee6edba206
commit 0c797c2997
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -382,6 +382,10 @@ class WorkflowController extends AbstractController
throw new NotFoundHttpException('signature not found');
}
if ($signature->isSigned()) {
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $signature->getStep()->getEntityWorkflow()->getId()]);
}
if ($signature->getSigner() instanceof User) {
return $this->redirectToRoute('chill_main_workflow_signature_add', ['id' => $signature_id]);
}