master branch: File Preview not working in Comments
I built a clean vtiger system for testing from the master branch a day or two ago.
The FilePreview function works OK in the Documents module, but not in ModComments. My guess it is to do with changing the file's stored name...
Also, why have two duplicate sets of code between the two modules? In Actions DownloadFile and in views FilePreview... These are quite useful methods for developers of custom modules too - why not move them into the main Vtiger class so there is only one set to maintain?
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author Contributor
- Author Contributor
- Author Contributor
- Author Contributor
alanlord@dev:~/code.vtiger.com/vtigercrm$ grep -rn previewFile . ./modules/Documents/models/DetailView.php:35: 'linkurl' => 'Vtiger_Header_Js.previewFile(event,'.$recordModel->getId().')', ./layouts/v7/modules/Documents/ListViewRecordActions.tpl:43: <li><a data-id="{$LISTVIEW_ENTRY->getId()}" name="viewfile" href="javascript:void(0)" data-filelocationtype="{$DOCUMENT_RECORD_MODEL->get('filelocationtype')}" data-filename="{$DOCUMENT_RECORD_MODEL->get('filename')}" onclick="Vtiger_Header_Js.previewFile(event)">File Preview</a></li> ./layouts/v7/modules/Documents/DocumentsRelatedList.tpl:172: <a name="viewfile" href="javascript:void(0)" data-filelocationtype="{$DOCUMENT_RECORD_MODEL->get('filelocationtype')}" data-filename="{$DOCUMENT_RECORD_MODEL->get('filename')}" onclick="Vtiger_Header_Js.previewFile(event)"><i title="{vtranslate('LBL_VIEW_FILE', $RELATED_MODULE_NAME)}" class="fa fa-picture-o alignMiddle"></i></a> ./layouts/v7/modules/Vtiger/DocumentsSummaryWidgetContents.tpl:47: <a name="viewfile" href="javascript:void(0)" data-filelocationtype="{$DOCUMENT_RECORD_MODEL->get('filelocationtype')}" data-filename="{$DOCUMENT_RECORD_MODEL->get('filename')}" onclick="Vtiger_Header_Js.previewFile(event,{$RECORD_ID})"><i title="{vtranslate('LBL_VIEW_FILE', 'Documents')}" class="fa fa-picture-o alignMiddle"></i></a> ./layouts/v7/modules/Vtiger/RecentComments.tpl:134: <a class="previewfile" onclick="Vtiger_Detail_Js.previewFile(event,{$COMMENT->get('id')},{$FILE_DETAIL['attachmentId']});" data-filename="{$FILE_NAME}" href="javascript:void(0)" name="viewfile" style="color: blue;"> ./layouts/v7/modules/Vtiger/resources/Vtiger.js:23: previewFile: function (e, recordId, attachmentId) { ./layouts/v7/modules/Vtiger/resources/Header.js:12: previewFile : function(e,recordId) { ./layouts/v7/modules/Vtiger/resources/Detail.js:246: previewFile: function (e, recordId,attachmentId) { ./layouts/v7/modules/Vtiger/resources/Detail.js:247: Vtiger_Index_Js.previewFile(e, recordId,attachmentId); ./layouts/v7/modules/Vtiger/resources/List.js:242: previewFile: function (e, recordId, attachmentId) { ./layouts/v7/modules/Vtiger/QuickViewCommentsList.tpl:55: <a onclick="Vtiger_List_Js.previewFile(event,{$COMMENT->get('id')},{$FILE_DETAIL['attachmentId']});" data-filename="{$FILE_NAME}" href="javascript:void(0)" name="viewfile"> ./layouts/v7/modules/Vtiger/RelatedList.tpl:184: <a name="viewfile" href="javascript:void(0)" data-filelocationtype="{$DOCUMENT_RECORD_MODEL->get('filelocationtype')}" data-filename="{$DOCUMENT_RECORD_MODEL->get('filename')}" onclick="Vtiger_Header_Js.previewFile(event)"><i title="{vtranslate('LBL_VIEW_FILE', $RELATED_MODULE_NAME)}" class="icon-picture alignMiddle"></i></a> ./layouts/v7/modules/Vtiger/Comment.tpl:130: <a onclick="Vtiger_Detail_Js.previewFile(event,{$COMMENT->get('id')},{$FILE_DETAIL['attachmentId']});" data-filename="{$FILE_NAME}" href="javascript:void(0)" name="viewfile">
- Uma mentioned in merge request !664 (merged)
mentioned in merge request !664 (merged)
@lord_alan We have addressed the file preview issue with Comments, For api clean up please do create seperate issue which we will be addressing soon.
- Uma Milestone changed to 7.3
Milestone changed to 7.3
Please register or sign in to reply