diff --git a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php index 70d126f78..606bafb15 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php @@ -16,11 +16,13 @@ use Chill\DocStoreBundle\Service\Signature\PDFPage; use Chill\DocStoreBundle\Service\Signature\PDFSignatureZone; use Chill\DocStoreBundle\Service\StoredObjectManagerInterface; use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepSignature; +use Chill\MainBundle\Templating\Entity\ChillEntityRenderManagerInterface; use Chill\MainBundle\Workflow\EntityWorkflowManager; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Security\Core\Security; class SignatureRequestController { @@ -28,6 +30,8 @@ class SignatureRequestController private readonly MessageBusInterface $messageBus, private readonly StoredObjectManagerInterface $storedObjectManager, private readonly EntityWorkflowManager $entityWorkflowManager, + private readonly ChillEntityRenderManagerInterface $entityRender, + private readonly Security $security, ) {} #[Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')] @@ -51,8 +55,14 @@ class SignatureRequestController $signature->getId(), $zone, $data['zone']['index'], - 'test signature', // reason (string) - 'Mme Caroline Diallo', // signerText (string) + 'Signed by IP: '.(string) $request->getClientIp().', authenticated user: '.$this->entityRender->renderString($this->security->getUser(), []), + $this->entityRender->renderString($signature->getSigner(), [ + // options for user render + 'absence' => false, + 'main_scope' => false, + // options for person render + 'addAge' => false, + ]), $content ));