This commit is contained in:
Roly Rudy Gutierrez Pinto
2017-02-14 09:35:46 -04:00
parent 9d10a02fab
commit 99540c4de0
3 changed files with 20 additions and 5 deletions

View File

@@ -2201,7 +2201,7 @@ class Processes
foreach (array("PRO_TRI_DELETED", "PRO_TRI_CANCELED", "PRO_TRI_PAUSED", "PRO_TRI_REASSIGNED") as $value) { foreach (array("PRO_TRI_DELETED", "PRO_TRI_CANCELED", "PRO_TRI_PAUSED", "PRO_TRI_REASSIGNED") as $value) {
$key = $value; $key = $value;
if (isset($map[$oData->process[$key]])) { if (isset($oData->process[$key]) && isset($map[$oData->process[$key]])) {
$oData->process[$key] = $map[$oData->process[$key]]; $oData->process[$key] = $map[$oData->process[$key]];
} }
} }
@@ -5071,9 +5071,22 @@ class Processes
$fileContent = fread($fp, $fsContent); //reading string $XmlContent $fileContent = fread($fp, $fsContent); //reading string $XmlContent
$newFileName = $pathMailTem . $sFileName; $newFileName = $pathMailTem . $sFileName;
$bytesSaved = @file_put_contents($newFileName, $fileContent); $bytesSaved = @file_put_contents($newFileName, $fileContent);
if ($bytesSaved != $fsContent) { if($bytesSaved === false){
throw (new Exception('Error writing MailTemplate file in directory : ' . $pathMailTem)); throw (new Exception('Error writing MailTemplate file in directory : ' . $pathMailTem));
} }
if ($bytesSaved != $fsContent) {
$channel = "writingMailTemplate";
$context = \Bootstrap::getDefaultContextLog();
$context['action'] = $channel;
if (defined("SYS_CURRENT_URI") && defined("SYS_CURRENT_PARMS")) {
$context['url'] = SYS_CURRENT_URI . '?' . SYS_CURRENT_PARMS;
}
$context['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '';
$sysSys = defined("SYS_SYS") ? SYS_SYS : "Undefined";
$message = 'The imported template has a number of byes different than the original template, please verify if the file \'' . $newFileName . '\' is correct.';
$level = 400;
Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
}
} }
} }
} }

View File

@@ -498,7 +498,7 @@ if ($action == "uploadFileNewProcess") {
$affectedGroups = implode(', ', $affectedGroups); $affectedGroups = implode(', ', $affectedGroups);
} }
} }
$result->affectedGroups = $affectedGroups; $result->affectedGroups = empty($affectedGroups) ? "" : $affectedGroups;
//Add Audit Log //Add Audit Log
$process = new Process(); $process = new Process();
@@ -641,7 +641,7 @@ if ($action == "uploadFileNewProcessExist") {
$affectedGroups = implode(', ', $affectedGroups); $affectedGroups = implode(', ', $affectedGroups);
} }
} }
$result->affectedGroups = $affectedGroups; $result->affectedGroups = empty($affectedGroups) ? "" : $affectedGroups;
//!data ouput //!data ouput
} catch (Exception $e) { } catch (Exception $e) {

View File

@@ -1636,7 +1636,9 @@ importProcessExistGroup = function()
} else { } else {
Ext.getCmp('objectsToImport').setValue(""); Ext.getCmp('objectsToImport').setValue("");
Ext.getCmp('importProcessExistGroupWindow').close(); Ext.getCmp('importProcessExistGroupWindow').close();
Ext.getCmp('importProcessExistProcessWindow').close(); if (Ext.getCmp('importProcessExistProcessWindow')) {
Ext.getCmp('importProcessExistProcessWindow').close();
}
Ext.getCmp('importProcessWindow').close(); Ext.getCmp('importProcessWindow').close();
Ext.MessageBox.show({ Ext.MessageBox.show({
title: _('ID_ERROR'), title: _('ID_ERROR'),