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

[FIX] [PARA V2] Display tmp attachments

parent e1212cc3
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,28 @@ class ResModelAbstract extends Apps_Table_Service
return $aReturn;
}
public static function getAvailableAndTemporaryLinkedAttachmentsNotIn(array $aArgs = [])
{
static::checkRequired($aArgs, ['resIdMaster', 'notIn']);
static::checkNumeric($aArgs, ['resIdMaster']);
static::checkArray($aArgs, ['notIn']);
$select = [
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['res_view_attachments'],
'where' => ['res_id_master = ?', 'attachment_type not in (?)', "status not in ('DEL', 'OBS')"],
'data' => [$aArgs['resIdMaster'], $aArgs['notIn']],
];
if (!empty($aArgs['orderBy'])) {
$select['order_by'] = $aArgs['orderBy'];
}
$aReturn = static::select($select);
return $aReturn;
}
public static function getObsLinkedAttachmentsNotIn(array $aArgs = [])
{
static::checkRequired($aArgs, ['resIdMaster', 'notIn']);
......
......@@ -270,7 +270,7 @@ class VisaController
}
$orderBy .= " ELSE {$c} END, doc_date DESC NULLS LAST, creation_date DESC";
$attachments = \ResModel::getAvailableLinkedAttachmentsNotIn(
$attachments = \ResModel::getAvailableAndTemporaryLinkedAttachmentsNotIn(
[
'resIdMaster' => $aArgs['resId'],
'notIn' => ['incoming_mail_attachment', 'print_folder'],
......
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