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

FIX #15776 TIME 2:45 Fix send to MP when mailing

parent 28f71805
No related branches found
No related tags found
No related merge requests found
......@@ -228,6 +228,15 @@ class MaarchParapheurController
'where' => ["res_id_master = ?", "attachment_type not in (?)", "status not in ('DEL', 'OBS', 'FRZ', 'TMP', 'SEND_MASS')", "in_signature_book = 'true'"],
'data' => [$aArgs['resIdMaster'], $excludeAttachmentTypes]
]);
foreach ($attachments as $keyAttachment => $attachment) {
if (strpos($attachment['identifier'], '-') != false) {
$mailingIdentifier = substr($attachment['identifier'], 0, strpos($attachment['identifier'], '-'));
$mailingAttachment = AttachmentModel::get(['select' => ['res_id'], 'where' => ['identifier = ?'], 'data' =>[$mailingIdentifier]]);
if (!empty($mailingAttachment[0])) {
$attachments[$keyAttachment]['mailingResId'] = $mailingAttachment[0]['res_id'];
}
}
}
$integratedResource = ResModel::get([
'select' => ['res_id', 'docserver_id', 'path', 'filename'],
......@@ -323,7 +332,7 @@ class MaarchParapheurController
$workflow = [];
foreach ($aArgs['steps'] as $step) {
if ($step['resId'] == $resId && !$step['mainDocument']) {
if (!$step['mainDocument'] && ($step['resId'] == $resId || (!empty($value['mailingResId']) && $step['resId'] == $value['mailingResId']))) {
$signaturePositions = null;
if (!empty($step['signaturePositions']) && is_array($step['signaturePositions'])) {
$valid = true;
......
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