mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Effectively process signature request
The processSignature method in SignatureRequestController has been cleaned up and unneeded comments were removed. The process now involves retrieving the EntityWorkflow and StoredObject from the Signature, and reading the content from the StoredObjectManager. Debugging dump functions and commented code were also removed for a cleaner look.
This commit is contained in:
parent
3836d0dc9b
commit
123168a5ee
@ -33,21 +33,18 @@ class SignatureRequestController
|
|||||||
#[Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')]
|
#[Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')]
|
||||||
public function processSignature(EntityWorkflowStepSignature $signature, Request $request): JsonResponse
|
public function processSignature(EntityWorkflowStepSignature $signature, Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
dump($signature);
|
$entityWorkflow = $signature->getStep()->getEntityWorkflow();
|
||||||
// $signature = $this->signatureRepository($signature); //not useful?
|
$storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow);
|
||||||
// $entityWorkflow = $signature->getStep()->getEntityWorkflow();
|
$content = $this->storedObjectManager->read($storedObject);
|
||||||
// $storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow);
|
|
||||||
$content = 'blop'; // $this->storedObjectManager->read($storedObject);
|
|
||||||
|
|
||||||
$data = \json_decode((string) $request->getContent(), true, 512, JSON_THROW_ON_ERROR); // TODO parse payload: json_decode ou, mieux, dataTransfertObject
|
$data = \json_decode((string) $request->getContent(), true, 512, JSON_THROW_ON_ERROR); // TODO parse payload: json_decode ou, mieux, dataTransfertObject
|
||||||
dump($data);
|
|
||||||
$zone = new PDFSignatureZone(
|
$zone = new PDFSignatureZone(
|
||||||
$data['zone']['index'],
|
$data['zone']['index'],
|
||||||
$data['zone']['x'],
|
$data['zone']['x'],
|
||||||
$data['zone']['y'],
|
$data['zone']['y'],
|
||||||
$data['zone']['height'],
|
$data['zone']['height'],
|
||||||
$data['zone']['width'],
|
$data['zone']['width'],
|
||||||
$page = new PDFPage($data['zone']['PDFPage']['index'], $data['zone']['PDFPage']['width'], $data['zone']['PDFPage']['height'])
|
new PDFPage($data['zone']['PDFPage']['index'], $data['zone']['PDFPage']['width'], $data['zone']['PDFPage']['height'])
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->messageBus->dispatch(new RequestPdfSignMessage(
|
$this->messageBus->dispatch(new RequestPdfSignMessage(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user