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