Skip to content
Snippets Groups Projects
Verified Commit 4fa34ce1 authored by Damien's avatar Damien
Browse files

FEAT #16982 TIME 2:30 Yousign fixes

parent ed58124c
No related branches found
No related tags found
No related merge requests found
......@@ -194,6 +194,7 @@ class DocumentController
if (!empty($workflowExternalInformations)) {
$userLabel = "{$workflowExternalInformations['firstname']} {$workflowExternalInformations['lastname']}";
$workflowExternalInformations['informations'] = json_decode($workflowExternalInformations['informations'], true);
unset($workflowExternalInformations['informations']['yousignFileId'], $workflowExternalInformations['informations']['yousignProcedureId']);
}
$formattedDocument['workflow'][] = [
......@@ -927,12 +928,16 @@ class DocumentController
}
}
DocumentController::endAction([
$end = DocumentController::endAction([
'id' => $args['id'],
'workflowId' => $workflow['id'],
'status' => DocumentController::ACTIONS[$args['actionId']],
'note' => $body['note'] ?? null
]);
if (!empty($end['errors'])) {
return $response->withStatus(400)->withJson(['errors' => $end['errors']]);
}
$historyMessagePart = "{actionDone} : ";
if ($workflow['user_id'] != $GLOBALS['id']) {
......@@ -1063,13 +1068,16 @@ class DocumentController
$content = file_get_contents($content['path']);
$document = DocumentModel::getById(['select' => ['title', 'description'], 'id' => $args['id']]);
YousignController::createProcedure([
$procedureCreated = YousignController::createProcedure([
'documentId' => $args['id'],
'encodedDocument' => base64_encode($content),
'name' => $document['title'],
'description' => $document['description'],
'workflowId' => $nextWorkflow['id']
]);
if (!empty($procedureCreated['errors'])) {
return ['errors' => $procedureCreated['errors']];
}
}
} else {
EmailController::sendNotification(['documentId' => $args['id'], 'status' => $args['status']]);
......
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