mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
signature: fix cs + test PDFParser
This commit is contained in:
parent
421226c0dc
commit
67395f52b5
@ -221,10 +221,10 @@ class DocumentPersonController extends AbstractController
|
|||||||
|
|
||||||
$signature = [];
|
$signature = [];
|
||||||
$signature['id'] = 1;
|
$signature['id'] = 1;
|
||||||
$signature['storedObject'] = [ //TEMP
|
$signature['storedObject'] = [ // TEMP
|
||||||
'filename' => $storedObject->getFilename(),
|
'filename' => $storedObject->getFilename(),
|
||||||
'iv'=> $storedObject->getIv(),
|
'iv' => $storedObject->getIv(),
|
||||||
'keyInfos' => $storedObject->getKeyInfos()
|
'keyInfos' => $storedObject->getKeyInfos(),
|
||||||
];
|
];
|
||||||
$signature['zones'] = $zones;
|
$signature['zones'] = $zones;
|
||||||
|
|
||||||
|
@ -11,13 +11,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\DocStoreBundle\Controller;
|
namespace Chill\DocStoreBundle\Controller;
|
||||||
|
|
||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
|
||||||
use Chill\DocStoreBundle\Service\Signature\Driver\BaseSigner\RequestPdfSignMessage;
|
use Chill\DocStoreBundle\Service\Signature\Driver\BaseSigner\RequestPdfSignMessage;
|
||||||
use Chill\DocStoreBundle\Service\Signature\PDFPage;
|
use Chill\DocStoreBundle\Service\Signature\PDFPage;
|
||||||
use Chill\DocStoreBundle\Service\Signature\PDFSignatureZone;
|
use Chill\DocStoreBundle\Service\Signature\PDFSignatureZone;
|
||||||
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepSignature;
|
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStepSignature;
|
||||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSignatureStateEnum;
|
|
||||||
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -39,7 +37,7 @@ class SignatureRequestController
|
|||||||
// $signature = $this->signatureRepository($signature); //not useful?
|
// $signature = $this->signatureRepository($signature); //not useful?
|
||||||
// $entityWorkflow = $signature->getStep()->getEntityWorkflow();
|
// $entityWorkflow = $signature->getStep()->getEntityWorkflow();
|
||||||
// $storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow);
|
// $storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow);
|
||||||
$content = 'blop';// $this->storedObjectManager->read($storedObject);
|
$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);
|
dump($data);
|
||||||
@ -56,8 +54,8 @@ class SignatureRequestController
|
|||||||
$signature->getId(),
|
$signature->getId(),
|
||||||
$zone,
|
$zone,
|
||||||
$data['zone']['index'],
|
$data['zone']['index'],
|
||||||
'test signature', //reason (string)
|
'test signature', // reason (string)
|
||||||
'Mme Caroline Diallo', //signerText (string)
|
'Mme Caroline Diallo', // signerText (string)
|
||||||
$content
|
$content
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class PDFSignatureZoneParser
|
|||||||
foreach ($page->getDataTm() as $dataTm) {
|
foreach ($page->getDataTm() as $dataTm) {
|
||||||
if (str_starts_with($dataTm[1], self::ZONE_SIGNATURE_START)) {
|
if (str_starts_with($dataTm[1], self::ZONE_SIGNATURE_START)) {
|
||||||
$zones[] = new PDFSignatureZone((int) $zoneIndex, (float) $dataTm[0][4], (float) $dataTm[0][5], $this->defaultHeight, $this->defaultWidth, $pdfPage);
|
$zones[] = new PDFSignatureZone((int) $zoneIndex, (float) $dataTm[0][4], (float) $dataTm[0][5], $this->defaultHeight, $this->defaultWidth, $pdfPage);
|
||||||
$zoneIndex++;
|
++$zoneIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class PDFSignatureZoneParserTest extends TestCase
|
|||||||
0,
|
0,
|
||||||
127.7,
|
127.7,
|
||||||
95.289,
|
95.289,
|
||||||
180.0,
|
90.0,
|
||||||
180.0,
|
180.0,
|
||||||
$page = new PDFPage(0, 595.30393, 841.8897)
|
$page = new PDFPage(0, 595.30393, 841.8897)
|
||||||
),
|
),
|
||||||
@ -69,7 +69,7 @@ class PDFSignatureZoneParserTest extends TestCase
|
|||||||
1,
|
1,
|
||||||
269.5,
|
269.5,
|
||||||
95.289,
|
95.289,
|
||||||
180.0,
|
90.0,
|
||||||
180.0,
|
180.0,
|
||||||
$page,
|
$page,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user