Skip to content
Snippets Groups Projects
Commit b680697c authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #17642 TIME 0:35 set courrier user as signatory user when the account is linked

parent 28528c83
No related branches found
No related tags found
No related merge requests found
...@@ -483,6 +483,14 @@ class FastParapheurController ...@@ -483,6 +483,14 @@ class FastParapheurController
'config' => $args['config'], 'config' => $args['config'],
'resId' => $args['idsToRetrieve'][$version][$resId]['res_id_master'] ?? $args['idsToRetrieve'][$version][$resId]['res_id']]); 'resId' => $args['idsToRetrieve'][$version][$resId]['res_id_master'] ?? $args['idsToRetrieve'][$version][$resId]['res_id']]);
$args['idsToRetrieve'][$version][$resId]['signatory_user_serial_id'] = $signatoryInfo['id']; $args['idsToRetrieve'][$version][$resId]['signatory_user_serial_id'] = $signatoryInfo['id'];
} elseif (!empty($valueResponse['userFastId'])){
$maarchUser = UserModel::get([
'select' => ['id'],
'where' => ['external_id->>\'fastParapheur\' = ?'],
'data' => [$valueResponse['userFastId']]
]);
$args['idsToRetrieve'][$version][$resId]['signatory_user_serial_id'] = $maarchUser[0]['id'] ?? null;
$args['idsToRetrieve'][$version][$resId]['typist'] = ($maarchUser[0]['id'] ?? $args['idsToRetrieve'][$version][$resId]['typist']) ?? null;
} }
LogsController::add([ LogsController::add([
'isTech' => true, 'isTech' => true,
...@@ -1904,6 +1912,7 @@ class FastParapheurController ...@@ -1904,6 +1912,7 @@ class FastParapheurController
foreach ($documentHistory as $historyStep) { foreach ($documentHistory as $historyStep) {
if ($historyStep['userFullname'] == $knownWorkflow[$current]['name']) { if ($historyStep['userFullname'] == $knownWorkflow[$current]['name']) {
$historyStep['userFastId'] = $knownWorkflow[$current]['id'];
// If the document has been refused, then the workflow has ended and the last step is the refused step // If the document has been refused, then the workflow has ended and the last step is the refused step
if (in_array($historyStep['stateName'], [$config['refusedState'], $config['refusedVisaState']])) { if (in_array($historyStep['stateName'], [$config['refusedState'], $config['refusedVisaState']])) {
$lastStep = $historyStep; $lastStep = $historyStep;
......
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