Skip to content
Snippets Groups Projects
Verified Commit bcd909ab authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #14565 TIME 0:40 workflow with visa/stamp and certificate signature

parent e4bbfc4e
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,6 @@ use Document\models\DocumentModel;
use Slim\Http\Request;
use Slim\Http\Response;
use SrcCore\models\DatabaseModel;
use SrcCore\models\TextFormatModel;
use SrcCore\models\ValidatorModel;
use User\controllers\SignatureController;
use User\models\UserModel;
......@@ -673,6 +672,29 @@ class DocumentController
'fingerprint' => $storeInfos['fingerprint']
]);
if (DocumentController::ACTIONS[$args['actionId']] == 'VAL' && ($workflow['mode'] == 'visa' || $workflow['signature_mode'] == 'stamp')) {
$storeInfos = DocserverController::storeResourceOnDocServer([
'encodedFile' => base64_encode($fileContent),
'format' => 'pdf',
'docserverType' => 'ESIGN'
]);
if (!empty($storeInfos['errors'])) {
return $response->withStatus(500)->withJson(['errors' => $storeInfos['errors']]);
}
AdrModel::deleteDocumentAdr([
'where' => ['main_document_id = ?', 'type = ?'],
'data' => [$args['id'], 'ESIGN']
]);
AdrModel::createDocumentAdr([
'documentId' => $args['id'],
'type' => 'ESIGN',
'path' => $storeInfos['path'],
'filename' => $storeInfos['filename'],
'fingerprint' => $storeInfos['fingerprint']
]);
}
$tnlPages = [];
foreach ($affectedPages as $page) {
$tnlPages[] = "TNL{$page}";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment