Skip to content
Snippets Groups Projects
Commit e0e1c116 authored by Uma's avatar Uma
Browse files

Fixes #1321 File Preview is Comments is supported

parent 658349a6
No related branches found
No related tags found
1 merge request!664Fixes #1321 File Preview is Comments is supported
......@@ -742,10 +742,10 @@ class Vtiger_Record_Model extends Vtiger_Base_Model {
return array_merge($relatedModuleRecordIds, $directrelatedModuleRecordIds, $indirectrelatedModuleRecordIds);
}
function getDownloadFileURL() {
$fileDetails = $this->getFileDetails();
function getDownloadFileURL($attachmentId = false) {
$fileDetails = $this->getFileDetails($attachmentId);
if (!empty($fileDetails)) {
return 'index.php?module='. $this->getModuleName() .'&action=DownloadFile&record='. $this->getId() .'&fileid='. $fileDetails['attachmentsid'].'&name='. $fileDetails['name'];
return 'index.php?module='. $this->getModuleName() .'&action=DownloadFile&record='. $this->getId() .'&fileid='. $fileDetails[0]['attachmentsid'].'&name='. $fileDetails[0]['name'];
} else {
return $this->get('filename');
}
......
No preview for this file type
......@@ -57,7 +57,7 @@ class ModComments_FilePreview_View extends Vtiger_IndexAjax_View {
$fileDetails = $recordModel->getFileNameAndDownloadURL($recordId, $attachmentId);
}
if ($recordModel->get('filename')) {
$downloadUrl = $recordModel->getDownloadFileURL();
$downloadUrl = $recordModel->getDownloadFileURL($attachmentId);
$trimmedFileName = $fileDetails[0]['trimmedFileName'];
}
......
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