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

Fixes file preview in ModComments - Review Addressed

parent bacf962c
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -48,15 +48,12 @@ class ModComments_FilePreview_View extends Vtiger_IndexAjax_View {
}
}
$path = $fileDetails['path'].$fileDetails['attachmentsid'].'_'.$storedFileName;
$type = $fileDetails['type'];
$contents = $fileContent;
$filename = $fileDetails['name'];
$parts = explode('.', $filename);
if ($recordModel->get('filename')) {
$fileDetails = $recordModel->getFileNameAndDownloadURL($recordId, $attachmentId);
}
if ($recordModel->get('filename')) {
$fileDetails = $recordModel->getFileNameAndDownloadURL($recordId, $attachmentId);
$downloadUrl = $recordModel->getDownloadFileURL($attachmentId);
$trimmedFileName = $fileDetails[0]['trimmedFileName'];
}
......@@ -85,7 +82,6 @@ class ModComments_FilePreview_View extends Vtiger_IndexAjax_View {
$viewer->assign('FILE_PREVIEW_NOT_SUPPORTED', 'yes');
$viewer->assign('DOWNLOAD_URL', $downloadUrl);
$viewer->assign('FILE_PATH', $path);
$viewer->assign('TRIMMED_FILE_NAME', $trimmedFileName);
$viewer->assign('FILE_NAME', $filename);
$viewer->assign('FILE_EXTN', $extn);
......
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