diff --git a/gulliver/js/ext/min/ext-all.js b/gulliver/js/ext/min/ext-all.js index 201d51449..5ef5532a2 100644 --- a/gulliver/js/ext/min/ext-all.js +++ b/gulliver/js/ext/min/ext-all.js @@ -17,7 +17,8 @@ this.escapeHtml=function(v){var pre=document.createElement('pre');var text=docum this.getBrowser=function(){var browsersList=["opera","msie","firefox","chrome","safari","trident"],browserMeta=navigator.userAgent.toLowerCase(),name='Unknown',version='',screen={width:Ext.getBody().getViewSize().width,height:Ext.getBody().getViewSize().height};for(var i=0;i"+v+"";},align:"right"},{width:valueColumnWidth,dataIndex:"value",renderer:function(v){return""+v+"";}},{hidden:true,dataIndex:"section"}],autoHeight:true,columnLines:true,trackMouseOver:false,disableSelection:true,view:new Ext.grid.GroupingView({forceFit:true,headersDisabled:true,groupTextTpl:'{group}'}),loadMask:true});};this.cookie={create:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";},read:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i','
','

',t,'

',s,'
','
',''].join('');} return{msg:function(title,format,type,time){if(!msgCt){msgCt=Ext.DomHelper.insertFirst(document.body,{id:'msg-div',style:'position:absolute'},true);} var s=String.format.apply(String,Array.prototype.slice.call(arguments,1));var m=Ext.DomHelper.append(msgCt,{html:createBox(title,s)},true);m.setWidth(400);m.position(null,5000);m.alignTo(document,'br-br');type=typeof type!='undefined'?type:'';time=typeof time!='undefined'?time:PMExt.notify_time_out;switch(type){case'alert':case'warning':case'tmp-warning':image='/images/alert.gif';break;case'error':case'tmp-error':image='/images/error.png';break;case'tmp-info':case'info':image='/images/info.png';break;case'success':case'ok':image='/images/select-icon.png';break;default:image='';} diff --git a/gulliver/js/ext/pmos-common.js b/gulliver/js/ext/pmos-common.js index 9f2e2a5fb..8a774e61d 100644 --- a/gulliver/js/ext/pmos-common.js +++ b/gulliver/js/ext/pmos-common.js @@ -178,7 +178,29 @@ PMExtJSCommon = function() { Tools.createCookie(name,"",-1); } } - + this.emailConst = { + appMsgTypeWithoutTask:['EXTERNAL_REGISTRATION','TEST','CASE_NOTE','SOAP','RETRIEVE_PASSWORD'], + appMsgTypeWithConditionalTask:['PM_FUNCTION'], + appMsgTypeWithoutCase:['EXTERNAL_REGISTRATION','TEST','RETRIEVE_PASSWORD'], + appMsgTypeWithoutProcess:['EXTERNAL_REGISTRATION','TEST','RETRIEVE_PASSWORD'], + appMsgTypeWithoutNumber:['EXTERNAL_REGISTRATION','TEST','RETRIEVE_PASSWORD'], + numberColumn:{ + name:'APP_NUMBER', + defaultValue:'N/A' + }, + taskColumn:{ + name:'TAS_TITLE', + defaultValue:'N/A' + }, + caseColumn:{ + name:'APP_TITLE', + defaultValue:'N/A' + }, + processColumn:{ + name:'PRO_TITLE', + defaultValue:'N/A' + } + } } var PMExt = new PMExtJSCommon(); diff --git a/workflow/engine/classes/ActionsByEmailCoreClass.php b/workflow/engine/classes/ActionsByEmailCoreClass.php index 4228bf13e..a52f45e44 100644 --- a/workflow/engine/classes/ActionsByEmailCoreClass.php +++ b/workflow/engine/classes/ActionsByEmailCoreClass.php @@ -292,7 +292,8 @@ class ActionsByEmailCoreClass extends PMPlugin true, $data->DEL_INDEX, $emailSetup, - 0 + 0, + WsBase::MESSAGE_TYPE_ACTIONS_BY_EMAIL ); $abeRequest['ABE_REQ_STATUS'] = ($result->status_code == 0 ? 'SENT' : 'ERROR'); diff --git a/workflow/engine/classes/Cases.php b/workflow/engine/classes/Cases.php index a6a3b6766..bbad083b1 100644 --- a/workflow/engine/classes/Cases.php +++ b/workflow/engine/classes/Cases.php @@ -5615,9 +5615,14 @@ class Cases } /** + * This function send an email for each task in $arrayTask if $to is definded + * * @param $dataLastEmail * @param $arrayData * @param $arrayTask + * @return void + * + * @see \Cases->sendNotifications() */ public function sendMessage($dataLastEmail, $arrayData, $arrayTask) { @@ -5701,7 +5706,7 @@ class Cases '', $dataLastEmail['applicationUid'], $dataLastEmail['delIndex'], - 'DERIVATION', + WsBase::MESSAGE_TYPE_TASK_NOTIFICATION, $dataLastEmail['subject'], $dataLastEmail['from'], $to, diff --git a/workflow/engine/classes/Derivation.php b/workflow/engine/classes/Derivation.php index f4a34571f..65c55a449 100644 --- a/workflow/engine/classes/Derivation.php +++ b/workflow/engine/classes/Derivation.php @@ -663,14 +663,19 @@ class Derivation /** * Execute Event * - * @param string $dummyTaskUid Unique id of Element Origin (unique id of Task) This is the nextTask - * @param array $applicationData Case data - * @param bool $flagEventExecuteBeforeGateway Execute event before gateway - * @param bool $flagEventExecuteAfterGateway Execute event after gateway + * @param string $dummyTaskUid Unique id of Element Origin (unique id of Task) This is the nextTask + * @param array $applicationData Case data + * @param bool $flagEventExecuteBeforeGateway Execute event before gateway + * @param bool $flagEventExecuteAfterGateway Execute event after gateway + * @param int $taskId * * @return void + * @see Derivation->derivate() + * @see Derivation->doRouteWithoutThread() + * @see Derivation->finishProcess() + * @see Derivation->finishTask() */ - private function executeEvent($dummyTaskUid, array $applicationData, $flagEventExecuteBeforeGateway = true, $flagEventExecuteAfterGateway = true, $elementOriUid='') + private function executeEvent($dummyTaskUid, array $applicationData, $flagEventExecuteBeforeGateway = true, $flagEventExecuteAfterGateway = true, $elementOriUid='',$tasId = 0) { try { //Verify if the Project is BPMN @@ -743,7 +748,7 @@ class Derivation if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') { //Email-Event throw - $result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData); + $result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData, $tasId); $aContext['envUid'] = $value['uid']; $aContext['envType'] = $event->getEvnType(); @@ -1031,7 +1036,8 @@ class Derivation $appFields, true, true, - $currentDelegation["TAS_UID"] + $currentDelegation["TAS_UID"], + !empty($nextDel["TAS_ID"]) ? $nextDel["TAS_ID"] : 0 ); //Route the case @@ -1877,7 +1883,15 @@ class Derivation if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType()) && $multiInstanceCompleted && $executeEvent ) { - $this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true); + $nextDel["TAS_ID"] = $taskDummy->getTasId(); + $this->executeEvent( + $nextDel["TAS_UID_DUMMY"], + $appFields, + $flagFirstIteration, + true, + '', + !empty($nextDel["TAS_ID"]) ? $nextDel["TAS_ID"] : 0 + ); } } $aContext['action'] = 'finish-task'; @@ -1904,12 +1918,27 @@ class Derivation $nextDel['ROU_CONDITION'] = ''; } //Execute the Intermediate Event After the End of Process - $this->executeEvent($nextDel["TAS_UID"], $appFields, true, true); + $this->executeEvent( + $nextDel["TAS_UID"], + $appFields, + true, + true, + '', + !empty($nextDel["TAS_ID"]) ? $nextDel["TAS_ID"] : 0 + ); if (isset($nextDel["TAS_UID_DUMMY"]) ) { $taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]); if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())) { + $nextDel["TAS_ID"] = $taskDummy->getTasId(); //Throw Events - $this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true); + $this->executeEvent( + $nextDel["TAS_UID_DUMMY"], + $appFields, + $flagFirstIteration, + true, + '', + !empty($nextDel["TAS_ID"]) ? $nextDel["TAS_ID"] : 0 + ); } } $aContext['action'] = 'end-process'; @@ -2231,7 +2260,14 @@ class Derivation //If the all Siblings are done execute the events if (sizeof($arraySiblings) === 0 && !$flagTypeMultipleInstance) { //Throw Events - $this->executeEvent($nextDel["TAS_UID"], $appFields, $flagFirstIteration, false); + $this->executeEvent( + $nextDel["TAS_UID"], + $appFields, + $flagFirstIteration, + false, + '', + !empty($nextDel["TAS_ID"]) ? $nextDel["TAS_ID"] : 0 + ); } //Close thread $this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex ); diff --git a/workflow/engine/classes/WsBase.php b/workflow/engine/classes/WsBase.php index f014e60f5..afedb88ec 100644 --- a/workflow/engine/classes/WsBase.php +++ b/workflow/engine/classes/WsBase.php @@ -8,8 +8,18 @@ use ProcessMaker\Core\System; class WsBase { + const MESSAGE_TYPE_ACTIONS_BY_EMAIL = 'ACTIONS_BY_EMAIL'; + const MESSAGE_TYPE_CASE_NOTE = 'CASE_NOTE'; + const MESSAGE_TYPE_EMAIL_EVENT = 'EVENT'; + const MESSAGE_TYPE_EXTERNAL_REGISTRATION = 'EXTERNAL_REGISTRATION'; + const MESSAGE_TYPE_PM_FUNCTION = 'PM_FUNCTION'; + const MESSAGE_TYPE_RETRIEVE_PASSWORD = 'RETRIEVE_PASSWORD'; + const MESSAGE_TYPE_SOAP = 'SOAP'; + const MESSAGE_TYPE_TASK_NOTIFICATION = 'ROUTING'; + const MESSAGE_TYPE_TEST_EMAIL = 'TEST'; public $stored_system_variables; //boolean public $wsSessionId; //web service session id, if the wsbase function is used from a WS request + private $taskId; private $flagSameCase = true; public function __construct($params = null) @@ -45,6 +55,28 @@ class WsBase $this->flagSameCase = $var; } + /** + * Get the taskId + * + * @return int + */ + public function getTaskId() + { + return $this->taskId; + } + + /** + * Set the taskId + * + * @param int $taskId + * + * @return void + */ + public function setTaskId($taskId) + { + $this->taskId = $taskId; + } + /** * function to start a web services session in ProcessMaker * @@ -854,6 +886,13 @@ class WsBase * @param array $config * * @return $result will return an object + * + * @see ActionsByEmailCoreClass->sendActionsByEmail() + * @see workflow\engine\classes\class.pmFunctions::PMFSendMessage() + * @see workflow\engine\methods\services\soap2::sendMessage() + * @see \ProcessMaker\BusinessModel\EmailEvent->sendEmail() + * @see \ProcessMaker\BusinessModel\Pmgmail->sendEmailWithApplicationData() + * */ public function sendMessage( $appUid, @@ -868,7 +907,8 @@ class WsBase $showMessage = true, $delIndex = 0, $config = [], - $gmail = 0 + $gmail = 0, + $appMsgType = WsBase::MESSAGE_TYPE_PM_FUNCTION ) { try { @@ -920,7 +960,7 @@ class WsBase $spool->setConfig($setup); $case = new Cases(); - $oldFields = $case->loadCase($appUid); + $oldFields = $case->loadCase($appUid, $delIndex); if ($gmail == 1) { $pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP; } else { @@ -946,7 +986,7 @@ class WsBase '', $appUid, $delIndex, - 'TRIGGER', + $appMsgType, $subject, G::buildFrom($setup, $from), $to, @@ -961,7 +1001,7 @@ class WsBase (preg_match("/^.+\.html?$/i", $fileTemplate)) ? true : false, isset($fieldsCase['APP_NUMBER']) ? $fieldsCase['APP_NUMBER'] : 0, isset($fieldsCase['PRO_ID']) ? $fieldsCase['PRO_ID'] : 0, - isset($fieldsCase['TAS_ID']) ? $fieldsCase['TAS_ID'] : 0 + $this->getTaskId() ?$this->getTaskId():(isset($oldFields['TAS_ID'])? $oldFields['TAS_ID'] : 0) ); $spool->create($messageArray); diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index a2e3c7b7f..31cf411a4 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -920,34 +920,34 @@ function getEmailConfiguration () * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFSendMessage.28.29 * * @param string(32) | $caseId | UID for case | The UID (unique identification) for a case, which is a string of 32 hexadecimal characters to identify the case. - * @param string(32) | $sFrom | Sender | The email address of the person who sends out the email. - * @param string(100) | $sTo | Recipient | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma. - * @param string(100) | $sCc = '' | Carbon copy recipient | The email address(es) of people who will receive carbon copies of the email. - * @param string(100) | $sBcc = ''| Carbon copy recipient | The email address(es) of people who will receive blind carbon copies of the email. - * @param string(50) | $sSubject | Subject of the email | The subject (title) of the email. - * @param string(50) | $sTemplate | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email. - * @param array | $aFields = array() | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values. - * @param array | $aAttachment = array() | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email. + * @param string(32) | $from | Sender | The email address of the person who sends out the email. + * @param string(100) | $to | Recipient | The email address(es) to whom the email is sent. If multiple recipients, separate each email address with a comma. + * @param string(100) | $cc = '' | Carbon copy recipient | The email address(es) of people who will receive carbon copies of the email. + * @param string(100) | $bcc = ''| Carbon copy recipient | The email address(es) of people who will receive blind carbon copies of the email. + * @param string(50) | $subject | Subject of the email | The subject (title) of the email. + * @param string(50) | $template | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email. + * @param array | $emailTemplateVariables = [] | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values. + * @param array | $attachments = [] | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email. * @param boolean | $showMessage = true | Show message | Optional parameter. Set to TRUE to show the message in the case's message history. * @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case. - * @param string(100) | $config = '' | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server . + * @param array | $config = [] | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server . * @return int | | result | Result of sending email * + * @see class.pmFunctions::PMFSendMessageToGroup() */ -//@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value. function PMFSendMessage( $caseId, - $sFrom, - $sTo, - $sCc, - $sBcc, - $sSubject, - $sTemplate, - $aFields = array(), - $aAttachment = array(), + $from, + $to, + $cc, + $bcc, + $subject, + $template, + $emailTemplateVariables = [], + $attachments = [], $showMessage = true, $delIndex = 0, - $config = array() + $config = [] ) { ini_set ( "pcre.backtrack_limit", 1000000 ); ini_set ( 'memory_limit', '-1' ); @@ -955,28 +955,30 @@ function PMFSendMessage( global $oPMScript; - if (isset( $oPMScript->aFields ) && is_array( $oPMScript->aFields )) { - if (is_array( $aFields )) { - $aFields = array_merge( $oPMScript->aFields, $aFields ); + if (isset($oPMScript->aFields) && is_array($oPMScript->aFields)) { + if (is_array($emailTemplateVariables)) { + $emailTemplateVariables = array_merge($oPMScript->aFields, $emailTemplateVariables); } else { - $aFields = $oPMScript->aFields; + $emailTemplateVariables = $oPMScript->aFields; } } $ws = new WsBase(); $result = $ws->sendMessage( $caseId, - $sFrom, - $sTo, - $sCc, - $sBcc, - $sSubject, - $sTemplate, - $aFields, - $aAttachment, + $from, + $to, + $cc, + $bcc, + $subject, + $template, + $emailTemplateVariables, + $attachments, $showMessage, $delIndex, - $config + $config, + 0, + WsBase::MESSAGE_TYPE_PM_FUNCTION ); if ($result->status_code == 0) { diff --git a/workflow/engine/classes/model/AppNotes.php b/workflow/engine/classes/model/AppNotes.php index 5c4a773c7..3885aa6ad 100644 --- a/workflow/engine/classes/model/AppNotes.php +++ b/workflow/engine/classes/model/AppNotes.php @@ -180,8 +180,12 @@ class AppNotes extends BaseAppNotes * @param string $noteRecipients * @param string $from * @param integer $delIndex - * + * @return void * @throws Exception + * + * @see AppNotes->addCaseNote() + * @see AppNotes->postNewNote() + * @see workflow/engine/src/ProcessMaker/Util/helpers.php::postNote() */ public function sendNoteNotification ($appUid, $usrUid, $noteContent, $noteRecipients, $from = '', $delIndex = 0) { @@ -224,7 +228,7 @@ class AppNotes extends BaseAppNotes '', $appUid, $delIndex, - 'DERIVATION', + WsBase::MESSAGE_TYPE_CASE_NOTE, G::replaceDataField($configNoteNotification['subject'], $fieldCase), G::buildFrom($configuration, $from), $to, diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 26125e591..65d1fafdc 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -574,8 +574,10 @@ class adminProxy extends HttpProxyController } /** - * for send email configuration - * @autor Alvaro + * For test email configuration + * @return stdClass() + * + * @see adminProxy->testConnection() */ public function sendTestMail() { @@ -624,7 +626,7 @@ class adminProxy extends HttpProxyController '', '', '', - 'TEST', + WsBase::MESSAGE_TYPE_TEST_EMAIL, $subject, $from, $_POST['TO'], diff --git a/workflow/engine/methods/login/retrivePassword.php b/workflow/engine/methods/login/retrivePassword.php index 1e0f9f806..4603bf840 100644 --- a/workflow/engine/methods/login/retrivePassword.php +++ b/workflow/engine/methods/login/retrivePassword.php @@ -68,7 +68,7 @@ if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL '', '', 0, - 'TEST', + WsBase::MESSAGE_TYPE_RETRIEVE_PASSWORD, $subject, $from, $data['USR_EMAIL'], diff --git a/workflow/engine/methods/services/soap2.php b/workflow/engine/methods/services/soap2.php index d4493f377..83daf42ed 100644 --- a/workflow/engine/methods/services/soap2.php +++ b/workflow/engine/methods/services/soap2.php @@ -378,6 +378,13 @@ function removeDocument($params) return $res; } +/** + * Send Message + * + * @param object $params + * @return array + * + */ function SendMessage($params) { $vsResult = isValidSession($params->sessionId); @@ -393,7 +400,22 @@ function SendMessage($params) } $ws = new WsBase(); - $res = $ws->sendMessage($params->caseId, $params->from, $params->to, $params->cc, $params->bcc, $params->subject, $params->template); + $res = $ws->sendMessage( + $params->caseId, + $params->from, + $params->to, + $params->cc, + $params->bcc, + $params->subject, + $params->template, + null, + null, + true, + 0, + [], + 0, + WsBase::MESSAGE_TYPE_SOAP + ); return $res->getPayloadArray(); } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/ActionsByEmail.php b/workflow/engine/src/ProcessMaker/BusinessModel/ActionsByEmail.php index 77f1581f9..d5d4f087b 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/ActionsByEmail.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/ActionsByEmail.php @@ -24,6 +24,7 @@ use ResultSet; use SpoolRun; use stdClass; use Users as ClassUsers; +use WsBase; /** * Description of ActionsByEmailService @@ -366,6 +367,9 @@ class ActionsByEmail * * @return string $message * @throws Exception + * + * @see workflow/engine/methods/actionsByEmail/actionsByEmailAjax.php + * @see \ProcessMaker\Services\Api\ActionsByEmail::forwardMail() */ public function forwardMail(array $arrayData) { @@ -397,7 +401,7 @@ class ActionsByEmail '', $dataRes['APP_UID'], $dataRes['DEL_INDEX'], - 'TEST', + WsBase::MESSAGE_TYPE_ACTIONS_BY_EMAIL, $dataRes['ABE_REQ_SUBJECT'], $aSetup['MESS_ACCOUNT'], $dataRes['ABE_REQ_SENT_TO'], diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/EmailEvent.php b/workflow/engine/src/ProcessMaker/BusinessModel/EmailEvent.php index f4a0f2a1b..1ecf359ea 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/EmailEvent.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/EmailEvent.php @@ -14,6 +14,7 @@ use ProcessMaker\Util\Common; use Propel; use ResultSet; use UsersPeer; +use WsBase; class EmailEvent { @@ -455,11 +456,13 @@ class EmailEvent * @param string $prj_uid Unique id of Project * @param string $eventUid Unique id of event * @param array $arrayApplicationData Case data + * @param int $tasId id of task * * @return void * @throws Exception + * @see \Derivation::executeEvent() */ - public function sendEmail($appUID, $prj_uid, $eventUid, $arrayApplicationData) + public function sendEmail($appUID, $prj_uid, $eventUid, $arrayApplicationData, $tasId = 0) { if (!$this->existsEvent($prj_uid, $eventUid)) { throw new Exception(G::LoadTranslation('ID_EMAIL_EVENT_DEFINITION_DOES_NOT_EXIST')); @@ -511,7 +514,9 @@ class EmailEvent } } if (!empty($emailTo)) { - PMFSendMessage( + $ws = new WsBase(); + $ws->setTaskId($tasId); + $ws->sendMessage( $appUID, G::buildFrom($configEmailData), $emailTo, @@ -523,7 +528,9 @@ class EmailEvent [], true, 0, - $configEmailData + $configEmailData, + 0, + WsBase::MESSAGE_TYPE_EMAIL_EVENT ); } else { Bootstrap::registerMonolog( diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/EmailServer.php b/workflow/engine/src/ProcessMaker/BusinessModel/EmailServer.php index 7516bccd2..0f6dfaf45 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/EmailServer.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/EmailServer.php @@ -8,6 +8,7 @@ use G; use ProcessMaker\Core\System; use SpoolRun; use TemplatePower; +use WsBase; class EmailServer { @@ -156,6 +157,7 @@ class EmailServer * * @return array, return array with result of send test mail * @throws Exception + * @see EmailServer->testConnectionByStep() */ public function sendTestMail(array $arrayData) { @@ -203,7 +205,7 @@ class EmailServer '', '', 0, - 'TEST', + WsBase::MESSAGE_TYPE_TEST_EMAIL, G::LoadTranslation("ID_MESS_TEST_SUBJECT"), G::buildFrom($configuration), $arrayData["TO"], diff --git a/workflow/engine/templates/mails/emailList.js b/workflow/engine/templates/mails/emailList.js index fe9f76865..0a9650bf6 100644 --- a/workflow/engine/templates/mails/emailList.js +++ b/workflow/engine/templates/mails/emailList.js @@ -33,20 +33,39 @@ Ext.onReady(function(){ ' {APP_PRO_TITLE}', '' ); - var columnRenderer = function(data, metadata, record, rowIndex,columnIndex, store) { - var new_text = metadata.style.split(';'); - var style = ''; - for (var i = 0; i < new_text.length -1 ; i++) { - var chain = new_text[i] +";"; - if (chain.indexOf('width') == -1) { - style = style + chain; - } - } - metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "'; + if(metadata.id == PMExt.emailConst.taskColumn.name){ + if((PMExt.emailConst.appMsgTypeWithoutTask.includes(record.data.APP_MSG_TYPE)) || (PMExt.emailConst.appMsgTypeWithConditionalTask.includes(record.data.APP_MSG_TYPE) && record.data.DEL_INDEX == 0)){ + data = PMExt.emailConst.taskColumn.defaultValue; + } + } + if(metadata.id == PMExt.emailConst.caseColumn.name){ + if(PMExt.emailConst.appMsgTypeWithoutCase.includes(record.data.APP_MSG_TYPE)){ + data = PMExt.emailConst.caseColumn.defaultValue; + } + } + if(metadata.id == PMExt.emailConst.processColumn.name){ + if(PMExt.emailConst.appMsgTypeWithoutProcess.includes(record.data.APP_MSG_TYPE)){ + data = PMExt.emailConst.processColumn.defaultValue; + } + } + if(metadata.id == PMExt.emailConst.numberColumn.name){ + if(PMExt.emailConst.appMsgTypeWithoutNumber.includes(record.data.APP_MSG_TYPE)){ + data = PMExt.emailConst.numberColumn.defaultValue; + } + } + var new_text = metadata.style.split(';'); + var style = ''; + for (var i = 0; i < new_text.length -1 ; i++) { + var chain = new_text[i] +";"; + if (chain.indexOf('width') == -1) { + style = style + chain; + } + } + metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "'; - return PMExt.escapeHtml(data); - }; + return PMExt.escapeHtml(data); + }; var dateFrom = new Ext.form.DateField({ id:'dateFrom',