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

FEAT #7983 Fix del and obs attachment

parent 1a7c601f
No related branches found
No related tags found
No related merge requests found
......@@ -89,8 +89,8 @@ abstract class AttachmentModelAbstract
ValidatorModel::arrayType($aArgs, ['select']);
$originalAttachment = AttachmentModel::getById([
'select' => ['path', 'filename'],
'id' => $aArgs['id'],
'select' => ['path', 'filename'],
'id' => $aArgs['id'],
'isVersion' => (empty($aArgs['isVersion']) ? 'false' : 'true')
]);
......@@ -99,8 +99,8 @@ abstract class AttachmentModelAbstract
$attachment = DatabaseModel::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['res_attachments'],
'where' => ['path = ?', 'filename = ?', 'attachment_type = ?'],
'data' => [$originalAttachment['path'], $PdfFilename, 'converted_pdf'],
'where' => ['path = ?', 'filename = ?', 'attachment_type = ?', 'status != ?'],
'data' => [$originalAttachment['path'], $PdfFilename, 'converted_pdf', 'DEL'],
]);
if (empty($attachment[0])) {
......
......@@ -176,8 +176,8 @@ class ResController
if ($extDocument['category_id'] == 'outgoing') {
$attachment = AttachmentModel::getOnView([
'select' => ['res_id', 'res_id_version', 'docserver_id', 'path', 'filename'],
'where' => ['res_id_master = ?', 'attachment_type = ?'],
'data' => [$aArgs['resId'], 'outgoing_mail'],
'where' => ['res_id_master = ?', 'attachment_type = ?', 'status not in (?)'],
'data' => [$aArgs['resId'], 'outgoing_mail', ['DEL', 'OBS']],
'limit' => 1
]);
if (!empty($attachment[0])) {
......
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