diff --git a/workflow/engine/classes/ActionsByEmailCoreClass.php b/workflow/engine/classes/ActionsByEmailCoreClass.php
index 520e0dd87..6f956d48e 100644
--- a/workflow/engine/classes/ActionsByEmailCoreClass.php
+++ b/workflow/engine/classes/ActionsByEmailCoreClass.php
@@ -86,28 +86,13 @@ class ActionsByEmailCoreClass extends PMPlugin
if (!empty($emailSetup)) {
$cases = new Cases();
- $caseFields = $cases->loadCase($data->APP_UID);
- $criteria = new Criteria();
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
- $criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_TYPE);
- $criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_DYN_TYPE);
- $criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_EMAIL_FIELD);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_SUBJECT_FIELD);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_MAILSERVER_OR_MAILCURRENT);
- $criteria->addSelectColumn(AbeConfigurationPeer::ABE_CUSTOM_GRID);
- $criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
- $criteria->addJoin( AbeConfigurationPeer::DYN_UID, DynaformPeer::DYN_UID, Criteria::LEFT_JOIN );
- $criteria->add(AbeConfigurationPeer::PRO_UID, $caseFields['PRO_UID']);
- $criteria->add(AbeConfigurationPeer::TAS_UID, $data->TAS_UID);
- $result = AbeConfigurationPeer::doSelectRS($criteria);
- $result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
- $result->next();
- if ($configuration = $result->getRow()) {
+ $caseFields = $cases->loadCase($data->APP_UID, $data->DEL_INDEX);
+ $actionEmailTable = new AbeConfiguration();
+ $configuration = $actionEmailTable->getTaskConfiguration($caseFields['PRO_UID'], $data->TAS_UID);
+ $caseFields['APP_DATA']['PRO_ID'] = $configuration['PRO_ID'];
+ $caseFields['APP_DATA']['TAS_ID'] = $configuration['TAS_ID'];
+
+ if (!empty($configuration)) {
$configuration['ABE_EMAIL_FIELD'] = str_replace('@@', '', $configuration['ABE_EMAIL_FIELD']);
if ($configuration['ABE_EMAIL_FIELD'] != '' && isset($caseFields['APP_DATA'][$configuration['ABE_EMAIL_FIELD']])) {
$email = trim($caseFields['APP_DATA'][$configuration['ABE_EMAIL_FIELD']]);
@@ -303,7 +288,7 @@ class ActionsByEmailCoreClass extends PMPlugin
$caseFields['APP_DATA'],
null,
true,
- 0,
+ $data->DEL_INDEX,
$emailSetup,
0
);
diff --git a/workflow/engine/classes/Cases.php b/workflow/engine/classes/Cases.php
index be2247bbc..07663e3b9 100644
--- a/workflow/engine/classes/Cases.php
+++ b/workflow/engine/classes/Cases.php
@@ -489,6 +489,7 @@ class Cases
//Update the global variables
$aFields['TASK'] = $aAppDel['TAS_UID'];
$aFields['INDEX'] = $aAppDel['DEL_INDEX'];
+ $aFields['TAS_ID'] = $aAppDel['TAS_ID'];
$aFields['PRO_ID'] = $aAppDel['PRO_ID'];
try {
$oCurUser = new Users();
@@ -5418,13 +5419,13 @@ class Cases
} else {
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
}
- $sBody2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false);
- $sTo = null;
- $sCc = '';
+ $body2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false);
+ $to = null;
+ $cc = '';
if ($aTask['TAS_UID'] != '-1') {
$respTo = $this->getTo($aTask['TAS_UID'], $aTask['USR_UID'], $arrayData);
- $sTo = $respTo['to'];
- $sCc = $respTo['cc'];
+ $to = $respTo['to'];
+ $cc = $respTo['cc'];
}
if ($aTask ["TAS_ASSIGN_TYPE"] === "SELF_SERVICE") {
@@ -5437,12 +5438,12 @@ class Cases
) {
@copy(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'), $fileTemplate);
}
- $sBody2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2);
+ $body2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2);
}
}
- if ($sTo != null) {
- $oSpool = new SpoolRun();
+ if ($to != null) {
+ $spool = new SpoolRun();
//Load the TAS_ID
if (!isset($arrayData['TAS_ID'])) {
@@ -5451,32 +5452,43 @@ class Cases
} else {
$taskId = $arrayData['TAS_ID'];
}
+ //Load the PRO_ID
+ if (!isset($arrayData['PRO_ID'])) {
+ $process = new Process();
+ $proId = $process->load($arrayData['PROCESS'])['PRO_ID'];
+ } else {
+ $proId = $arrayData['PRO_ID'];
+ }
- $oSpool->setConfig($dataLastEmail['configuration']);
- $oSpool->create(array(
- "msg_uid" => "",
- 'app_uid' => $dataLastEmail['applicationUid'],
- 'del_index' => $dataLastEmail['delIndex'],
- "app_msg_type" => "DERIVATION",
- "app_msg_subject" => $dataLastEmail['subject'],
- 'app_msg_from' => $dataLastEmail['from'],
- "app_msg_to" => $sTo,
- 'app_msg_body' => $sBody2,
- "app_msg_cc" => $sCc,
- "app_msg_bcc" => "",
- "app_msg_attach" => "",
- "app_msg_template" => "",
- "app_msg_status" => "pending",
- "app_msg_error" => $dataLastEmail['msgError'],
- "tas_id" => $taskId,
- "app_number" => isset($arrayData['APP_NUMBER']) ? $arrayData['APP_NUMBER'] : ''
- ));
+ $spool->setConfig($dataLastEmail['configuration']);
+ $messageArray = AppMessage::buildMessageRow(
+ '',
+ $dataLastEmail['applicationUid'],
+ $dataLastEmail['delIndex'],
+ 'DERIVATION',
+ $dataLastEmail['subject'],
+ $dataLastEmail['from'],
+ $to,
+ $body2,
+ $cc,
+ '',
+ '',
+ '',
+ 'pending',
+ '',
+ $dataLastEmail['msgError'],
+ true,
+ isset($arrayData['APP_NUMBER']) ? $arrayData['APP_NUMBER'] : 0,
+ $proId,
+ $taskId
+ );
+ $spool->create($messageArray);
if ($dataLastEmail['msgError'] == '') {
if (($dataLastEmail['configuration']["MESS_BACKGROUND"] == "") ||
($dataLastEmail['configuration']["MESS_TRY_SEND_INMEDIATLY"] == "1")
) {
- $oSpool->sendMail();
+ $spool->sendMail();
}
}
}
@@ -5525,8 +5537,8 @@ class Cases
public function getTo($taskUid, $userUid, $arrayData)
{
- $sTo = null;
- $sCc = null;
+ $to = null;
+ $cc = null;
$arrayResp = array();
$tasks = new Tasks();
$group = new Groups();
@@ -5670,9 +5682,9 @@ class Cases
if (isset($userUid) && !empty($userUid)) {
$aUser = $oUser->load($userUid);
- $sTo = ((($aUser ["USR_FIRSTNAME"] != "") || ($aUser ["USR_LASTNAME"] != "")) ? $aUser ["USR_FIRSTNAME"] . " " . $aUser ["USR_LASTNAME"] . " " : "") . "<" . $aUser ["USR_EMAIL"] . ">";
+ $to = ((($aUser ["USR_FIRSTNAME"] != "") || ($aUser ["USR_LASTNAME"] != "")) ? $aUser ["USR_FIRSTNAME"] . " " . $aUser ["USR_LASTNAME"] . " " : "") . "<" . $aUser ["USR_EMAIL"] . ">";
}
- $arrayResp ['to'] = $sTo;
+ $arrayResp ['to'] = $to;
$arrayResp ['cc'] = '';
break;
}
@@ -6308,62 +6320,6 @@ class Cases
return $oCriteria;
}
- /**
- * funcion History messages for case tracker ExtJS
- * @name getHistoryMessagesTrackerExt
- * @param string sApplicationUID
- * @param string Msg_UID
- * @return array
- */
- public function getHistoryMessagesTrackerExt($sApplicationUID, $onlyVisibles = false, $start = null, $limit = null)
- {
- global $_DBArray;
-
- $oAppDocument = new AppDocument();
- $oCriteria = new Criteria('workflow');
- $oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);
- if ($onlyVisibles) {
- $oCriteria->add(AppMessagePeer::APP_MSG_SHOW_MESSAGE, 1);
- }
- $oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);
-
- $oDataset = AppMessagePeer::doSelectRS($oCriteria);
- $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
- $oDataset->next();
- $aMessages = array();
-
- while ($aRow = $oDataset->getRow()) {
- //Head for IE quirks mode
- $sBody = '' . $aRow['APP_MSG_BODY'];
- $aMessages[] = array('APP_MSG_UID' => $aRow['APP_MSG_UID'],
- 'APP_UID' => $aRow['APP_UID'],
- 'DEL_INDEX' => $aRow['DEL_INDEX'],
- 'APP_MSG_TYPE' => $aRow['APP_MSG_TYPE'],
- 'APP_MSG_SUBJECT' => $aRow['APP_MSG_SUBJECT'],
- 'APP_MSG_FROM' => $aRow['APP_MSG_FROM'],
- 'APP_MSG_TO' => $aRow['APP_MSG_TO'],
- 'APP_MSG_BODY' => $sBody,
- 'APP_MSG_DATE' => $aRow['APP_MSG_DATE'],
- 'APP_MSG_CC' => $aRow['APP_MSG_CC'],
- 'APP_MSG_BCC' => $aRow['APP_MSG_BCC'],
- 'APP_MSG_TEMPLATE' => $aRow['APP_MSG_TEMPLATE'],
- 'APP_MSG_STATUS' => $aRow['APP_MSG_STATUS'],
- 'APP_MSG_ATTACH' => $aRow['APP_MSG_ATTACH'],
- 'APP_MSG_SHOW_MESSAGE' => $aRow['APP_MSG_SHOW_MESSAGE']
- );
- $oDataset->next();
- }
-
- $_DBArray['messages'] = $aMessages;
- $_SESSION['_DBArray'] = $_DBArray;
-
- $oCriteria = new Criteria('dbarray');
- $oCriteria->setDBArrayTable('messages');
-
- usort($aMessages, array($this, "ordProcess"));
- return $aMessages;
- }
-
/**
* funcion History messages for case tracker
* by Everth The Answer
@@ -7154,30 +7110,6 @@ class Cases
}
}
- public function ordProcess($a, $b)
- {
- if ($this->sort == '') {
- $this->sort = 'APP_MSG_DATE';
- }
- if ($this->dir == 'ASC') {
- if ($a[$this->sort] > $b[$this->sort]) {
- return 1;
- } elseif ($a[$this->sort] < $b[$this->sort]) {
- return - 1;
- } else {
- return 0;
- }
- } else {
- if ($a[$this->sort] > $b[$this->sort]) {
- return - 1;
- } elseif ($a[$this->sort] < $b[$this->sort]) {
- return 1;
- } else {
- return 0;
- }
- }
- }
-
public function unserializeData($data)
{
$unserializedData = @unserialize($data);
diff --git a/workflow/engine/classes/Derivation.php b/workflow/engine/classes/Derivation.php
index 1faa145b3..f166e25b6 100644
--- a/workflow/engine/classes/Derivation.php
+++ b/workflow/engine/classes/Derivation.php
@@ -1803,6 +1803,10 @@ class Derivation
if (isset($nextDel['TAS_ID'])) {
$appFields['APP_DATA']['TAS_ID'] = $nextDel['TAS_ID'];
}
+ //Load the PRO_ID
+ if (isset($nextDel['PRO_ID'])) {
+ $appFields['APP_DATA']['PRO_ID'] = $nextDel['PRO_ID'];
+ }
$this->case->sendMessage($dataEmail, $appFields['APP_DATA'], $taskData);
}
return true;
diff --git a/workflow/engine/classes/SpoolRun.php b/workflow/engine/classes/SpoolRun.php
index b6a3010f9..d212f075a 100644
--- a/workflow/engine/classes/SpoolRun.php
+++ b/workflow/engine/classes/SpoolRun.php
@@ -239,7 +239,8 @@ class SpoolRun
$attachment = implode(",", $this->fileData['attachments']);
$oAppMessage->setappMsgAttach($attachment);
}
- $oAppMessage->setappMsgstatus($this->status);
+ $oAppMessage->setAppMsgStatus($this->status);
+ $oAppMessage->setAppMsgStatusId(isset(AppMessage::$app_msg_status_values[$this->status]) ? AppMessage::$app_msg_status_values[$this->status] : 0);
$oAppMessage->setappMsgsenddate(date('Y-m-d H:i:s'));
$oAppMessage->save();
}
@@ -543,26 +544,28 @@ class SpoolRun
}
/**
- * try resend the emails from spool
+ * Try to resend the emails from spool
*
* @param string $dateResend
+ * @param integer $cron
+ *
* @return none or exception
*/
public function resendEmails($dateResend = null, $cron = 0)
{
- $aConfiguration = System::getEmailConfiguration();
+ $configuration = System::getEmailConfiguration();
- if (!isset($aConfiguration["MESS_ENABLED"])) {
- $aConfiguration["MESS_ENABLED"] = '0';
+ if (!isset($configuration["MESS_ENABLED"])) {
+ $configuration["MESS_ENABLED"] = '0';
}
- if ($aConfiguration["MESS_ENABLED"] == "1") {
+ if ($configuration["MESS_ENABLED"] == "1") {
require_once("classes/model/AppMessage.php");
- $this->setConfig($aConfiguration);
+ $this->setConfig($configuration);
$criteria = new Criteria("workflow");
- $criteria->add(AppMessagePeer::APP_MSG_STATUS, "sent", Criteria::NOT_EQUAL);
+ $criteria->add(AppMessagePeer::APP_MSG_STATUS_ID, AppMessage::MESSAGE_STATUS_PENDING, Criteria::EQUAL);
if ($dateResend != null) {
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateResend, Criteria::GREATER_EQUAL);
@@ -581,13 +584,24 @@ class SpoolRun
$row = $rsCriteria->getRow();
try {
- $sFrom = G::buildFrom($aConfiguration, $row["APP_MSG_FROM"]);
+ $from = G::buildFrom($configuration, $row["APP_MSG_FROM"]);
- $this->setData($row["APP_MSG_UID"], $row["APP_MSG_SUBJECT"], $sFrom, $row["APP_MSG_TO"], $row["APP_MSG_BODY"], date("Y-m-d H:i:s"), $row["APP_MSG_CC"], $row["APP_MSG_BCC"], $row["APP_MSG_TEMPLATE"], $row["APP_MSG_ATTACH"]);
+ $this->setData(
+ $row["APP_MSG_UID"],
+ $row["APP_MSG_SUBJECT"],
+ $from,
+ $row["APP_MSG_TO"],
+ $row["APP_MSG_BODY"],
+ date("Y-m-d H:i:s"),
+ $row["APP_MSG_CC"],
+ $row["APP_MSG_BCC"],
+ $row["APP_MSG_TEMPLATE"],
+ $row["APP_MSG_ATTACH"]
+ );
$this->sendMail();
} catch (Exception $e) {
- $strAux = "Spool::resendEmails(): Using " . $aConfiguration["MESS_ENGINE"] . " for APP_MGS_UID=" . $row["APP_MSG_UID"] . " -> With message: " . $e->getMessage();
+ $strAux = "Spool::resendEmails(): Using " . $configuration["MESS_ENGINE"] . " for APP_MGS_UID=" . $row["APP_MSG_UID"] . " -> With message: " . $e->getMessage();
if ($e->getCode() == $this->ExceptionCode["WARNING"]) {
array_push($this->aWarnings, $strAux);
@@ -631,6 +645,7 @@ class SpoolRun
$spool->setAppUid($db_spool['app_uid']);
$spool->setDelIndex($db_spool['del_index']);
$spool->setAppMsgType($db_spool['app_msg_type']);
+ $spool->setAppMsgTypeId(isset(AppMessage::$app_msg_type_values[$db_spool['app_msg_type']]) ? AppMessage::$app_msg_type_values[$db_spool['app_msg_type']] : 0);
$spool->setAppMsgSubject($db_spool['app_msg_subject']);
$spool->setAppMsgFrom($db_spool['app_msg_from']);
$spool->setAppMsgTo($db_spool['app_msg_to']);
@@ -641,12 +656,13 @@ class SpoolRun
$spool->setappMsgAttach($db_spool['app_msg_attach']);
$spool->setAppMsgTemplate($db_spool['app_msg_template']);
$spool->setAppMsgStatus($db_spool['app_msg_status']);
- $spool->setAppMsgSendDate(date('Y-m-d H:i:s')); // Add by Ankit
- $spool->setAppMsgShowMessage($db_spool['app_msg_show_message']); // Add by Ankit
+ $spool->setAppMsgStatusId(isset(AppMessage::$app_msg_status_values[$db_spool['app_msg_status']]) ? AppMessage::$app_msg_status_values[$db_spool['app_msg_status']] : 0);
+ $spool->setAppMsgSendDate(date('Y-m-d H:i:s'));
+ $spool->setAppMsgShowMessage($db_spool['app_msg_show_message']);
$spool->setAppMsgError($db_spool['app_msg_error']);
+ $appDelegation = new AppDelegation();
if (empty($db_spool['app_number'])) {
- $appDelegation = new AppDelegation();
$delegationIds = $appDelegation->getColumnIds($db_spool['app_uid'], $db_spool['del_index']);
if (is_array($delegationIds) && count($delegationIds) > 0) {
$delegationIds = array_change_key_case($delegationIds);
@@ -665,8 +681,15 @@ class SpoolRun
$tasId = $db_spool['tas_id'];
}
+ if (empty($db_spool['pro_id'])) {
+ $proId = isset($delegationIds['pro_id']) ? $delegationIds['pro_id'] : $appDelegation->getProcessId($appNumber);
+ } else {
+ $proId = $db_spool['pro_id'];
+ }
+
$spool->setAppNumber($appNumber);
$spool->setTasId($tasId);
+ $spool->setProId($proId);
if (!$spool->validate()) {
$errors = $spool->getValidationFailures();
diff --git a/workflow/engine/classes/WorkspaceTools.php b/workflow/engine/classes/WorkspaceTools.php
index 98f193d84..2f33477e1 100644
--- a/workflow/engine/classes/WorkspaceTools.php
+++ b/workflow/engine/classes/WorkspaceTools.php
@@ -3869,18 +3869,65 @@ class WorkspaceTools
WHERE AD.APP_NUMBER = 0");
$con->commit();
- // Populating APP_MESSAGE.TAS_ID
- CLI::logging("-> Populating APP_MESSAGE.TAS_ID \n");
+ // Populating APP_MESSAGE.TAS_ID AND APP_MESSAGE.PRO_ID
+ CLI::logging("-> Populating APP_MESSAGE.TAS_ID and APP_MESSAGE.PRO_ID \n");
$con->begin();
$stmt = $con->createStatement();
- $rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AD
+ $rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AM
INNER JOIN (
- SELECT APP_DELEGATION.TAS_ID, APP_DELEGATION.APP_NUMBER, APP_DELEGATION.TAS_UID, APP_DELEGATION.DEL_INDEX
+ SELECT APP_DELEGATION.TAS_ID,
+ APP_DELEGATION.APP_NUMBER,
+ APP_DELEGATION.TAS_UID,
+ APP_DELEGATION.DEL_INDEX,
+ APP_DELEGATION.PRO_ID
FROM APP_DELEGATION
) AS DEL
- ON (AD.APP_NUMBER = DEL.APP_NUMBER AND AD.DEL_INDEX = DEL.DEL_INDEX)
- SET AD.TAS_ID = DEL.TAS_ID
- WHERE AD.TAS_ID = 0 AND AD.APP_NUMBER != 0 AND AD.DEL_INDEX != 0");
+ ON (AM.APP_NUMBER = DEL.APP_NUMBER AND AM.DEL_INDEX = DEL.DEL_INDEX)
+ SET AM.TAS_ID = DEL.TAS_ID, AM.PRO_ID = DEL.PRO_ID
+ WHERE AM.TAS_ID = 0 AND AM.PRO_ID = 0 AND AM.APP_NUMBER != 0 AND AM.DEL_INDEX != 0");
+ $con->commit();
+
+ // Populating APP_MESSAGE.PRO_ID when does not exits DEL_INDEX
+ CLI::logging("-> Populating APP_MESSAGE.PRO_ID\n");
+ $con->begin();
+ $stmt = $con->createStatement();
+ $rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AM
+ INNER JOIN (
+ SELECT APP_DELEGATION.APP_NUMBER,
+ APP_DELEGATION.DEL_INDEX,
+ APP_DELEGATION.PRO_ID
+ FROM APP_DELEGATION
+ ) AS DEL
+ ON (AM.APP_NUMBER = DEL.APP_NUMBER)
+ SET AM.PRO_ID = DEL.PRO_ID
+ WHERE AM.PRO_ID = 0 AND AM.APP_NUMBER != 0");
+ $con->commit();
+
+ // Populating APP_MESSAGE.PRO_ID
+ CLI::logging("-> Populating APP_MESSAGE.APP_MSG_STATUS_ID \n");
+ $con->begin();
+ $rs = $stmt->executeQuery("UPDATE APP_MESSAGE
+ SET APP_MSG_STATUS_ID = (case
+ when APP_MSG_STATUS = 'sent' then 1
+ when APP_MSG_STATUS = 'pending' then 2
+ when APP_MSG_STATUS = 'failed' then 3
+ end)
+ WHERE APP_MSG_STATUS in ('sent', 'pending', 'failed') AND
+ APP_MSG_STATUS_ID = 0");
+ $con->commit();
+
+ // Populating APP_MESSAGE.PRO_ID
+ CLI::logging("-> Populating APP_MESSAGE.APP_MSG_STATUS_ID \n");
+ $con->begin();
+ $rs = $stmt->executeQuery("UPDATE APP_MESSAGE
+ SET APP_MSG_TYPE_ID = (case
+ when APP_MSG_TYPE = 'TEST' then 1
+ when APP_MSG_TYPE = 'TRIGGER' then 2
+ when APP_MSG_TYPE = 'DERIVATION' then 3
+ when APP_MSG_TYPE = 'EXTERNAL_REGISTRATION' then 4
+ end)
+ WHERE APP_MSG_TYPE in ('TEST', 'TRIGGER', 'DERIVATION', 'EXTERNAL_REGISTRATION') AND
+ APP_MSG_TYPE_ID = 0");
$con->commit();
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
diff --git a/workflow/engine/classes/WsBase.php b/workflow/engine/classes/WsBase.php
index d87a7e3df..ba869bc24 100644
--- a/workflow/engine/classes/WsBase.php
+++ b/workflow/engine/classes/WsBase.php
@@ -2,6 +2,7 @@
//It works with the table CONFIGURATION in a WF dataBase
use ProcessMaker\Core\System;
+use ProcessMaker\BusinessModel\EmailServer;
/**
* Copyright (C) 2009 COLOSA
@@ -776,22 +777,34 @@ class WsBase
/**
* send message
*
- * @param string $caseId
- * @param string $sFrom
- * @param string $sTo
- * @param string $sCc
- * @param string $sBcc
- * @param string $sSubject
- * @param string $sTemplate
+ * @param string $appUid
+ * @param string $from
+ * @param string $to
+ * @param string $cc
+ * @param string $bcc
+ * @param string $subject
+ * @param string $template
* @param $appFields = null
- * @param $aAttachment = null
+ * @param $attachment = null
* @param boolean $showMessage = true
* @param int $delIndex = 0
* @param $config = array
* @return $result will return an object
*/
public function sendMessage(
- $caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null, $showMessage = true, $delIndex = 0, $config = [], $gmail = 0
+ $appUid,
+ $from,
+ $to,
+ $cc,
+ $bcc,
+ $subject,
+ $template,
+ $appFields = null,
+ $attachment = null,
+ $showMessage = true,
+ $delIndex = 0,
+ $config = [],
+ $gmail = 0
) {
try {
@@ -805,56 +818,50 @@ class WsBase
}
} else {
if (PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0=")) {
- $emailServer = new \ProcessMaker\BusinessModel\EmailServer();
-
+ $emailServer = new EmailServer();
$criteria = $emailServer->getEmailServerCriteria();
-
$criteria->add(EmailServerPeer::MESS_UID, $config, Criteria::EQUAL);
-
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
-
$arrayConfigAux = $row;
$arrayConfigAux["SMTPSecure"] = $row["SMTPSECURE"];
}
}
}
- $aSetup = (!empty($arrayConfigAux)) ? $arrayConfigAux : System::getEmailConfiguration();
+ $setup = (!empty($arrayConfigAux)) ? $arrayConfigAux : System::getEmailConfiguration();
- if (!isset($aSetup['MESS_ENABLED'])) {
- $aSetup['MESS_ENABLED'] = 1;
- $aSetup['SMTPSecure'] = $aSetup['SMTPSECURE'];
- unset($aSetup['SMTPSECURE']);
+ if (!isset($setup['MESS_ENABLED'])) {
+ $setup['MESS_ENABLED'] = 1;
+ $setup['SMTPSecure'] = $setup['SMTPSECURE'];
+ unset($setup['SMTPSECURE']);
}
} else {
/*----------------------------------********---------------------------------*/
- $aSetup = System::getEmailConfiguration();
+ $setup = System::getEmailConfiguration();
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
$msgError = "";
- if (sizeof($aSetup) == 0) {
+ if (sizeof($setup) == 0) {
$msgError = "The default configuration wasn't defined";
}
- $oSpool = new SpoolRun();
+ $spool = new SpoolRun();
+ $spool->setConfig($setup);
- $oSpool->setConfig($aSetup);
-
- $oCase = new Cases();
-
- $oldFields = $oCase->loadCase($caseId);
+ $case = new Cases();
+ $oldFields = $case->loadCase($appUid);
if ($gmail == 1) {
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP;
} else {
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $oldFields['PRO_UID'] . PATH_SEP;
}
- $fileTemplate = $pathEmail . $sTemplate;
+ $fileTemplate = $pathEmail . $template;
G::mk_dir($pathEmail, 0777, true);
if (!file_exists($fileTemplate)) {
@@ -865,48 +872,45 @@ class WsBase
}
if ($appFields == null) {
- $Fields = $oldFields['APP_DATA'];
+ $fieldsCase = $oldFields['APP_DATA'];
} else {
- $Fields = array_merge($oldFields['APP_DATA'], $appFields);
+ $fieldsCase = array_merge($oldFields['APP_DATA'], $appFields);
}
- $sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $Fields, false);
-
- $sFrom = G::buildFrom($aSetup, $sFrom);
-
- $showMessage = ($showMessage) ? 1 : 0;
-
- $messageArray = array(
- "msg_uid" => "",
- "app_uid" => $caseId,
- "del_index" => $delIndex,
- "app_msg_type" => "TRIGGER",
- "app_msg_subject" => $sSubject,
- "app_msg_from" => $sFrom,
- "app_msg_to" => $sTo,
- "app_msg_body" => $sBody,
- "app_msg_cc" => $sCc,
- "app_msg_bcc" => $sBcc,
- "app_msg_attach" => $aAttachment,
- "app_msg_template" => "",
- "app_msg_status" => "pending",
- "app_msg_show_message" => $showMessage,
- "app_msg_error" => $msgError,
- "contentTypeIsHtml" => (preg_match("/^.+\.html?$/i", $fileTemplate)) ? true : false
+ $messageArray = AppMessage::buildMessageRow(
+ '',
+ $appUid,
+ $delIndex,
+ 'TRIGGER',
+ $subject,
+ G::buildFrom($setup, $from),
+ $to,
+ G::replaceDataGridField(file_get_contents($fileTemplate), $fieldsCase, false),
+ $cc,
+ $bcc,
+ '',
+ '',
+ 'pending',
+ ($showMessage) ? 1 : 0,
+ $msgError,
+ (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
);
+ $spool->create($messageArray);
- $oSpool->create($messageArray);
+ $result = "";
if ($gmail != 1) {
- $oSpool->sendMail();
+ $spool->sendMail();
- if ($oSpool->status == 'sent') {
- $result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $sTo);
+ if ($spool->status == 'sent') {
+ $result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
} else {
- $result = new WsResponse(29, $oSpool->status . ' ' . $oSpool->error . print_r($aSetup, 1));
+ $result = new WsResponse(29, $spool->status . ' ' . $spool->error . print_r($setup, 1));
}
- } else {
- $result = "";
}
+
return $result;
} catch (Exception $e) {
return new WsResponse(100, $e->getMessage());
@@ -2315,19 +2319,26 @@ class WsBase
$sFromName = "\"" . $arrayUserData["USR_FIRSTNAME"] . " " . $arrayUserData["USR_LASTNAME"] . "\" <" . $arrayUserData["USR_EMAIL"] . ">";
}
- $oCase->sendNotifications($appdel['TAS_UID'], $nextDelegations, $appFields['APP_DATA'], $caseId, $delIndex, $sFromName);
+ $process = new Process();
+ $processFieds = $process->Load($appFields['PRO_UID']);
+ $appFields['APP_DATA']['PRO_ID'] = $processFieds['PRO_ID'];
+
+ $oCase->sendNotifications(
+ $appdel['TAS_UID'],
+ $nextDelegations,
+ $appFields['APP_DATA'],
+ $caseId,
+ $delIndex,
+ $sFromName
+ );
- $oProcess = new Process();
- $oProcessFieds = $oProcess->Load($appFields['PRO_UID']);
//here debug mode in web entry
-
-
- if (isset($oProcessFieds['PRO_DEBUG']) && $oProcessFieds['PRO_DEBUG']) {
+ if (isset($processFieds['PRO_DEBUG']) && $processFieds['PRO_DEBUG']) {
$result = new WsResponse(0, $varResponse . "
|
" . G::LoadTranslation('ID_DEBUG_MESSAGE') . " |
" . $varTriggers);
} else {
- $result = new WsResponse(0, $varResponse . " --- " . $oProcessFieds['PRO_DEBUG']);
+ $result = new WsResponse(0, $varResponse . " --- " . $processFieds['PRO_DEBUG']);
}
$res = $result->getPayloadArray();
diff --git a/workflow/engine/classes/model/AbeConfiguration.php b/workflow/engine/classes/model/AbeConfiguration.php
index 81b8d4c25..6b740d85a 100644
--- a/workflow/engine/classes/model/AbeConfiguration.php
+++ b/workflow/engine/classes/model/AbeConfiguration.php
@@ -113,6 +113,46 @@ class AbeConfiguration extends BaseAbeConfiguration
throw $error;
}
}
+
+ /**
+ * Get configuration from ABE related to the task
+ *
+ * @param string $proUid
+ * @param string $tasUid
+ *
+ * @return array
+ */
+ public function getTaskConfiguration ($proUid, $tasUid)
+ {
+ $criteria = new Criteria();
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_TYPE);
+ $criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
+ $criteria->addSelectColumn(TaskPeer::TAS_ID);
+ $criteria->addSelectColumn(ProcessPeer::PRO_ID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_DYN_TYPE);
+ $criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_EMAIL_FIELD);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_SUBJECT_FIELD);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_MAILSERVER_OR_MAILCURRENT);
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_CUSTOM_GRID);
+ $criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
+ $criteria->addJoin( AbeConfigurationPeer::DYN_UID, DynaformPeer::DYN_UID, Criteria::LEFT_JOIN );
+ $criteria->addJoin(AbeConfigurationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
+ $criteria->addJoin(AbeConfigurationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
+ $criteria->add(AbeConfigurationPeer::PRO_UID, $proUid);
+ $criteria->add(AbeConfigurationPeer::TAS_UID, $tasUid);
+ $criteria->setLimit(1);
+ $result = AbeConfigurationPeer::doSelectRS($criteria);
+ $result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $result->next();
+ $configuration = $result->getRow();
+
+ return $configuration;
+ }
}
// AbeConfiguration
diff --git a/workflow/engine/classes/model/AbeRequests.php b/workflow/engine/classes/model/AbeRequests.php
index 1bfbaaa6e..1faaa8a73 100644
--- a/workflow/engine/classes/model/AbeRequests.php
+++ b/workflow/engine/classes/model/AbeRequests.php
@@ -81,6 +81,48 @@ class AbeRequests extends BaseAbeRequests
throw $error;
}
}
+
+ /**
+ * Get information about the notification sent
+ *
+ * @param string $abeRequestUid
+ *
+ * @return array
+ */
+ public function getAbeRequest ($abeRequestUid)
+ {
+ $criteria = new Criteria();
+ $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
+ $criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
+ $criteria->addSelectColumn(TaskPeer::TAS_ID);
+ $criteria->addSelectColumn(ProcessPeer::PRO_ID);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_UID);
+ $criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
+ $criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SENT_TO);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SUBJECT);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_BODY);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_ANSWERED);
+ $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_STATUS);
+ $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
+ $criteria->addSelectColumn(AppDelegationPeer::APP_NUMBER);
+ $criteria->addJoin(AbeConfigurationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
+ $criteria->addJoin(AbeConfigurationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
+ $criteria->addJoin(AbeConfigurationPeer::ABE_UID, AbeRequestsPeer::ABE_UID, Criteria::LEFT_JOIN);
+ $conditions[] = [AbeRequestsPeer::APP_UID, AppDelegationPeer::APP_UID];
+ $conditions[] = [AbeRequestsPeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX];
+ $criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
+ $criteria->add(AbeRequestsPeer::ABE_REQ_UID, $abeRequestUid);
+ $criteria->setLimit(1);
+ $resultRes = AbeRequestsPeer::doSelectRS($criteria);
+ $resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $resultRes->next();
+
+ $infoRequest = $resultRes->getRow();
+
+ return $infoRequest;
+ }
}
// AbeRequests
diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php
index 6efdf634e..7e0d4493b 100644
--- a/workflow/engine/classes/model/AppDelegation.php
+++ b/workflow/engine/classes/model/AppDelegation.php
@@ -305,21 +305,26 @@ class AppDelegation extends BaseAppDelegation
/**
* Load the Application Delegation row specified in [app_id] column value.
*
- * @param string $AppUid the uid of the application
+ * @param string $appUid the uid of the application
+ * @param integer $delIndex
+ *
* @return array $Fields the fields
+ *
+ * @throws Exception
*/
- public function Load ($AppUid, $sDelIndex)
+ public function Load ($appUid, $delIndex)
{
- $con = Propel::getConnection( AppDelegationPeer::DATABASE_NAME );
+ $con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
try {
- $oAppDel = AppDelegationPeer::retrieveByPk( $AppUid, $sDelIndex );
- if (is_object( $oAppDel ) && get_class( $oAppDel ) == 'AppDelegation') {
- $aFields = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
- $this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
- return $aFields;
+ $oAppDel = AppDelegationPeer::retrieveByPk($appUid, $delIndex);
+ if (is_object($oAppDel) && get_class($oAppDel) == 'AppDelegation') {
+ $fields = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
+ $this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
+
+ return $fields;
} else {
- throw (new Exception( "The row '$AppUid, $sDelIndex' in table AppDelegation doesn't exist!" ));
+ throw (new Exception("The row '$appUid, $delIndex' in table AppDelegation doesn't exist!"));
}
} catch (Exception $oError) {
throw ($oError);
@@ -955,4 +960,44 @@ class AppDelegation extends BaseAppDelegation
}
}
+ /**
+ * Get the user assigned in the index
+ *
+ * @param string $appUid
+ * @param string $delIndex
+ *
+ * @return string|null
+ */
+ public function getUserAssignedInThread($appUid, $delIndex)
+ {
+ $currentUserUid = null;
+
+ $result = $this->Load($appUid, $delIndex);
+ if (isset($result["USR_UID"])) {
+ $currentUserUid = $result["USR_UID"];
+ }
+
+ return $currentUserUid;
+ }
+
+ /**
+ * Get column PRO_ID related to the APP_NUMBER
+ *
+ * @param integer $appNumber
+ *
+ * @return integer
+ */
+ public function getProcessId($appNumber)
+ {
+ $proId = 0;
+ $criteria = new Criteria("workflow");
+ $criteria->add(AppDelegationPeer::APP_NUMBER, $appNumber);
+ $dataset = AppDelegationPeer::doSelectOne($criteria);
+ if (!is_null($dataset)) {
+ $proId = $dataset->getProId();
+ }
+
+ return $proId;
+ }
+
}
diff --git a/workflow/engine/classes/model/AppMessage.php b/workflow/engine/classes/model/AppMessage.php
index ff397b1d9..90f1fc9a4 100644
--- a/workflow/engine/classes/model/AppMessage.php
+++ b/workflow/engine/classes/model/AppMessage.php
@@ -1,29 +1,4 @@
.
- *
- * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
- * Coral Gables, FL, 33134, USA, or email info@colosa.com.
- */
-
-//require_once 'classes/model/om/BaseAppMessage.php';
/**
* Skeleton subclass for representing a row from the 'APP_MESSAGE' table.
@@ -39,9 +14,18 @@
class AppMessage extends BaseAppMessage
{
+ const TYPE_TEST = 1;
+ const TYPE_TRIGGER = 2;
+ const TYPE_DERIVATION = 3;
+ const TYPE_EXTERNAL_REGISTRATION = 4;
+ const MESSAGE_STATUS_SENT = 1;
+ const MESSAGE_STATUS_PENDING = 2;
+ const MESSAGE_STATUS_FAILED = 3;
private $data_spool;
private $status_spool;
private $error_spool;
+ public static $app_msg_status_values = ['sent' => 1, 'pending' => 2, 'failed' => 3];
+ public static $app_msg_type_values = ['TEST' => 1, 'TRIGGER' => 2, 'DERIVATION' => 3, 'EXTERNAL_REGISTRATION' => 4];
public function getSpoolStatus ()
{
@@ -54,13 +38,10 @@ class AppMessage extends BaseAppMessage
}
/**
- * AppMessgae quick Save method
+ * @deprecated version 3.2.4
*
- * @param Array(msg_uid, app_uid, del_index, app_msg_type, app_msg_subject, app_msg_from, app_msg_to,
- * app_msg_body, app_msg_cc, app_msg_bcc, app_msg_attach, app_msg_template, app_msg_status )
+ * This function is not used in the core
*
- * @author Erik Amaru Ortiz
- * Date Aug 31th, 2009
*/
public function quickSave2 ($data_spool)
{
@@ -104,6 +85,12 @@ class AppMessage extends BaseAppMessage
return $sUID;
}
+ /**
+ * @deprecated version 3.2.4
+ *
+ * This function is not used in the core
+ *
+ */
public function quickSave ($aData)
{
if (isset( $aData['app_msg_uid'] )) {
@@ -122,12 +109,196 @@ class AppMessage extends BaseAppMessage
}
}
- public function updateStatus($msgUid, $msgStatus)
+ /**
+ * Update the column APP_MSG_STATUS
+ *
+ * @param string $msgUid
+ * @param integer $msgStatusId
+ *
+ * @return void
+ *
+ */
+ public function updateStatus($msgUid, $msgStatusId)
{
- $message = AppMessagePeer::retrieveByPk( $msgUid );
- $message->fromArray( $message, BasePeer::TYPE_FIELDNAME );
+ $message = AppMessagePeer::retrieveByPk($msgUid);
+ $message->fromArray($message, BasePeer::TYPE_FIELDNAME);
+ $message->setAppMsgStatusId($msgStatusId);
+ $msgStatus = array_search($msgStatusId, self::$app_msg_status_values);
$message->setAppMsgStatus($msgStatus);
$message->save();
}
+
+ /**
+ * Get all status and labels
+ *
+ * @return array
+ */
+ public static function getAllStatus()
+ {
+ $status = [];
+ $status[] = ['', G::LoadTranslation('ID_ALL')];
+ foreach (AppMessage::$app_msg_status_values as $key => $value) {
+ $status[] = [$value, G::LoadTranslation('ID_' . strtoupper($key))];
+ }
+
+ return $status;
+ }
+
+ /**
+ * Build the row for the message to be inserted
+ *
+ * @param string $msgUid,
+ * @param string $appUid,
+ * @param integer $delIndex,
+ * @param string $appMsgType,
+ * @param string $appMsgSubject,
+ * @param string $appMsgFrom,
+ * @param string $appMsgTo,
+ * @param string $appMsgBody,
+ * @param string $appMsgCc,
+ * @param string $appMsgBcc,
+ * @param string $appMsgTemplate,
+ * @param string $appMsgAttach,
+ * @param string $appMsgStatus,
+ * @param string $appMsgShowMsg,
+ * @param string $appMsgError,
+ * @param boolean $contentTypeIsHtml
+ * @param integer $appNumber,
+ * @param integer $proId,
+ * @param integer $tasId,
+ *
+ * @return array
+ */
+ public static function buildMessageRow(
+ $msgUid = '',
+ $appUid = '',
+ $delIndex = 0,
+ $appMsgType = '',
+ $appMsgSubject = '',
+ $appMsgFrom = '',
+ $appMsgTo = '',
+ $appMsgBody = '',
+ $appMsgCc = '',
+ $appMsgBcc = '',
+ $appMsgTemplate = '',
+ $appMsgAttach = '',
+ $appMsgStatus = 'pending',
+ $appMsgShowMsg = '',
+ $appMsgError = '',
+ $contentTypeIsHtml = true,
+ $appNumber = 0,
+ $proId = 0,
+ $tasId = 0
+ )
+ {
+ $message = [
+ "msg_uid" => $msgUid,
+ "app_uid" => $appUid,
+ "del_index" => $delIndex,
+ "app_msg_type" => $appMsgType,
+ "app_msg_type_id" => isset(AppMessage::$app_msg_type_values[$appMsgType]) ? AppMessage::$app_msg_type_values[$appMsgType] : 0,
+ "app_msg_subject" => $appMsgSubject,
+ "app_msg_from" => $appMsgFrom,
+ "app_msg_to" => $appMsgTo,
+ "app_msg_body" => $appMsgBody,
+ "app_msg_date" => '',
+ "app_msg_cc" => $appMsgCc,
+ "app_msg_bcc" => $appMsgBcc,
+ "app_msg_template" => $appMsgTemplate,
+ "app_msg_status" => $appMsgStatus,
+ "app_msg_status_id" => isset(AppMessage::$app_msg_status_values[$appMsgStatus]) ? AppMessage::$app_msg_status_values[$appMsgStatus] : 0,
+ "app_msg_attach" => $appMsgAttach,
+ "app_msg_send_date" => '',
+ "app_msg_show_message" => $appMsgShowMsg,
+ "app_msg_error" => $appMsgError,
+ "contentTypeIsHtml" => $contentTypeIsHtml,
+ "app_number" => $appNumber,
+ "pro_id" => $proId,
+ "tas_id" => $tasId
+ ];
+
+ return $message;
+ }
+
+ /**
+ * Get the initial criteria for the appMessage
+ *
+ * @param int $appNumber
+ * @param boolean $onlyVisible
+ *
+ * @return Criteria
+ */
+ public function getInitialCriteria($appNumber, $onlyVisible = true)
+ {
+ $criteria = new Criteria('workflow');
+ //Search by appNumber
+ $criteria->add(AppMessagePeer::APP_NUMBER, $appNumber);
+ //Visible: if the user can be resend the email
+ if ($onlyVisible) {
+ $criteria->add(AppMessagePeer::APP_MSG_SHOW_MESSAGE, 1);
+ }
+
+ return $criteria;
+ }
+
+ /**
+ * Returns the number of cases of a user
+ *
+ * @param int $appNumber
+ * @param boolean $onlyVisible
+ *
+ * @return int
+ */
+ public function getCountMessage($appNumber, $onlyVisible = true)
+ {
+ $criteria = $this->getInitialCriteria($appNumber, $onlyVisible);
+
+ return AppMessagePeer::doCount($criteria);
+ }
+
+ /**
+ * Get the data by appNumber
+ *
+ * @param int $appNumber
+ * @param boolean $onlyVisible
+ * @param integer $start
+ * @param integer $limit
+ * @param string $sort
+ * @param string $dir
+ *
+ * @return array
+ */
+ public function getDataMessage($appNumber, $onlyVisible = true, $start = null, $limit = null, $sort = null, $dir = 'DESC')
+ {
+ $criteria = $this->getInitialCriteria($appNumber, $onlyVisible);
+
+ if (empty($sort)) {
+ $sort = AppMessagePeer::APP_MSG_DATE;
+ }
+ if ($dir == 'DESC') {
+ $criteria->addDescendingOrderByColumn($sort);
+ } else {
+ $criteria->addAscendingOrderByColumn($sort);
+ }
+
+ if (!is_null($limit) && !is_null($start)) {
+ $criteria->setLimit($limit);
+ $criteria->setOffset($start);
+ }
+
+ $dataset = AppMessagePeer::doSelectRS($criteria);
+ $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
+ $dataset->next();
+ $messages = [];
+
+ while ($row = $dataset->getRow()) {
+ //Head for IE quirks mode
+ $row['APP_MSG_BODY'] = '' . $row['APP_MSG_BODY'];
+ $messages[] = $row;
+ $dataset->next();
+ }
+
+ return $messages;
+ }
}
diff --git a/workflow/engine/classes/model/AppNotes.php b/workflow/engine/classes/model/AppNotes.php
index d508b3258..57db63a23 100644
--- a/workflow/engine/classes/model/AppNotes.php
+++ b/workflow/engine/classes/model/AppNotes.php
@@ -145,73 +145,83 @@ class AppNotes extends BaseAppNotes
return $response;
}
- public function sendNoteNotification ($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom = "")
+ /**
+ * Case note notification
+ *
+ * @param string $appUid
+ * @param string $usrUid
+ * @param string $noteContent
+ * @param string $noteRecipients
+ * @param string $from
+ * @param integer $delIndex
+ *
+ * @throws Exception
+ */
+ public function sendNoteNotification ($appUid, $usrUid, $noteContent, $noteRecipients, $from = '', $delIndex = 0)
{
try {
- $aConfiguration = System::getEmailConfiguration();
+ $configuration = System::getEmailConfiguration();
$msgError = "";
- if (! isset( $aConfiguration['MESS_ENABLED'] ) || $aConfiguration['MESS_ENABLED'] != '1') {
+ if (! isset( $configuration['MESS_ENABLED'] ) || $configuration['MESS_ENABLED'] != '1') {
$msgError = "The default configuration wasn't defined";
- $aConfiguration['MESS_ENGINE'] = '';
+ $configuration['MESS_ENGINE'] = '';
}
- $oUser = new Users();
- $aUser = $oUser->load( $usrUid );
- $authorName = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
+ $users = new Users();
+ $userInfo = $users->load($usrUid);
+ $authorName = ((($userInfo['USR_FIRSTNAME'] != '') || ($userInfo['USR_LASTNAME'] != '')) ? $userInfo['USR_FIRSTNAME'] . ' ' . $userInfo['USR_LASTNAME'] . ' ' : '') . '<' . $userInfo['USR_EMAIL'] . '>';
- $oCase = new Cases();
- $aFields = $oCase->loadCase( $appUid );
- $configNoteNotification['subject'] = G::LoadTranslation( 'ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION' ) . " @#APP_TITLE ";
+ $cases = new Cases();
+ $fieldCase = $cases->loadCase($appUid, $delIndex);
+ $configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
//Define the body for the notification
- $body = G::LoadTranslation('ID_CASE_TITLE') . ": @#APP_TITLE
";
- $body .= G::LoadTranslation('ID_CASE_NUMBER') . ": @#APP_NUMBER
";
- $body .= G::LoadTranslation('ID_AUTHOR') . ": $authorName
$noteContent";
- $configNoteNotification['body'] = $body;
+ $configNoteNotification['body'] = $this->getBodyCaseNote($authorName, $noteContent);
+ $body = nl2br(G::replaceDataField($configNoteNotification['body'], $fieldCase));
- $sFrom = G::buildFrom($aConfiguration, $sFrom);
- $sSubject = G::replaceDataField( $configNoteNotification['subject'], $aFields );
- $sBody = nl2br( G::replaceDataField( $configNoteNotification['body'], $aFields ) );
-
- $oUser = new Users();
- $recipientsArray = explode( ",", $noteRecipients );
+ $users = new Users();
+ $recipientsArray = explode(",", $noteRecipients);
foreach ($recipientsArray as $recipientUid) {
+ $userInfo = $users->load($recipientUid);
+ $to = ((($userInfo['USR_FIRSTNAME'] != '') || ($userInfo['USR_LASTNAME'] != '')) ? $userInfo['USR_FIRSTNAME'] . ' ' . $userInfo['USR_LASTNAME'] . ' ' : '') . '<' . $userInfo['USR_EMAIL'] . '>';
- $aUser = $oUser->load( $recipientUid );
+ $spool = new SpoolRun();
+ $spool->setConfig($configuration);
+ $messageArray = AppMessage::buildMessageRow(
+ '',
+ $appUid,
+ $delIndex,
+ 'DERIVATION',
+ G::replaceDataField($configNoteNotification['subject'], $fieldCase),
+ G::buildFrom($configuration, $from),
+ $to,
+ $body,
+ '',
+ '',
+ '',
+ '',
+ 'pending',
+ '',
+ $msgError,
+ true,
+ (isset($fieldCase['APP_NUMBER'])) ? $fieldCase['APP_NUMBER'] : 0,
+ (isset($fieldCase['PRO_ID'])) ? $fieldCase['PRO_ID'] : 0,
+ (isset($fieldCase['TAS_ID'])) ? $fieldCase['TAS_ID'] : 0
+ );
+ $spool->create($messageArray);
- $sTo = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
- $oSpool = new SpoolRun();
-
- $oSpool->setConfig($aConfiguration);
- $oSpool->create(
- array ('msg_uid' => '',
- 'app_uid' => $appUid,
- 'del_index' => 0,
- 'app_msg_type' => 'DERIVATION',
- 'app_msg_subject' => $sSubject,
- 'app_msg_from' => $sFrom,
- 'app_msg_to' => $sTo,
- 'app_msg_body' => $sBody,
- 'app_msg_cc' => '',
- 'app_msg_bcc' => '',
- 'app_msg_attach' => '',
- 'app_msg_template' => '',
- 'app_msg_status' => 'pending',
- 'app_msg_error' => $msgError
- )
- );
if ($msgError == '') {
- if (($aConfiguration['MESS_BACKGROUND'] == '') || ($aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1')) {
- $oSpool->sendMail();
+ if (($configuration['MESS_BACKGROUND'] == '') || ($configuration['MESS_TRY_SEND_INMEDIATLY'] == '1')) {
+ $spool->sendMail();
}
}
}
//Send derivation notification - End
- } catch (Exception $oException) {
- throw $oException;
+ } catch (Exception $exception) {
+ throw $exception;
}
}
@@ -256,5 +266,22 @@ class AppNotes extends BaseAppNotes
return $notes;
}
+ /**
+ * Define the body for the case note notification
+ *
+ * @param string $authorName
+ * @param string $noteContent
+ *
+ * @return string
+ */
+ private function getBodyCaseNote($authorName = '', $noteContent = '')
+ {
+ $body = G::LoadTranslation('ID_CASE_TITLE') . ': @#APP_TITLE
';
+ $body .= G::LoadTranslation('ID_CASE_NUMBER') . ': @#APP_NUMBER
';
+ $body .= G::LoadTranslation('ID_AUTHOR') . ': ' . $authorName . '
' . $noteContent;
+
+ return $body;
+ }
+
}
diff --git a/workflow/engine/classes/model/map/AppMessageMapBuilder.php b/workflow/engine/classes/model/map/AppMessageMapBuilder.php
index 652625003..ea2715edd 100644
--- a/workflow/engine/classes/model/map/AppMessageMapBuilder.php
+++ b/workflow/engine/classes/model/map/AppMessageMapBuilder.php
@@ -75,6 +75,8 @@ class AppMessageMapBuilder
$tMap->addColumn('APP_MSG_TYPE', 'AppMsgType', 'string', CreoleTypes::VARCHAR, true, 100);
+ $tMap->addColumn('APP_MSG_TYPE_ID', 'AppMsgTypeId', 'int', CreoleTypes::TINYINT, false, null);
+
$tMap->addColumn('APP_MSG_SUBJECT', 'AppMsgSubject', 'string', CreoleTypes::VARCHAR, true, 150);
$tMap->addColumn('APP_MSG_FROM', 'AppMsgFrom', 'string', CreoleTypes::VARCHAR, true, 100);
@@ -93,6 +95,8 @@ class AppMessageMapBuilder
$tMap->addColumn('APP_MSG_STATUS', 'AppMsgStatus', 'string', CreoleTypes::VARCHAR, false, 20);
+ $tMap->addColumn('APP_MSG_STATUS_ID', 'AppMsgStatusId', 'int', CreoleTypes::TINYINT, false, null);
+
$tMap->addColumn('APP_MSG_ATTACH', 'AppMsgAttach', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('APP_MSG_SEND_DATE', 'AppMsgSendDate', 'int', CreoleTypes::TIMESTAMP, true, null);
@@ -101,6 +105,8 @@ class AppMessageMapBuilder
$tMap->addColumn('APP_MSG_ERROR', 'AppMsgError', 'string', CreoleTypes::LONGVARCHAR, false, null);
+ $tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
+
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
diff --git a/workflow/engine/classes/model/om/BaseAppMessage.php b/workflow/engine/classes/model/om/BaseAppMessage.php
index bf3db32d6..79c96dd13 100644
--- a/workflow/engine/classes/model/om/BaseAppMessage.php
+++ b/workflow/engine/classes/model/om/BaseAppMessage.php
@@ -57,6 +57,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
*/
protected $app_msg_type = '';
+ /**
+ * The value for the app_msg_type_id field.
+ * @var int
+ */
+ protected $app_msg_type_id = 0;
+
/**
* The value for the app_msg_subject field.
* @var string
@@ -111,6 +117,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
*/
protected $app_msg_status;
+ /**
+ * The value for the app_msg_status_id field.
+ * @var int
+ */
+ protected $app_msg_status_id = 0;
+
/**
* The value for the app_msg_attach field.
* @var string
@@ -135,6 +147,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
*/
protected $app_msg_error;
+ /**
+ * The value for the pro_id field.
+ * @var int
+ */
+ protected $pro_id = 0;
+
/**
* The value for the tas_id field.
* @var int
@@ -216,6 +234,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
return $this->app_msg_type;
}
+ /**
+ * Get the [app_msg_type_id] column value.
+ *
+ * @return int
+ */
+ public function getAppMsgTypeId()
+ {
+
+ return $this->app_msg_type_id;
+ }
+
/**
* Get the [app_msg_subject] column value.
*
@@ -336,6 +365,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
return $this->app_msg_status;
}
+ /**
+ * Get the [app_msg_status_id] column value.
+ *
+ * @return int
+ */
+ public function getAppMsgStatusId()
+ {
+
+ return $this->app_msg_status_id;
+ }
+
/**
* Get the [app_msg_attach] column value.
*
@@ -401,6 +441,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
return $this->app_msg_error;
}
+ /**
+ * Get the [pro_id] column value.
+ *
+ * @return int
+ */
+ public function getProId()
+ {
+
+ return $this->pro_id;
+ }
+
/**
* Get the [tas_id] column value.
*
@@ -533,6 +584,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
} // setAppMsgType()
+ /**
+ * Set the value of [app_msg_type_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppMsgTypeId($v)
+ {
+
+ // Since the native PHP type for this column is integer,
+ // we will cast the input value to an int (if it is not).
+ if ($v !== null && !is_int($v) && is_numeric($v)) {
+ $v = (int) $v;
+ }
+
+ if ($this->app_msg_type_id !== $v || $v === 0) {
+ $this->app_msg_type_id = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_TYPE_ID;
+ }
+
+ } // setAppMsgTypeId()
+
/**
* Set the value of [app_msg_subject] column.
*
@@ -738,6 +811,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
} // setAppMsgStatus()
+ /**
+ * Set the value of [app_msg_status_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setAppMsgStatusId($v)
+ {
+
+ // Since the native PHP type for this column is integer,
+ // we will cast the input value to an int (if it is not).
+ if ($v !== null && !is_int($v) && is_numeric($v)) {
+ $v = (int) $v;
+ }
+
+ if ($this->app_msg_status_id !== $v || $v === 0) {
+ $this->app_msg_status_id = $v;
+ $this->modifiedColumns[] = AppMessagePeer::APP_MSG_STATUS_ID;
+ }
+
+ } // setAppMsgStatusId()
+
/**
* Set the value of [app_msg_attach] column.
*
@@ -833,6 +928,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
} // setAppMsgError()
+ /**
+ * Set the value of [pro_id] column.
+ *
+ * @param int $v new value
+ * @return void
+ */
+ public function setProId($v)
+ {
+
+ // Since the native PHP type for this column is integer,
+ // we will cast the input value to an int (if it is not).
+ if ($v !== null && !is_int($v) && is_numeric($v)) {
+ $v = (int) $v;
+ }
+
+ if ($this->pro_id !== $v || $v === 0) {
+ $this->pro_id = $v;
+ $this->modifiedColumns[] = AppMessagePeer::PRO_ID;
+ }
+
+ } // setProId()
+
/**
* Set the value of [tas_id] column.
*
@@ -904,42 +1021,48 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$this->app_msg_type = $rs->getString($startcol + 4);
- $this->app_msg_subject = $rs->getString($startcol + 5);
+ $this->app_msg_type_id = $rs->getInt($startcol + 5);
- $this->app_msg_from = $rs->getString($startcol + 6);
+ $this->app_msg_subject = $rs->getString($startcol + 6);
- $this->app_msg_to = $rs->getString($startcol + 7);
+ $this->app_msg_from = $rs->getString($startcol + 7);
- $this->app_msg_body = $rs->getString($startcol + 8);
+ $this->app_msg_to = $rs->getString($startcol + 8);
- $this->app_msg_date = $rs->getTimestamp($startcol + 9, null);
+ $this->app_msg_body = $rs->getString($startcol + 9);
- $this->app_msg_cc = $rs->getString($startcol + 10);
+ $this->app_msg_date = $rs->getTimestamp($startcol + 10, null);
- $this->app_msg_bcc = $rs->getString($startcol + 11);
+ $this->app_msg_cc = $rs->getString($startcol + 11);
- $this->app_msg_template = $rs->getString($startcol + 12);
+ $this->app_msg_bcc = $rs->getString($startcol + 12);
- $this->app_msg_status = $rs->getString($startcol + 13);
+ $this->app_msg_template = $rs->getString($startcol + 13);
- $this->app_msg_attach = $rs->getString($startcol + 14);
+ $this->app_msg_status = $rs->getString($startcol + 14);
- $this->app_msg_send_date = $rs->getTimestamp($startcol + 15, null);
+ $this->app_msg_status_id = $rs->getInt($startcol + 15);
- $this->app_msg_show_message = $rs->getInt($startcol + 16);
+ $this->app_msg_attach = $rs->getString($startcol + 16);
- $this->app_msg_error = $rs->getString($startcol + 17);
+ $this->app_msg_send_date = $rs->getTimestamp($startcol + 17, null);
- $this->tas_id = $rs->getInt($startcol + 18);
+ $this->app_msg_show_message = $rs->getInt($startcol + 18);
- $this->app_number = $rs->getInt($startcol + 19);
+ $this->app_msg_error = $rs->getString($startcol + 19);
+
+ $this->pro_id = $rs->getInt($startcol + 20);
+
+ $this->tas_id = $rs->getInt($startcol + 21);
+
+ $this->app_number = $rs->getInt($startcol + 22);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
- return $startcol + 20; // 20 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
+ return $startcol + 23; // 23 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating AppMessage object", $e);
@@ -1159,48 +1282,57 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
return $this->getAppMsgType();
break;
case 5:
- return $this->getAppMsgSubject();
+ return $this->getAppMsgTypeId();
break;
case 6:
- return $this->getAppMsgFrom();
+ return $this->getAppMsgSubject();
break;
case 7:
- return $this->getAppMsgTo();
+ return $this->getAppMsgFrom();
break;
case 8:
- return $this->getAppMsgBody();
+ return $this->getAppMsgTo();
break;
case 9:
- return $this->getAppMsgDate();
+ return $this->getAppMsgBody();
break;
case 10:
- return $this->getAppMsgCc();
+ return $this->getAppMsgDate();
break;
case 11:
- return $this->getAppMsgBcc();
+ return $this->getAppMsgCc();
break;
case 12:
- return $this->getAppMsgTemplate();
+ return $this->getAppMsgBcc();
break;
case 13:
- return $this->getAppMsgStatus();
+ return $this->getAppMsgTemplate();
break;
case 14:
- return $this->getAppMsgAttach();
+ return $this->getAppMsgStatus();
break;
case 15:
- return $this->getAppMsgSendDate();
+ return $this->getAppMsgStatusId();
break;
case 16:
- return $this->getAppMsgShowMessage();
+ return $this->getAppMsgAttach();
break;
case 17:
- return $this->getAppMsgError();
+ return $this->getAppMsgSendDate();
break;
case 18:
- return $this->getTasId();
+ return $this->getAppMsgShowMessage();
break;
case 19:
+ return $this->getAppMsgError();
+ break;
+ case 20:
+ return $this->getProId();
+ break;
+ case 21:
+ return $this->getTasId();
+ break;
+ case 22:
return $this->getAppNumber();
break;
default:
@@ -1228,21 +1360,24 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$keys[2] => $this->getAppUid(),
$keys[3] => $this->getDelIndex(),
$keys[4] => $this->getAppMsgType(),
- $keys[5] => $this->getAppMsgSubject(),
- $keys[6] => $this->getAppMsgFrom(),
- $keys[7] => $this->getAppMsgTo(),
- $keys[8] => $this->getAppMsgBody(),
- $keys[9] => $this->getAppMsgDate(),
- $keys[10] => $this->getAppMsgCc(),
- $keys[11] => $this->getAppMsgBcc(),
- $keys[12] => $this->getAppMsgTemplate(),
- $keys[13] => $this->getAppMsgStatus(),
- $keys[14] => $this->getAppMsgAttach(),
- $keys[15] => $this->getAppMsgSendDate(),
- $keys[16] => $this->getAppMsgShowMessage(),
- $keys[17] => $this->getAppMsgError(),
- $keys[18] => $this->getTasId(),
- $keys[19] => $this->getAppNumber(),
+ $keys[5] => $this->getAppMsgTypeId(),
+ $keys[6] => $this->getAppMsgSubject(),
+ $keys[7] => $this->getAppMsgFrom(),
+ $keys[8] => $this->getAppMsgTo(),
+ $keys[9] => $this->getAppMsgBody(),
+ $keys[10] => $this->getAppMsgDate(),
+ $keys[11] => $this->getAppMsgCc(),
+ $keys[12] => $this->getAppMsgBcc(),
+ $keys[13] => $this->getAppMsgTemplate(),
+ $keys[14] => $this->getAppMsgStatus(),
+ $keys[15] => $this->getAppMsgStatusId(),
+ $keys[16] => $this->getAppMsgAttach(),
+ $keys[17] => $this->getAppMsgSendDate(),
+ $keys[18] => $this->getAppMsgShowMessage(),
+ $keys[19] => $this->getAppMsgError(),
+ $keys[20] => $this->getProId(),
+ $keys[21] => $this->getTasId(),
+ $keys[22] => $this->getAppNumber(),
);
return $result;
}
@@ -1290,48 +1425,57 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$this->setAppMsgType($value);
break;
case 5:
- $this->setAppMsgSubject($value);
+ $this->setAppMsgTypeId($value);
break;
case 6:
- $this->setAppMsgFrom($value);
+ $this->setAppMsgSubject($value);
break;
case 7:
- $this->setAppMsgTo($value);
+ $this->setAppMsgFrom($value);
break;
case 8:
- $this->setAppMsgBody($value);
+ $this->setAppMsgTo($value);
break;
case 9:
- $this->setAppMsgDate($value);
+ $this->setAppMsgBody($value);
break;
case 10:
- $this->setAppMsgCc($value);
+ $this->setAppMsgDate($value);
break;
case 11:
- $this->setAppMsgBcc($value);
+ $this->setAppMsgCc($value);
break;
case 12:
- $this->setAppMsgTemplate($value);
+ $this->setAppMsgBcc($value);
break;
case 13:
- $this->setAppMsgStatus($value);
+ $this->setAppMsgTemplate($value);
break;
case 14:
- $this->setAppMsgAttach($value);
+ $this->setAppMsgStatus($value);
break;
case 15:
- $this->setAppMsgSendDate($value);
+ $this->setAppMsgStatusId($value);
break;
case 16:
- $this->setAppMsgShowMessage($value);
+ $this->setAppMsgAttach($value);
break;
case 17:
- $this->setAppMsgError($value);
+ $this->setAppMsgSendDate($value);
break;
case 18:
- $this->setTasId($value);
+ $this->setAppMsgShowMessage($value);
break;
case 19:
+ $this->setAppMsgError($value);
+ break;
+ case 20:
+ $this->setProId($value);
+ break;
+ case 21:
+ $this->setTasId($value);
+ break;
+ case 22:
$this->setAppNumber($value);
break;
} // switch()
@@ -1378,63 +1522,75 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
}
if (array_key_exists($keys[5], $arr)) {
- $this->setAppMsgSubject($arr[$keys[5]]);
+ $this->setAppMsgTypeId($arr[$keys[5]]);
}
if (array_key_exists($keys[6], $arr)) {
- $this->setAppMsgFrom($arr[$keys[6]]);
+ $this->setAppMsgSubject($arr[$keys[6]]);
}
if (array_key_exists($keys[7], $arr)) {
- $this->setAppMsgTo($arr[$keys[7]]);
+ $this->setAppMsgFrom($arr[$keys[7]]);
}
if (array_key_exists($keys[8], $arr)) {
- $this->setAppMsgBody($arr[$keys[8]]);
+ $this->setAppMsgTo($arr[$keys[8]]);
}
if (array_key_exists($keys[9], $arr)) {
- $this->setAppMsgDate($arr[$keys[9]]);
+ $this->setAppMsgBody($arr[$keys[9]]);
}
if (array_key_exists($keys[10], $arr)) {
- $this->setAppMsgCc($arr[$keys[10]]);
+ $this->setAppMsgDate($arr[$keys[10]]);
}
if (array_key_exists($keys[11], $arr)) {
- $this->setAppMsgBcc($arr[$keys[11]]);
+ $this->setAppMsgCc($arr[$keys[11]]);
}
if (array_key_exists($keys[12], $arr)) {
- $this->setAppMsgTemplate($arr[$keys[12]]);
+ $this->setAppMsgBcc($arr[$keys[12]]);
}
if (array_key_exists($keys[13], $arr)) {
- $this->setAppMsgStatus($arr[$keys[13]]);
+ $this->setAppMsgTemplate($arr[$keys[13]]);
}
if (array_key_exists($keys[14], $arr)) {
- $this->setAppMsgAttach($arr[$keys[14]]);
+ $this->setAppMsgStatus($arr[$keys[14]]);
}
if (array_key_exists($keys[15], $arr)) {
- $this->setAppMsgSendDate($arr[$keys[15]]);
+ $this->setAppMsgStatusId($arr[$keys[15]]);
}
if (array_key_exists($keys[16], $arr)) {
- $this->setAppMsgShowMessage($arr[$keys[16]]);
+ $this->setAppMsgAttach($arr[$keys[16]]);
}
if (array_key_exists($keys[17], $arr)) {
- $this->setAppMsgError($arr[$keys[17]]);
+ $this->setAppMsgSendDate($arr[$keys[17]]);
}
if (array_key_exists($keys[18], $arr)) {
- $this->setTasId($arr[$keys[18]]);
+ $this->setAppMsgShowMessage($arr[$keys[18]]);
}
if (array_key_exists($keys[19], $arr)) {
- $this->setAppNumber($arr[$keys[19]]);
+ $this->setAppMsgError($arr[$keys[19]]);
+ }
+
+ if (array_key_exists($keys[20], $arr)) {
+ $this->setProId($arr[$keys[20]]);
+ }
+
+ if (array_key_exists($keys[21], $arr)) {
+ $this->setTasId($arr[$keys[21]]);
+ }
+
+ if (array_key_exists($keys[22], $arr)) {
+ $this->setAppNumber($arr[$keys[22]]);
}
}
@@ -1468,6 +1624,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$criteria->add(AppMessagePeer::APP_MSG_TYPE, $this->app_msg_type);
}
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_TYPE_ID)) {
+ $criteria->add(AppMessagePeer::APP_MSG_TYPE_ID, $this->app_msg_type_id);
+ }
+
if ($this->isColumnModified(AppMessagePeer::APP_MSG_SUBJECT)) {
$criteria->add(AppMessagePeer::APP_MSG_SUBJECT, $this->app_msg_subject);
}
@@ -1504,6 +1664,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$criteria->add(AppMessagePeer::APP_MSG_STATUS, $this->app_msg_status);
}
+ if ($this->isColumnModified(AppMessagePeer::APP_MSG_STATUS_ID)) {
+ $criteria->add(AppMessagePeer::APP_MSG_STATUS_ID, $this->app_msg_status_id);
+ }
+
if ($this->isColumnModified(AppMessagePeer::APP_MSG_ATTACH)) {
$criteria->add(AppMessagePeer::APP_MSG_ATTACH, $this->app_msg_attach);
}
@@ -1520,6 +1684,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$criteria->add(AppMessagePeer::APP_MSG_ERROR, $this->app_msg_error);
}
+ if ($this->isColumnModified(AppMessagePeer::PRO_ID)) {
+ $criteria->add(AppMessagePeer::PRO_ID, $this->pro_id);
+ }
+
if ($this->isColumnModified(AppMessagePeer::TAS_ID)) {
$criteria->add(AppMessagePeer::TAS_ID, $this->tas_id);
}
@@ -1590,6 +1758,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$copyObj->setAppMsgType($this->app_msg_type);
+ $copyObj->setAppMsgTypeId($this->app_msg_type_id);
+
$copyObj->setAppMsgSubject($this->app_msg_subject);
$copyObj->setAppMsgFrom($this->app_msg_from);
@@ -1608,6 +1778,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$copyObj->setAppMsgStatus($this->app_msg_status);
+ $copyObj->setAppMsgStatusId($this->app_msg_status_id);
+
$copyObj->setAppMsgAttach($this->app_msg_attach);
$copyObj->setAppMsgSendDate($this->app_msg_send_date);
@@ -1616,6 +1788,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$copyObj->setAppMsgError($this->app_msg_error);
+ $copyObj->setProId($this->pro_id);
+
$copyObj->setTasId($this->tas_id);
$copyObj->setAppNumber($this->app_number);
diff --git a/workflow/engine/classes/model/om/BaseAppMessagePeer.php b/workflow/engine/classes/model/om/BaseAppMessagePeer.php
index 19ff318d8..749b74386 100644
--- a/workflow/engine/classes/model/om/BaseAppMessagePeer.php
+++ b/workflow/engine/classes/model/om/BaseAppMessagePeer.php
@@ -25,7 +25,7 @@ abstract class BaseAppMessagePeer
const CLASS_DEFAULT = 'classes.model.AppMessage';
/** The total number of columns. */
- const NUM_COLUMNS = 20;
+ const NUM_COLUMNS = 23;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -46,6 +46,9 @@ abstract class BaseAppMessagePeer
/** the column name for the APP_MSG_TYPE field */
const APP_MSG_TYPE = 'APP_MESSAGE.APP_MSG_TYPE';
+ /** the column name for the APP_MSG_TYPE_ID field */
+ const APP_MSG_TYPE_ID = 'APP_MESSAGE.APP_MSG_TYPE_ID';
+
/** the column name for the APP_MSG_SUBJECT field */
const APP_MSG_SUBJECT = 'APP_MESSAGE.APP_MSG_SUBJECT';
@@ -73,6 +76,9 @@ abstract class BaseAppMessagePeer
/** the column name for the APP_MSG_STATUS field */
const APP_MSG_STATUS = 'APP_MESSAGE.APP_MSG_STATUS';
+ /** the column name for the APP_MSG_STATUS_ID field */
+ const APP_MSG_STATUS_ID = 'APP_MESSAGE.APP_MSG_STATUS_ID';
+
/** the column name for the APP_MSG_ATTACH field */
const APP_MSG_ATTACH = 'APP_MESSAGE.APP_MSG_ATTACH';
@@ -85,6 +91,9 @@ abstract class BaseAppMessagePeer
/** the column name for the APP_MSG_ERROR field */
const APP_MSG_ERROR = 'APP_MESSAGE.APP_MSG_ERROR';
+ /** the column name for the PRO_ID field */
+ const PRO_ID = 'APP_MESSAGE.PRO_ID';
+
/** the column name for the TAS_ID field */
const TAS_ID = 'APP_MESSAGE.TAS_ID';
@@ -102,10 +111,10 @@ abstract class BaseAppMessagePeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
- BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', 'AppMsgShowMessage', 'AppMsgError', 'TasId', 'AppNumber', ),
- BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, AppMessagePeer::APP_MSG_SHOW_MESSAGE, AppMessagePeer::APP_MSG_ERROR, AppMessagePeer::TAS_ID, AppMessagePeer::APP_NUMBER, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', 'APP_MSG_SHOW_MESSAGE', 'APP_MSG_ERROR', 'TAS_ID', 'APP_NUMBER', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
+ BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgTypeId', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgStatusId', 'AppMsgAttach', 'AppMsgSendDate', 'AppMsgShowMessage', 'AppMsgError', 'ProId', 'TasId', 'AppNumber', ),
+ BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_TYPE_ID, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_STATUS_ID, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, AppMessagePeer::APP_MSG_SHOW_MESSAGE, AppMessagePeer::APP_MSG_ERROR, AppMessagePeer::PRO_ID, AppMessagePeer::TAS_ID, AppMessagePeer::APP_NUMBER, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_TYPE_ID', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_STATUS_ID', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', 'APP_MSG_SHOW_MESSAGE', 'APP_MSG_ERROR', 'PRO_ID', 'TAS_ID', 'APP_NUMBER', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
@@ -115,10 +124,10 @@ abstract class BaseAppMessagePeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, 'AppMsgShowMessage' => 16, 'AppMsgError' => 17, 'TasId' => 18, 'AppNumber' => 19, ),
- BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, AppMessagePeer::APP_MSG_SHOW_MESSAGE => 16, AppMessagePeer::APP_MSG_ERROR => 17, AppMessagePeer::TAS_ID => 18, AppMessagePeer::APP_NUMBER => 19, ),
- BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, 'APP_MSG_SHOW_MESSAGE' => 16, 'APP_MSG_ERROR' => 17, 'TAS_ID' => 18, 'APP_NUMBER' => 19, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
+ BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgTypeId' => 5, 'AppMsgSubject' => 6, 'AppMsgFrom' => 7, 'AppMsgTo' => 8, 'AppMsgBody' => 9, 'AppMsgDate' => 10, 'AppMsgCc' => 11, 'AppMsgBcc' => 12, 'AppMsgTemplate' => 13, 'AppMsgStatus' => 14, 'AppMsgStatusId' => 15, 'AppMsgAttach' => 16, 'AppMsgSendDate' => 17, 'AppMsgShowMessage' => 18, 'AppMsgError' => 19, 'ProId' => 20, 'TasId' => 21, 'AppNumber' => 22, ),
+ BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_TYPE_ID => 5, AppMessagePeer::APP_MSG_SUBJECT => 6, AppMessagePeer::APP_MSG_FROM => 7, AppMessagePeer::APP_MSG_TO => 8, AppMessagePeer::APP_MSG_BODY => 9, AppMessagePeer::APP_MSG_DATE => 10, AppMessagePeer::APP_MSG_CC => 11, AppMessagePeer::APP_MSG_BCC => 12, AppMessagePeer::APP_MSG_TEMPLATE => 13, AppMessagePeer::APP_MSG_STATUS => 14, AppMessagePeer::APP_MSG_STATUS_ID => 15, AppMessagePeer::APP_MSG_ATTACH => 16, AppMessagePeer::APP_MSG_SEND_DATE => 17, AppMessagePeer::APP_MSG_SHOW_MESSAGE => 18, AppMessagePeer::APP_MSG_ERROR => 19, AppMessagePeer::PRO_ID => 20, AppMessagePeer::TAS_ID => 21, AppMessagePeer::APP_NUMBER => 22, ),
+ BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_TYPE_ID' => 5, 'APP_MSG_SUBJECT' => 6, 'APP_MSG_FROM' => 7, 'APP_MSG_TO' => 8, 'APP_MSG_BODY' => 9, 'APP_MSG_DATE' => 10, 'APP_MSG_CC' => 11, 'APP_MSG_BCC' => 12, 'APP_MSG_TEMPLATE' => 13, 'APP_MSG_STATUS' => 14, 'APP_MSG_STATUS_ID' => 15, 'APP_MSG_ATTACH' => 16, 'APP_MSG_SEND_DATE' => 17, 'APP_MSG_SHOW_MESSAGE' => 18, 'APP_MSG_ERROR' => 19, 'PRO_ID' => 20, 'TAS_ID' => 21, 'APP_NUMBER' => 22, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
@@ -229,6 +238,8 @@ abstract class BaseAppMessagePeer
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE_ID);
+
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
@@ -247,6 +258,8 @@ abstract class BaseAppMessagePeer
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
+ $criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS_ID);
+
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ATTACH);
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
@@ -255,6 +268,8 @@ abstract class BaseAppMessagePeer
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ERROR);
+ $criteria->addSelectColumn(AppMessagePeer::PRO_ID);
+
$criteria->addSelectColumn(AppMessagePeer::TAS_ID);
$criteria->addSelectColumn(AppMessagePeer::APP_NUMBER);
diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml
index de8b227f4..4057cef30 100644
--- a/workflow/engine/config/schema.xml
+++ b/workflow/engine/config/schema.xml
@@ -337,6 +337,7 @@
+
@@ -346,10 +347,12 @@
+
+
@@ -358,12 +361,21 @@
+
+
+
+
+
+
+
+
+
diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php
index 6abb476af..ffd25c19b 100644
--- a/workflow/engine/controllers/adminProxy.php
+++ b/workflow/engine/controllers/adminProxy.php
@@ -582,7 +582,7 @@ class adminProxy extends HttpProxyController
{
global $G_PUBLISH;
- $aConfiguration = array(
+ $configuration = [
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
'MESS_SERVER' => $_POST['MESS_SERVER'],
'MESS_PORT' => $_POST['MESS_PORT'],
@@ -592,12 +592,11 @@ class adminProxy extends HttpProxyController
'MESS_FROM_MAIL' => $_POST["FROM_EMAIL"],
'MESS_RAUTH' => $_POST['MESS_RAUTH'],
'SMTPSecure' => isset($_POST['SMTPSecure'])?$_POST['SMTPSecure']:'none'
- );
+ ];
- $sFrom = G::buildFrom($aConfiguration);
-
- $sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
- $msg = G::LoadTranslation('ID_MESS_TEST_BODY');
+ $from = G::buildFrom($configuration);
+ $subject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
+ $msg = G::LoadTranslation('ID_MESS_TEST_BODY');
switch ($_POST['MESS_ENGINE']) {
case 'MAIL':
@@ -611,50 +610,46 @@ class adminProxy extends HttpProxyController
break;
}
- $sBodyPre = new TemplatePower(PATH_TPL . 'admin' . PATH_SEP . 'email.tpl');
+ $sBodyPre = new TemplatePower(PATH_TPL . 'admin' . PATH_SEP . 'email.tpl');
$sBodyPre->prepare();
$sBodyPre->assign('server', $_SERVER['SERVER_NAME']);
$sBodyPre->assign('date', date('H:i:s'));
$sBodyPre->assign('ver', System::getVersion());
$sBodyPre->assign('engine', $engine);
$sBodyPre->assign('msg', $msg);
- $sBody = $sBodyPre->getOutputContent();
+ $body = $sBodyPre->getOutputContent();
- $oSpool = new SpoolRun();
-
- $oSpool->setConfig($aConfiguration);
-
- $oSpool->create(
- array(
- 'msg_uid' => '',
- 'app_uid' => '',
- 'del_index' => 0,
- 'app_msg_type' => 'TEST',
- 'app_msg_subject' => $sSubject,
- 'app_msg_from' => $sFrom,
- 'app_msg_to' => $_POST['TO'],
- 'app_msg_body' => $sBody,
- 'app_msg_cc' => '',
- 'app_msg_bcc' => '',
- 'app_msg_attach' => '',
- 'app_msg_template' => '',
- 'app_msg_status' => 'pending',
- 'app_msg_attach'=>'' // Added By Ankit
- )
+ $spool = new SpoolRun();
+ $spool->setConfig($configuration);
+ $messageArray = AppMessage::buildMessageRow(
+ '',
+ '',
+ '',
+ 'TEST',
+ $subject,
+ $from,
+ $_POST['TO'],
+ $body,
+ '',
+ '',
+ '',
+ '',
+ 'pending'
);
+ $spool->create($messageArray);
- $oSpool->sendMail();
+ $spool->sendMail();
$G_PUBLISH = new Publisher();
$o = new stdclass();
- if ($oSpool->status == 'sent') {
+ if ($spool->status == 'sent') {
$o->status = true;
$o->success = true;
$o->msg = G::LoadTranslation('ID_MAIL_TEST_SUCCESS');
} else {
$o->status = false;
$o->success = false;
- $o->msg = $oSpool->error;
+ $o->msg = $spool->error;
}
return $o;
}
diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql
index 80e48a228..3804849f8 100644
--- a/workflow/engine/data/mysql/schema.sql
+++ b/workflow/engine/data/mysql/schema.sql
@@ -150,6 +150,7 @@ CREATE TABLE `APP_MESSAGE`
`APP_UID` VARCHAR(32) default '' NOT NULL,
`DEL_INDEX` INTEGER default 0 NOT NULL,
`APP_MSG_TYPE` VARCHAR(100) default '' NOT NULL,
+ `APP_MSG_TYPE_ID` TINYINT default 0,
`APP_MSG_SUBJECT` VARCHAR(150) default '' NOT NULL,
`APP_MSG_FROM` VARCHAR(100) default '' NOT NULL,
`APP_MSG_TO` MEDIUMTEXT NOT NULL,
@@ -159,17 +160,22 @@ CREATE TABLE `APP_MESSAGE`
`APP_MSG_BCC` MEDIUMTEXT,
`APP_MSG_TEMPLATE` MEDIUMTEXT,
`APP_MSG_STATUS` VARCHAR(20),
+ `APP_MSG_STATUS_ID` TINYINT default 0,
`APP_MSG_ATTACH` MEDIUMTEXT,
`APP_MSG_SEND_DATE` DATETIME NOT NULL,
`APP_MSG_SHOW_MESSAGE` TINYINT default 1 NOT NULL,
`APP_MSG_ERROR` MEDIUMTEXT,
+ `PRO_ID` INTEGER default 0,
`TAS_ID` INTEGER default 0,
`APP_NUMBER` INTEGER default 0,
PRIMARY KEY (`APP_MSG_UID`),
KEY `indexForAppUid`(`APP_UID`),
KEY `indexForMsgStatus`(`APP_MSG_STATUS`),
+ KEY `INDEX_PRO_ID`(`PRO_ID`),
KEY `INDEX_TAS_ID`(`TAS_ID`),
- KEY `INDEX_APP_NUMBER`(`APP_NUMBER`)
+ KEY `INDEX_APP_NUMBER`(`APP_NUMBER`),
+ KEY `INDEX_APP_MSG_TYPE_ID`(`APP_MSG_STATUS_ID`),
+ KEY `INDEX_APP_MSG_STATUS_ID`(`APP_MSG_STATUS_ID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Messages in an Application';
#-----------------------------------------------------------------------------
#-- APP_OWNER
diff --git a/workflow/engine/methods/cases/caseMessageHistory_Ajax.php b/workflow/engine/methods/cases/caseMessageHistory_Ajax.php
index 8ed713a92..c86c3dd2e 100644
--- a/workflow/engine/methods/cases/caseMessageHistory_Ajax.php
+++ b/workflow/engine/methods/cases/caseMessageHistory_Ajax.php
@@ -15,32 +15,30 @@ $actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
switch ($actionAjax) {
case 'messageHistoryGridList_JXP':
- if (!isset($_REQUEST['start']) || $_REQUEST['start'] == '') {
- $_REQUEST['start'] = 0;
- }
-
- if (!isset($_REQUEST['limit']) || $_REQUEST['limit'] == '') {
- $_REQUEST['limit'] = 20;
- }
-
- $dir = isset($_POST['dir']) ? $_POST['dir'] : 'ASC';
+ $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
+ $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
+ $dir = isset($_POST['dir']) ? $_POST['dir'] : 'DESC';
$sort = isset($_POST['sort']) ? $_POST['sort'] : '';
global $G_PUBLISH;
$case = new Cases();
- $case->dir = $dir;
- $case->sort = $sort;
-
- $appMessageArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true, $_REQUEST['start'], $_REQUEST['limit']);
- $appMessageCountArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true);
- $result = new stdClass();
- $process = [];
-
-
$proUid = $_SESSION['PROCESS'];
$appUid = $_SESSION['APPLICATION'];
$tasUid = $_SESSION['TASK'];
$usrUid = $_SESSION['USER_LOGGED'];
+ $caseData = $case->loadCase($appUid);
+ $appNumber = $caseData['APP_DATA']['APP_NUMBER'];
+
+ $appMessage = new AppMessage();
+ $appMessageArray = $appMessage->getDataMessage(
+ $appNumber,
+ true,
+ $start,
+ $limit,
+ $sort,
+ $dir
+ );
+ $totalCount = $appMessage->getCountMessage($appNumber);
$respBlock = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'BLOCK');
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
@@ -70,37 +68,31 @@ switch ($actionAjax) {
}
}
- $totalCount = 0;
- foreach ($appMessageArray as $index => $value) {
- if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK') &&
- ($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex))) {
+ $messageList = [];
+ foreach ($appMessageArray as $index => &$value) {
+ if (
+ ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK')
+ &&
+ (
+ $appMessageArray[$index]['DEL_INDEX'] == 0
+ || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex)
+ )
+ ) {
+ //Define the label with translation
+ $value['APP_MSG_TYPE'] = !empty($arrayToTranslation[$value['APP_MSG_TYPE']]) ? $arrayToTranslation[$value['APP_MSG_TYPE']] : $value['APP_MSG_TYPE'];
+
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
if ($respMess == 'BLOCK' || $respMess == '') {
$appMessageArray[$index]['APP_MSG_BODY'] = '';
}
- $process[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
- $totalCount++;
+ $messageList[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
}
}
- $process = array_splice($process, $_REQUEST['start'], $_REQUEST['limit']);
-
$response = new stdclass();
- $response->data = $process;
+ $response->data = $messageList;
$response->totalCount = $totalCount;
- if (!empty($process)) {
- if (!isset($response->data[0])) {
- $response->data[0] = array('APP_MSG_TYPE' => '');
- }
-
- foreach ($response->data as $key => $value) {
- $response->data[$key]['APP_MSG_TYPE'] = array_key_exists($response->data[$key]['APP_MSG_TYPE'], $arrayToTranslation) ?
- $arrayToTranslation[$response->data[$key]['APP_MSG_TYPE']] :
- $response->data[$key]['APP_MSG_TYPE'];
- }
- }
-
echo G::json_encode($response);
break;
case 'showHistoryMessage':
diff --git a/workflow/engine/methods/cases/cases_Derivate.php b/workflow/engine/methods/cases/cases_Derivate.php
index ae6fbff44..85202a9f5 100644
--- a/workflow/engine/methods/cases/cases_Derivate.php
+++ b/workflow/engine/methods/cases/cases_Derivate.php
@@ -2,28 +2,10 @@
/**
* cases_Derivate.php
*
- * ProcessMaker Open Source Edition
- * Copyright (C) 2004 - 2008 Colosa Inc.23
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
- * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (!isset($_SESSION['USER_LOGGED'])) {
- G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
- die( '');
}
+
/* Permissions */
-switch ($RBAC->userCanAccess( 'PM_CASES' )) {
- case - 2:
- G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
- G::header( 'location: ../login/login' );
+switch ($RBAC->userCanAccess('PM_CASES')) {
+ case -2:
+ G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
+ G::header('location: ../login/login');
die();
break;
- case - 1:
- G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
- G::header( 'location: ../login/login' );
+ case -1:
+ G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
+ G::header('location: ../login/login');
die();
break;
}
@@ -67,37 +50,38 @@ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
/* Includes */
//If no variables are submitted and the $_POST variable is empty
if (!isset($_POST['form'])) {
- $_POST['form'] = array();
+ $_POST['form'] = [];
}
/* GET , POST & $_SESSION Vars */
/* Process the info */
$sStatus = 'TO_DO';
-foreach ($_POST['form']['TASKS'] as $aValues) {
-}
try {
+ //Load Session variables
+ $processUid = isset($_SESSION['PROCESS']) ? $_SESSION['PROCESS'] : '';
//load data
$oCase = new Cases();
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
- $appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
- $appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
+ $appFields = $oCase->loadCase($_SESSION['APPLICATION']);
+ $appFields['APP_DATA'] = array_merge($appFields['APP_DATA'], G::getSystemConstants());
//cleaning debug variables
- $_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
- $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
- $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
+ $_SESSION['TRIGGER_DEBUG']['DATA'] = [];
+ $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = [];
+ $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = [];
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
- $triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
+ $triggers = $oCase->loadTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE');
//if there are some triggers to execute
- if (sizeof( $triggers ) > 0) {
+ if (sizeof($triggers) > 0) {
//Execute triggers before derivation
- $appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE', $appFields['APP_DATA'] );
+ $appFields['APP_DATA'] = $oCase->ExecuteTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE',
+ $appFields['APP_DATA']);
//save trigger variables for debugger
- $_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof( $triggers );
+ $_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof($triggers);
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = G::toUpper(G::loadTranslation('ID_BEFORE'));
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = array_column($triggers, 'TRI_TITLE');
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
@@ -110,27 +94,27 @@ try {
unset($appFields['APP_PIN']);
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
- $appFields["TAS_UID"] = $_SESSION["TASK"];
- $appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
+ $appFields["TAS_UID"] = $_SESSION["TASK"];
+ $appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
$appFields["CURRENT_DYNAFORM"] = "-2";
- $appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
+ $appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
$oCase->updateCase($_SESSION["APPLICATION"], $appFields); //Save data
//Prepare information for the derivation
$oDerivation = new Derivation();
- $aCurrentDerivation = array (
+ $aCurrentDerivation = [
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'],
'APP_STATUS' => $sStatus,
'TAS_UID' => $_SESSION['TASK'],
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
- );
- $aDataForPrepareInfo = array (
+ ];
+ $aDataForPrepareInfo = [
'USER_UID' => $_SESSION['USER_LOGGED'],
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX']
- );
+ ];
//We define some parameters in the before the derivation
//Then this function will be route the case
@@ -154,13 +138,15 @@ try {
}
}
- $appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
- $triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER' ); //load the triggers after derivation
- if (sizeof( $triggers ) > 0) {
- $appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation
+ $appFields = $oCase->loadCase($_SESSION['APPLICATION']); //refresh appFields, because in derivations should change some values
+ $triggers = $oCase->loadTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2,
+ 'AFTER'); //load the triggers after derivation
+ if (sizeof($triggers) > 0) {
+ $appFields['APP_DATA'] = $oCase->ExecuteTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER',
+ $appFields['APP_DATA']); //Execute triggers after derivation
- $_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof( $triggers );
+ $_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof($triggers);
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = array_column($triggers, 'TRI_TITLE');
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
@@ -172,12 +158,12 @@ try {
unset($appFields['APP_PIN']);
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
- $appFields["TAS_UID"] = $_SESSION["TASK"];
- $appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
+ $appFields["TAS_UID"] = $_SESSION["TASK"];
+ $appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
$appFields["CURRENT_DYNAFORM"] = "-2";
- $appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
+ $appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
- $oCase->updateCase( $_SESSION['APPLICATION'], $appFields );
+ $oCase->updateCase($_SESSION['APPLICATION'], $appFields);
// Send notifications - Start
$oUser = new Users();
@@ -188,20 +174,21 @@ try {
$flagGmail = false;
/*----------------------------------********---------------------------------*/
- $licensedFeatures = &PMLicensedFeatures::getSingleton ();
- if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
+ $licensedFeatures = &PMLicensedFeatures::getSingleton();
+ if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PmGoogleApi ();
- if ($pmGoogle->getServiceGmailStatus ()) {
+ if ($pmGoogle->getServiceGmailStatus()) {
$flagGmail = true;
$appDel = new AppDelegation ();
- $actualThread = $appDel->Load ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'] );
+ $actualThread = $appDel->Load($_SESSION ['APPLICATION'], $_SESSION ['INDEX']);
- $appDelPrev = $appDel->LoadParallel ( $_SESSION ['APPLICATION'] );
+ $appDelPrev = $appDel->LoadParallel($_SESSION ['APPLICATION']);
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail ();
- foreach ( $appDelPrev as $app ) {
+ foreach ($appDelPrev as $app) {
if (($app ['DEL_INDEX'] != $_SESSION ['INDEX']) && ($app ['DEL_PREVIOUS'] != $actualThread ['DEL_PREVIOUS'])) {
- $Pmgmail->gmailsIfSelfServiceValueBased ( $_SESSION ['APPLICATION'], $app ['DEL_INDEX'], $_POST ['form'] ['TASKS'], $appFields ['APP_DATA'] );
+ $Pmgmail->gmailsIfSelfServiceValueBased($_SESSION ['APPLICATION'], $app ['DEL_INDEX'],
+ $_POST ['form'] ['TASKS'], $appFields ['APP_DATA']);
}
}
}
@@ -209,32 +196,42 @@ try {
/*----------------------------------********---------------------------------*/
try {
- $oCase->sendNotifications( $_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromData );
+ $oCase->sendNotifications(
+ $_SESSION['TASK'],
+ $_POST['form']['TASKS'],
+ $appFields['APP_DATA'],
+ $_SESSION['APPLICATION'],
+ $_SESSION['INDEX'],
+ $sFromData
+ );
} catch (Exception $e) {
- G::SendTemporalMessage( G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%' );
+ G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR') . ' - ' . $e->getMessage(), 'warning',
+ 'string', null, '100%');
}
// Send notifications - End
// Events - Start
$oEvent = new Event();
- $oEvent->closeAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
- $oCurrentAppDel = AppDelegationPeer::retrieveByPk( $_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1 );
+ $oEvent->closeAppEvents($processUid, $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
+ $oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1);
$multipleDelegation = false;
// check if there are multiple derivations
- if (count( $_POST['form']['TASKS'] ) > 1) {
+ if (count($_POST['form']['TASKS']) > 1) {
$multipleDelegation = true;
}
// If the case has been delegated
- if (isset( $oCurrentAppDel )) {
+ if (isset($oCurrentAppDel)) {
// if there is just a single derivation the TASK_UID can be set by the delegation data
- if (! $multipleDelegation) {
- $aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
- $oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID'] );
+ if (!$multipleDelegation) {
+ $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
+ $oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'],
+ $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID']);
} else {
// else we need to check every task and create the events if it have any
foreach ($_POST['form']['TASKS'] as $taskDelegated) {
- $aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
- $oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID'] );
+ $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
+ $oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'],
+ $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID']);
}
}
}
@@ -257,16 +254,18 @@ try {
$debuggerAvailable = true;
$casesRedirector = 'casesListExtJsRedirector';
- if (isset ( $_SESSION ['user_experience'] ) && $flagGmail === false) {
+ if (isset ($_SESSION ['user_experience']) && $flagGmail === false) {
$aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience'];
$debuggerAvailable = false;
- } else if ($flagGmail === true) {
- $aNextStep ['PAGE'] = $casesRedirector . '?gmail=1';
} else {
- $aNextStep ['PAGE'] = $casesRedirector;
+ if ($flagGmail === true) {
+ $aNextStep ['PAGE'] = $casesRedirector . '?gmail=1';
+ } else {
+ $aNextStep ['PAGE'] = $casesRedirector;
+ }
}
- if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
+ if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
} else {
@@ -275,26 +274,26 @@ try {
//Triggers After
$isIE = Bootstrap::isIE();
- if (isset( $_SESSION['TRIGGER_DEBUG']['ISSET'] ) && !$isIE) {
+ if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && !$isIE) {
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
- $oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
+ $oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
- $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
+ $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
$_POST['NextStep'] = $loc;
- $G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
- $G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
+ $G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
+ $G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
- G::RenderPage( 'publish', 'blank' );
+ G::RenderPage('publish', 'blank');
exit();
} else {
- unset( $_SESSION['TRIGGER_DEBUG'] );
+ unset($_SESSION['TRIGGER_DEBUG']);
}
}
//close tab only if IE11
- if($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__'])) {
+ if ($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__'])) {
$script = "