Commit 0bd8469a authored by ludovic's avatar ludovic
Browse files

Merge branch 'fix/17699/20.10_TMA3' into '20.10_TMA3'

FIX #17699 TIME 1:40 force status in send to signature book action

See merge request maarch/MaarchCourrier!344
parents c88a406e bdf0afed
......@@ -107,7 +107,7 @@ class ActionMethodController
$set = ['locker_user_id' => null, 'locker_time' => null, 'modification_date' => 'CURRENT_TIMESTAMP'];
$action = ActionModel::getById(['id' => $args['id'], 'select' => ['label_action', 'id_status', 'history', 'parameters']]);
$action = ActionModel::getById(['id' => $args['id'], 'select' => ['label_action', 'id_status', 'history', 'parameters', 'component']]);
$action['parameters'] = json_decode($action['parameters'], true);
if (empty($args['finishInScript'])) {
......@@ -121,6 +121,15 @@ class ActionMethodController
}
}
// Custom for TMA 3
if ($action['component'] == 'sendSignatureBookAction') {
// workflow is the same for all resources when in mass -> so the next in workflow will be the same for all resources
$nextInVisaWorkflow = ListInstanceModel::getCurrentStepByResId([
'resId' => $args['resources'][0],
'select' => ['requested_signature']
]);
$set['status'] = !empty($nextInVisaWorkflow['requested_signature']) ? 'ESIG' : 'EVIS';
}
ResModel::update([
'set' => $set,
'where' => ['res_id in (?)'],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment