From 0c797c29970d68dd0ea7b434e7eb4e98827e7696 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 7 Aug 2024 14:18:34 +0200 Subject: [PATCH] Redirect to workflow show page if document already signed Verify the state of the signature. If isSigned is true, redirection to workflow show page. --- src/Bundle/ChillMainBundle/Controller/WorkflowController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index 9f2196982..b9c728eeb 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -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]); }