Skip to content
Snippets Groups Projects
Commit e48a9132 authored by yogeshwar's avatar yogeshwar
Browse files

Merge remote-tracking branch 'upstream/master'

parents 4fdb06ce 0d1a78ca
No related branches found
No related tags found
No related merge requests found
......@@ -320,6 +320,7 @@ Vtiger_List_Js("Reports_List_Js",{
scrollInertia: 70,
mouseWheel: {preventDefault: true}
};
jQuery('.quickPreviewSummary').trigger(Vtiger_Widget_Js.widgetPostLoadEvent);
app.helper.showVerticalScroll(jQuery('.quickPreview .modal-body'), params);
});
},
......
......@@ -304,8 +304,7 @@ Vtiger.Class('Vtiger_Widget_Js',{
},
openUrl : function(url) {
var win = window.open(url, '_blank');
win.focus();
window.open(url, '_blank');
}
});
......
......@@ -196,11 +196,8 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
* Ex: for PDF: if filename - abc_md5(abc).pdf then raw filename - abc.pdf
* For Normal documents: rawFileName is not exist in the attachments info. So it fallback to normal filename
*/
$rawFileName = $existingAttachInfo['storedname'];
if (!$rawFileName) {
$rawFileName = $existingAttachInfo['attachment'];
}
$file_name = $existingAttachInfo['attachment'];
$rawFileName = $existingAttachInfo['attachment'];
$file_name = $existingAttachInfo['storedname'];
$path = $existingAttachInfo['path'];
$fileId = $existingAttachInfo['fileid'];
......@@ -210,7 +207,6 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
$oldFileName = $existingAttachInfo['fileid'].'_'.$file_name;
}
$oldFilePath = $path.'/'.$oldFileName;
$binFile = sanitizeUploadFileName($rawFileName, $upload_badext);
$current_id = $adb->getUniqueID("vtiger_crmentity");
......@@ -221,7 +217,8 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
//get the file path inwhich folder we want to upload the file
$upload_file_path = decideFilePath();
$newFilePath = $upload_file_path . $current_id . "_" . $binFile;
$encryptFileName = Vtiger_Util_Helper::getEncryptedFileName($binFile);
$newFilePath = $upload_file_path . $current_id . "_" . $encryptFileName;
copy($oldFilePath, $newFilePath);
......@@ -229,9 +226,14 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
$params1 = array($current_id, $current_user->getId(), $ownerId, $moduleName . " Attachment", $recordModel->get('description'), $adb->formatDate($date_var, true), $adb->formatDate($date_var, true));
$adb->pquery($sql1, $params1);
$sql2 = "insert into vtiger_attachments(attachmentsid, name, description, type, path) values(?, ?, ?, ?, ?)";
$params2 = array($current_id, $filename, $recordModel->get('description'), $filetype, $upload_file_path);
$result = $adb->pquery($sql2, $params2);
// Inserting $encrypedFilename into the sql query
$sql2 = "INSERT INTO vtiger_attachments(attachmentsid, name, description, type, path, storedname) values(?, ?, ?, ?, ?, ?)";
$params2 = array($current_id, $filename, $this->column_fields['description'], $filetype, $upload_file_path, $encryptFileName);
$adb->pquery($sql2, $params2);
// NOTE: Missing storedname columns in below code
// $sql2 = "insert into vtiger_attachments(attachmentsid, name, description, type, path) values(?, ?, ?, ?, ?)";
// $params2 = array($current_id, $filename, $recordModel->get('description'), $filetype, $upload_file_path);
// $result = $adb->pquery($sql2, $params2);
$sql3 = 'insert into vtiger_seattachmentsrel values(?,?)';
$adb->pquery($sql3, array($recordModel->getId(), $current_id));
......
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