Merged in bugfix/HOR-4396 (pull request #6436)
HOR-4396 Approved-by: David Callizaya <david.callizaya@processmaker.com> Approved-by: Paula Quispe <paula.quispe@processmaker.com> Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -86,28 +86,13 @@ class ActionsByEmailCoreClass extends PMPlugin
|
|||||||
|
|
||||||
if (!empty($emailSetup)) {
|
if (!empty($emailSetup)) {
|
||||||
$cases = new Cases();
|
$cases = new Cases();
|
||||||
$caseFields = $cases->loadCase($data->APP_UID);
|
$caseFields = $cases->loadCase($data->APP_UID, $data->DEL_INDEX);
|
||||||
$criteria = new Criteria();
|
$actionEmailTable = new AbeConfiguration();
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
$configuration = $actionEmailTable->getTaskConfiguration($caseFields['PRO_UID'], $data->TAS_UID);
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
$caseFields['APP_DATA']['PRO_ID'] = $configuration['PRO_ID'];
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TYPE);
|
$caseFields['APP_DATA']['TAS_ID'] = $configuration['TAS_ID'];
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
|
if (!empty($configuration)) {
|
||||||
$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()) {
|
|
||||||
$configuration['ABE_EMAIL_FIELD'] = str_replace('@@', '', $configuration['ABE_EMAIL_FIELD']);
|
$configuration['ABE_EMAIL_FIELD'] = str_replace('@@', '', $configuration['ABE_EMAIL_FIELD']);
|
||||||
if ($configuration['ABE_EMAIL_FIELD'] != '' && isset($caseFields['APP_DATA'][$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']]);
|
$email = trim($caseFields['APP_DATA'][$configuration['ABE_EMAIL_FIELD']]);
|
||||||
@@ -303,7 +288,7 @@ class ActionsByEmailCoreClass extends PMPlugin
|
|||||||
$caseFields['APP_DATA'],
|
$caseFields['APP_DATA'],
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
0,
|
$data->DEL_INDEX,
|
||||||
$emailSetup,
|
$emailSetup,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -489,6 +489,7 @@ class Cases
|
|||||||
//Update the global variables
|
//Update the global variables
|
||||||
$aFields['TASK'] = $aAppDel['TAS_UID'];
|
$aFields['TASK'] = $aAppDel['TAS_UID'];
|
||||||
$aFields['INDEX'] = $aAppDel['DEL_INDEX'];
|
$aFields['INDEX'] = $aAppDel['DEL_INDEX'];
|
||||||
|
$aFields['TAS_ID'] = $aAppDel['TAS_ID'];
|
||||||
$aFields['PRO_ID'] = $aAppDel['PRO_ID'];
|
$aFields['PRO_ID'] = $aAppDel['PRO_ID'];
|
||||||
try {
|
try {
|
||||||
$oCurUser = new Users();
|
$oCurUser = new Users();
|
||||||
@@ -5418,13 +5419,13 @@ class Cases
|
|||||||
} else {
|
} else {
|
||||||
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
|
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
|
||||||
}
|
}
|
||||||
$sBody2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false);
|
$body2 = G::replaceDataGridField($dataLastEmail['body'], $arrayData2, false);
|
||||||
$sTo = null;
|
$to = null;
|
||||||
$sCc = '';
|
$cc = '';
|
||||||
if ($aTask['TAS_UID'] != '-1') {
|
if ($aTask['TAS_UID'] != '-1') {
|
||||||
$respTo = $this->getTo($aTask['TAS_UID'], $aTask['USR_UID'], $arrayData);
|
$respTo = $this->getTo($aTask['TAS_UID'], $aTask['USR_UID'], $arrayData);
|
||||||
$sTo = $respTo['to'];
|
$to = $respTo['to'];
|
||||||
$sCc = $respTo['cc'];
|
$cc = $respTo['cc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($aTask ["TAS_ASSIGN_TYPE"] === "SELF_SERVICE") {
|
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);
|
@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) {
|
if ($to != null) {
|
||||||
$oSpool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
|
|
||||||
//Load the TAS_ID
|
//Load the TAS_ID
|
||||||
if (!isset($arrayData['TAS_ID'])) {
|
if (!isset($arrayData['TAS_ID'])) {
|
||||||
@@ -5451,32 +5452,43 @@ class Cases
|
|||||||
} else {
|
} else {
|
||||||
$taskId = $arrayData['TAS_ID'];
|
$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']);
|
$spool->setConfig($dataLastEmail['configuration']);
|
||||||
$oSpool->create(array(
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
"msg_uid" => "",
|
'',
|
||||||
'app_uid' => $dataLastEmail['applicationUid'],
|
$dataLastEmail['applicationUid'],
|
||||||
'del_index' => $dataLastEmail['delIndex'],
|
$dataLastEmail['delIndex'],
|
||||||
"app_msg_type" => "DERIVATION",
|
'DERIVATION',
|
||||||
"app_msg_subject" => $dataLastEmail['subject'],
|
$dataLastEmail['subject'],
|
||||||
'app_msg_from' => $dataLastEmail['from'],
|
$dataLastEmail['from'],
|
||||||
"app_msg_to" => $sTo,
|
$to,
|
||||||
'app_msg_body' => $sBody2,
|
$body2,
|
||||||
"app_msg_cc" => $sCc,
|
$cc,
|
||||||
"app_msg_bcc" => "",
|
'',
|
||||||
"app_msg_attach" => "",
|
'',
|
||||||
"app_msg_template" => "",
|
'',
|
||||||
"app_msg_status" => "pending",
|
'pending',
|
||||||
"app_msg_error" => $dataLastEmail['msgError'],
|
'',
|
||||||
"tas_id" => $taskId,
|
$dataLastEmail['msgError'],
|
||||||
"app_number" => isset($arrayData['APP_NUMBER']) ? $arrayData['APP_NUMBER'] : ''
|
true,
|
||||||
));
|
isset($arrayData['APP_NUMBER']) ? $arrayData['APP_NUMBER'] : 0,
|
||||||
|
$proId,
|
||||||
|
$taskId
|
||||||
|
);
|
||||||
|
$spool->create($messageArray);
|
||||||
|
|
||||||
if ($dataLastEmail['msgError'] == '') {
|
if ($dataLastEmail['msgError'] == '') {
|
||||||
if (($dataLastEmail['configuration']["MESS_BACKGROUND"] == "") ||
|
if (($dataLastEmail['configuration']["MESS_BACKGROUND"] == "") ||
|
||||||
($dataLastEmail['configuration']["MESS_TRY_SEND_INMEDIATLY"] == "1")
|
($dataLastEmail['configuration']["MESS_TRY_SEND_INMEDIATLY"] == "1")
|
||||||
) {
|
) {
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5525,8 +5537,8 @@ class Cases
|
|||||||
|
|
||||||
public function getTo($taskUid, $userUid, $arrayData)
|
public function getTo($taskUid, $userUid, $arrayData)
|
||||||
{
|
{
|
||||||
$sTo = null;
|
$to = null;
|
||||||
$sCc = null;
|
$cc = null;
|
||||||
$arrayResp = array();
|
$arrayResp = array();
|
||||||
$tasks = new Tasks();
|
$tasks = new Tasks();
|
||||||
$group = new Groups();
|
$group = new Groups();
|
||||||
@@ -5670,9 +5682,9 @@ class Cases
|
|||||||
if (isset($userUid) && !empty($userUid)) {
|
if (isset($userUid) && !empty($userUid)) {
|
||||||
$aUser = $oUser->load($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'] = '';
|
$arrayResp ['cc'] = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -6308,62 +6320,6 @@ class Cases
|
|||||||
return $oCriteria;
|
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 = '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />' . $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
|
* funcion History messages for case tracker
|
||||||
* by Everth The Answer
|
* 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)
|
public function unserializeData($data)
|
||||||
{
|
{
|
||||||
$unserializedData = @unserialize($data);
|
$unserializedData = @unserialize($data);
|
||||||
|
|||||||
@@ -1803,6 +1803,10 @@ class Derivation
|
|||||||
if (isset($nextDel['TAS_ID'])) {
|
if (isset($nextDel['TAS_ID'])) {
|
||||||
$appFields['APP_DATA']['TAS_ID'] = $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);
|
$this->case->sendMessage($dataEmail, $appFields['APP_DATA'], $taskData);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -239,7 +239,8 @@ class SpoolRun
|
|||||||
$attachment = implode(",", $this->fileData['attachments']);
|
$attachment = implode(",", $this->fileData['attachments']);
|
||||||
$oAppMessage->setappMsgAttach($attachment);
|
$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->setappMsgsenddate(date('Y-m-d H:i:s'));
|
||||||
$oAppMessage->save();
|
$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 string $dateResend
|
||||||
|
* @param integer $cron
|
||||||
|
*
|
||||||
* @return none or exception
|
* @return none or exception
|
||||||
*/
|
*/
|
||||||
public function resendEmails($dateResend = null, $cron = 0)
|
public function resendEmails($dateResend = null, $cron = 0)
|
||||||
{
|
{
|
||||||
$aConfiguration = System::getEmailConfiguration();
|
$configuration = System::getEmailConfiguration();
|
||||||
|
|
||||||
if (!isset($aConfiguration["MESS_ENABLED"])) {
|
if (!isset($configuration["MESS_ENABLED"])) {
|
||||||
$aConfiguration["MESS_ENABLED"] = '0';
|
$configuration["MESS_ENABLED"] = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($aConfiguration["MESS_ENABLED"] == "1") {
|
if ($configuration["MESS_ENABLED"] == "1") {
|
||||||
require_once("classes/model/AppMessage.php");
|
require_once("classes/model/AppMessage.php");
|
||||||
|
|
||||||
$this->setConfig($aConfiguration);
|
$this->setConfig($configuration);
|
||||||
|
|
||||||
$criteria = new Criteria("workflow");
|
$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) {
|
if ($dateResend != null) {
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateResend, Criteria::GREATER_EQUAL);
|
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateResend, Criteria::GREATER_EQUAL);
|
||||||
@@ -581,13 +584,24 @@ class SpoolRun
|
|||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
|
|
||||||
try {
|
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();
|
$this->sendMail();
|
||||||
} catch (Exception $e) {
|
} 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"]) {
|
if ($e->getCode() == $this->ExceptionCode["WARNING"]) {
|
||||||
array_push($this->aWarnings, $strAux);
|
array_push($this->aWarnings, $strAux);
|
||||||
@@ -631,6 +645,7 @@ class SpoolRun
|
|||||||
$spool->setAppUid($db_spool['app_uid']);
|
$spool->setAppUid($db_spool['app_uid']);
|
||||||
$spool->setDelIndex($db_spool['del_index']);
|
$spool->setDelIndex($db_spool['del_index']);
|
||||||
$spool->setAppMsgType($db_spool['app_msg_type']);
|
$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->setAppMsgSubject($db_spool['app_msg_subject']);
|
||||||
$spool->setAppMsgFrom($db_spool['app_msg_from']);
|
$spool->setAppMsgFrom($db_spool['app_msg_from']);
|
||||||
$spool->setAppMsgTo($db_spool['app_msg_to']);
|
$spool->setAppMsgTo($db_spool['app_msg_to']);
|
||||||
@@ -641,12 +656,13 @@ class SpoolRun
|
|||||||
$spool->setappMsgAttach($db_spool['app_msg_attach']);
|
$spool->setappMsgAttach($db_spool['app_msg_attach']);
|
||||||
$spool->setAppMsgTemplate($db_spool['app_msg_template']);
|
$spool->setAppMsgTemplate($db_spool['app_msg_template']);
|
||||||
$spool->setAppMsgStatus($db_spool['app_msg_status']);
|
$spool->setAppMsgStatus($db_spool['app_msg_status']);
|
||||||
$spool->setAppMsgSendDate(date('Y-m-d H:i:s')); // 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->setAppMsgShowMessage($db_spool['app_msg_show_message']); // Add by Ankit
|
$spool->setAppMsgSendDate(date('Y-m-d H:i:s'));
|
||||||
|
$spool->setAppMsgShowMessage($db_spool['app_msg_show_message']);
|
||||||
$spool->setAppMsgError($db_spool['app_msg_error']);
|
$spool->setAppMsgError($db_spool['app_msg_error']);
|
||||||
|
|
||||||
|
$appDelegation = new AppDelegation();
|
||||||
if (empty($db_spool['app_number'])) {
|
if (empty($db_spool['app_number'])) {
|
||||||
$appDelegation = new AppDelegation();
|
|
||||||
$delegationIds = $appDelegation->getColumnIds($db_spool['app_uid'], $db_spool['del_index']);
|
$delegationIds = $appDelegation->getColumnIds($db_spool['app_uid'], $db_spool['del_index']);
|
||||||
if (is_array($delegationIds) && count($delegationIds) > 0) {
|
if (is_array($delegationIds) && count($delegationIds) > 0) {
|
||||||
$delegationIds = array_change_key_case($delegationIds);
|
$delegationIds = array_change_key_case($delegationIds);
|
||||||
@@ -665,8 +681,15 @@ class SpoolRun
|
|||||||
$tasId = $db_spool['tas_id'];
|
$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->setAppNumber($appNumber);
|
||||||
$spool->setTasId($tasId);
|
$spool->setTasId($tasId);
|
||||||
|
$spool->setProId($proId);
|
||||||
|
|
||||||
if (!$spool->validate()) {
|
if (!$spool->validate()) {
|
||||||
$errors = $spool->getValidationFailures();
|
$errors = $spool->getValidationFailures();
|
||||||
|
|||||||
@@ -3869,18 +3869,65 @@ class WorkspaceTools
|
|||||||
WHERE AD.APP_NUMBER = 0");
|
WHERE AD.APP_NUMBER = 0");
|
||||||
$con->commit();
|
$con->commit();
|
||||||
|
|
||||||
// Populating APP_MESSAGE.TAS_ID
|
// Populating APP_MESSAGE.TAS_ID AND APP_MESSAGE.PRO_ID
|
||||||
CLI::logging("-> Populating APP_MESSAGE.TAS_ID \n");
|
CLI::logging("-> Populating APP_MESSAGE.TAS_ID and APP_MESSAGE.PRO_ID \n");
|
||||||
$con->begin();
|
$con->begin();
|
||||||
$stmt = $con->createStatement();
|
$stmt = $con->createStatement();
|
||||||
$rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AD
|
$rs = $stmt->executeQuery("UPDATE APP_MESSAGE AS AM
|
||||||
INNER JOIN (
|
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
|
FROM APP_DELEGATION
|
||||||
) AS DEL
|
) AS DEL
|
||||||
ON (AD.APP_NUMBER = DEL.APP_NUMBER AND AD.DEL_INDEX = DEL.DEL_INDEX)
|
ON (AM.APP_NUMBER = DEL.APP_NUMBER AND AM.DEL_INDEX = DEL.DEL_INDEX)
|
||||||
SET AD.TAS_ID = DEL.TAS_ID
|
SET AM.TAS_ID = DEL.TAS_ID, AM.PRO_ID = DEL.PRO_ID
|
||||||
WHERE AD.TAS_ID = 0 AND AD.APP_NUMBER != 0 AND AD.DEL_INDEX != 0");
|
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();
|
$con->commit();
|
||||||
|
|
||||||
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
|
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
//It works with the table CONFIGURATION in a WF dataBase
|
//It works with the table CONFIGURATION in a WF dataBase
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
|
use ProcessMaker\BusinessModel\EmailServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2009 COLOSA
|
* Copyright (C) 2009 COLOSA
|
||||||
@@ -776,22 +777,34 @@ class WsBase
|
|||||||
/**
|
/**
|
||||||
* send message
|
* send message
|
||||||
*
|
*
|
||||||
* @param string $caseId
|
* @param string $appUid
|
||||||
* @param string $sFrom
|
* @param string $from
|
||||||
* @param string $sTo
|
* @param string $to
|
||||||
* @param string $sCc
|
* @param string $cc
|
||||||
* @param string $sBcc
|
* @param string $bcc
|
||||||
* @param string $sSubject
|
* @param string $subject
|
||||||
* @param string $sTemplate
|
* @param string $template
|
||||||
* @param $appFields = null
|
* @param $appFields = null
|
||||||
* @param $aAttachment = null
|
* @param $attachment = null
|
||||||
* @param boolean $showMessage = true
|
* @param boolean $showMessage = true
|
||||||
* @param int $delIndex = 0
|
* @param int $delIndex = 0
|
||||||
* @param $config = array
|
* @param $config = array
|
||||||
* @return $result will return an object
|
* @return $result will return an object
|
||||||
*/
|
*/
|
||||||
public function sendMessage(
|
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 {
|
try {
|
||||||
|
|
||||||
@@ -805,56 +818,50 @@ class WsBase
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0=")) {
|
if (PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0=")) {
|
||||||
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
$emailServer = new EmailServer();
|
||||||
|
|
||||||
$criteria = $emailServer->getEmailServerCriteria();
|
$criteria = $emailServer->getEmailServerCriteria();
|
||||||
|
|
||||||
$criteria->add(EmailServerPeer::MESS_UID, $config, Criteria::EQUAL);
|
$criteria->add(EmailServerPeer::MESS_UID, $config, Criteria::EQUAL);
|
||||||
|
|
||||||
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
|
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
if ($rsCriteria->next()) {
|
if ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
|
|
||||||
$arrayConfigAux = $row;
|
$arrayConfigAux = $row;
|
||||||
$arrayConfigAux["SMTPSecure"] = $row["SMTPSECURE"];
|
$arrayConfigAux["SMTPSecure"] = $row["SMTPSECURE"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$aSetup = (!empty($arrayConfigAux)) ? $arrayConfigAux : System::getEmailConfiguration();
|
$setup = (!empty($arrayConfigAux)) ? $arrayConfigAux : System::getEmailConfiguration();
|
||||||
|
|
||||||
if (!isset($aSetup['MESS_ENABLED'])) {
|
if (!isset($setup['MESS_ENABLED'])) {
|
||||||
$aSetup['MESS_ENABLED'] = 1;
|
$setup['MESS_ENABLED'] = 1;
|
||||||
$aSetup['SMTPSecure'] = $aSetup['SMTPSECURE'];
|
$setup['SMTPSecure'] = $setup['SMTPSECURE'];
|
||||||
unset($aSetup['SMTPSECURE']);
|
unset($setup['SMTPSECURE']);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$aSetup = System::getEmailConfiguration();
|
$setup = System::getEmailConfiguration();
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
$msgError = "";
|
$msgError = "";
|
||||||
if (sizeof($aSetup) == 0) {
|
if (sizeof($setup) == 0) {
|
||||||
$msgError = "The default configuration wasn't defined";
|
$msgError = "The default configuration wasn't defined";
|
||||||
}
|
}
|
||||||
|
|
||||||
$oSpool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
|
$spool->setConfig($setup);
|
||||||
|
|
||||||
$oSpool->setConfig($aSetup);
|
$case = new Cases();
|
||||||
|
$oldFields = $case->loadCase($appUid);
|
||||||
$oCase = new Cases();
|
|
||||||
|
|
||||||
$oldFields = $oCase->loadCase($caseId);
|
|
||||||
if ($gmail == 1) {
|
if ($gmail == 1) {
|
||||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP;
|
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP;
|
||||||
} else {
|
} else {
|
||||||
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $oldFields['PRO_UID'] . PATH_SEP;
|
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $oldFields['PRO_UID'] . PATH_SEP;
|
||||||
}
|
}
|
||||||
$fileTemplate = $pathEmail . $sTemplate;
|
$fileTemplate = $pathEmail . $template;
|
||||||
G::mk_dir($pathEmail, 0777, true);
|
G::mk_dir($pathEmail, 0777, true);
|
||||||
|
|
||||||
if (!file_exists($fileTemplate)) {
|
if (!file_exists($fileTemplate)) {
|
||||||
@@ -865,48 +872,45 @@ class WsBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($appFields == null) {
|
if ($appFields == null) {
|
||||||
$Fields = $oldFields['APP_DATA'];
|
$fieldsCase = $oldFields['APP_DATA'];
|
||||||
} else {
|
} else {
|
||||||
$Fields = array_merge($oldFields['APP_DATA'], $appFields);
|
$fieldsCase = array_merge($oldFields['APP_DATA'], $appFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $Fields, false);
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
|
'',
|
||||||
$sFrom = G::buildFrom($aSetup, $sFrom);
|
$appUid,
|
||||||
|
$delIndex,
|
||||||
$showMessage = ($showMessage) ? 1 : 0;
|
'TRIGGER',
|
||||||
|
$subject,
|
||||||
$messageArray = array(
|
G::buildFrom($setup, $from),
|
||||||
"msg_uid" => "",
|
$to,
|
||||||
"app_uid" => $caseId,
|
G::replaceDataGridField(file_get_contents($fileTemplate), $fieldsCase, false),
|
||||||
"del_index" => $delIndex,
|
$cc,
|
||||||
"app_msg_type" => "TRIGGER",
|
$bcc,
|
||||||
"app_msg_subject" => $sSubject,
|
'',
|
||||||
"app_msg_from" => $sFrom,
|
'',
|
||||||
"app_msg_to" => $sTo,
|
'pending',
|
||||||
"app_msg_body" => $sBody,
|
($showMessage) ? 1 : 0,
|
||||||
"app_msg_cc" => $sCc,
|
$msgError,
|
||||||
"app_msg_bcc" => $sBcc,
|
(preg_match("/^.+\.html?$/i", $fileTemplate)) ? true : false,
|
||||||
"app_msg_attach" => $aAttachment,
|
isset($fieldsCase['APP_NUMBER']) ? $fieldsCase['APP_NUMBER'] : 0,
|
||||||
"app_msg_template" => "",
|
isset($fieldsCase['PRO_ID']) ? $fieldsCase['PRO_ID'] : 0,
|
||||||
"app_msg_status" => "pending",
|
isset($fieldsCase['TAS_ID']) ? $fieldsCase['TAS_ID'] : 0
|
||||||
"app_msg_show_message" => $showMessage,
|
|
||||||
"app_msg_error" => $msgError,
|
|
||||||
"contentTypeIsHtml" => (preg_match("/^.+\.html?$/i", $fileTemplate)) ? true : false
|
|
||||||
);
|
);
|
||||||
|
$spool->create($messageArray);
|
||||||
|
|
||||||
$oSpool->create($messageArray);
|
$result = "";
|
||||||
if ($gmail != 1) {
|
if ($gmail != 1) {
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
|
|
||||||
if ($oSpool->status == 'sent') {
|
if ($spool->status == 'sent') {
|
||||||
$result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $sTo);
|
$result = new WsResponse(0, G::loadTranslation('ID_MESSAGE_SENT') . ": " . $to);
|
||||||
} else {
|
} 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;
|
return $result;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return new WsResponse(100, $e->getMessage());
|
return new WsResponse(100, $e->getMessage());
|
||||||
@@ -2315,19 +2319,26 @@ class WsBase
|
|||||||
$sFromName = "\"" . $arrayUserData["USR_FIRSTNAME"] . " " . $arrayUserData["USR_LASTNAME"] . "\" <" . $arrayUserData["USR_EMAIL"] . ">";
|
$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
|
//here debug mode in web entry
|
||||||
|
if (isset($processFieds['PRO_DEBUG']) && $processFieds['PRO_DEBUG']) {
|
||||||
|
|
||||||
if (isset($oProcessFieds['PRO_DEBUG']) && $oProcessFieds['PRO_DEBUG']) {
|
|
||||||
$result = new WsResponse(0, $varResponse . "
|
$result = new WsResponse(0, $varResponse . "
|
||||||
<br><br><table width='100%' cellpadding='0' cellspacing='0'><tr><td class='FormTitle'>
|
<br><br><table width='100%' cellpadding='0' cellspacing='0'><tr><td class='FormTitle'>
|
||||||
" . G::LoadTranslation('ID_DEBUG_MESSAGE') . "</td></tr></table>" . $varTriggers);
|
" . G::LoadTranslation('ID_DEBUG_MESSAGE') . "</td></tr></table>" . $varTriggers);
|
||||||
} else {
|
} else {
|
||||||
$result = new WsResponse(0, $varResponse . " --- " . $oProcessFieds['PRO_DEBUG']);
|
$result = new WsResponse(0, $varResponse . " --- " . $processFieds['PRO_DEBUG']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = $result->getPayloadArray();
|
$res = $result->getPayloadArray();
|
||||||
|
|||||||
@@ -113,6 +113,46 @@ class AbeConfiguration extends BaseAbeConfiguration
|
|||||||
throw $error;
|
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
|
// AbeConfiguration
|
||||||
|
|||||||
@@ -81,6 +81,48 @@ class AbeRequests extends BaseAbeRequests
|
|||||||
throw $error;
|
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
|
// AbeRequests
|
||||||
|
|||||||
@@ -305,21 +305,26 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
/**
|
/**
|
||||||
* Load the Application Delegation row specified in [app_id] column value.
|
* 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
|
* @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 {
|
try {
|
||||||
$oAppDel = AppDelegationPeer::retrieveByPk( $AppUid, $sDelIndex );
|
$oAppDel = AppDelegationPeer::retrieveByPk($appUid, $delIndex);
|
||||||
if (is_object( $oAppDel ) && get_class( $oAppDel ) == 'AppDelegation') {
|
if (is_object($oAppDel) && get_class($oAppDel) == 'AppDelegation') {
|
||||||
$aFields = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
$fields = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
||||||
return $aFields;
|
|
||||||
|
return $fields;
|
||||||
} else {
|
} 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) {
|
} catch (Exception $oError) {
|
||||||
throw ($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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* AppMessage.php
|
|
||||||
* * @package workflow.engine.classes.model
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* 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.
|
* Skeleton subclass for representing a row from the 'APP_MESSAGE' table.
|
||||||
@@ -39,9 +14,18 @@
|
|||||||
class AppMessage extends BaseAppMessage
|
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 $data_spool;
|
||||||
private $status_spool;
|
private $status_spool;
|
||||||
private $error_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 ()
|
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,
|
* This function is not used in the core
|
||||||
* app_msg_body, app_msg_cc, app_msg_bcc, app_msg_attach, app_msg_template, app_msg_status )
|
|
||||||
*
|
*
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmai.com>
|
|
||||||
* Date Aug 31th, 2009
|
|
||||||
*/
|
*/
|
||||||
public function quickSave2 ($data_spool)
|
public function quickSave2 ($data_spool)
|
||||||
{
|
{
|
||||||
@@ -104,6 +85,12 @@ class AppMessage extends BaseAppMessage
|
|||||||
return $sUID;
|
return $sUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated version 3.2.4
|
||||||
|
*
|
||||||
|
* This function is not used in the core
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function quickSave ($aData)
|
public function quickSave ($aData)
|
||||||
{
|
{
|
||||||
if (isset( $aData['app_msg_uid'] )) {
|
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 = AppMessagePeer::retrieveByPk($msgUid);
|
||||||
$message->fromArray( $message, BasePeer::TYPE_FIELDNAME );
|
$message->fromArray($message, BasePeer::TYPE_FIELDNAME);
|
||||||
|
$message->setAppMsgStatusId($msgStatusId);
|
||||||
|
$msgStatus = array_search($msgStatusId, self::$app_msg_status_values);
|
||||||
$message->setAppMsgStatus($msgStatus);
|
$message->setAppMsgStatus($msgStatus);
|
||||||
$message->save();
|
$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'] = '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />' . $row['APP_MSG_BODY'];
|
||||||
|
$messages[] = $row;
|
||||||
|
$dataset->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $messages;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,73 +145,83 @@ class AppNotes extends BaseAppNotes
|
|||||||
return $response;
|
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 {
|
try {
|
||||||
|
|
||||||
$aConfiguration = System::getEmailConfiguration();
|
$configuration = System::getEmailConfiguration();
|
||||||
|
|
||||||
$msgError = "";
|
$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";
|
$msgError = "The default configuration wasn't defined";
|
||||||
$aConfiguration['MESS_ENGINE'] = '';
|
$configuration['MESS_ENGINE'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$oUser = new Users();
|
$users = new Users();
|
||||||
$aUser = $oUser->load( $usrUid );
|
$userInfo = $users->load($usrUid);
|
||||||
$authorName = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
|
$authorName = ((($userInfo['USR_FIRSTNAME'] != '') || ($userInfo['USR_LASTNAME'] != '')) ? $userInfo['USR_FIRSTNAME'] . ' ' . $userInfo['USR_LASTNAME'] . ' ' : '') . '<' . $userInfo['USR_EMAIL'] . '>';
|
||||||
|
|
||||||
$oCase = new Cases();
|
$cases = new Cases();
|
||||||
$aFields = $oCase->loadCase( $appUid );
|
$fieldCase = $cases->loadCase($appUid, $delIndex);
|
||||||
$configNoteNotification['subject'] = G::LoadTranslation( 'ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION' ) . " @#APP_TITLE ";
|
$configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
|
||||||
//Define the body for the notification
|
//Define the body for the notification
|
||||||
$body = G::LoadTranslation('ID_CASE_TITLE') . ": @#APP_TITLE<br />";
|
$configNoteNotification['body'] = $this->getBodyCaseNote($authorName, $noteContent);
|
||||||
$body .= G::LoadTranslation('ID_CASE_NUMBER') . ": @#APP_NUMBER<br />";
|
$body = nl2br(G::replaceDataField($configNoteNotification['body'], $fieldCase));
|
||||||
$body .= G::LoadTranslation('ID_AUTHOR') . ": $authorName<br /><br />$noteContent";
|
|
||||||
$configNoteNotification['body'] = $body;
|
|
||||||
|
|
||||||
$sFrom = G::buildFrom($aConfiguration, $sFrom);
|
$users = new Users();
|
||||||
$sSubject = G::replaceDataField( $configNoteNotification['subject'], $aFields );
|
$recipientsArray = explode(",", $noteRecipients);
|
||||||
$sBody = nl2br( G::replaceDataField( $configNoteNotification['body'], $aFields ) );
|
|
||||||
|
|
||||||
$oUser = new Users();
|
|
||||||
$recipientsArray = explode( ",", $noteRecipients );
|
|
||||||
|
|
||||||
foreach ($recipientsArray as $recipientUid) {
|
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 ($msgError == '') {
|
||||||
if (($aConfiguration['MESS_BACKGROUND'] == '') || ($aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1')) {
|
if (($configuration['MESS_BACKGROUND'] == '') || ($configuration['MESS_TRY_SEND_INMEDIATLY'] == '1')) {
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Send derivation notification - End
|
//Send derivation notification - End
|
||||||
} catch (Exception $oException) {
|
} catch (Exception $exception) {
|
||||||
throw $oException;
|
throw $exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,5 +266,22 @@ class AppNotes extends BaseAppNotes
|
|||||||
return $notes;
|
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<br />';
|
||||||
|
$body .= G::LoadTranslation('ID_CASE_NUMBER') . ': @#APP_NUMBER<br />';
|
||||||
|
$body .= G::LoadTranslation('ID_AUTHOR') . ': ' . $authorName . '<br /><br />' . $noteContent;
|
||||||
|
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class AppMessageMapBuilder
|
|||||||
|
|
||||||
$tMap->addColumn('APP_MSG_TYPE', 'AppMsgType', 'string', CreoleTypes::VARCHAR, true, 100);
|
$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_SUBJECT', 'AppMsgSubject', 'string', CreoleTypes::VARCHAR, true, 150);
|
||||||
|
|
||||||
$tMap->addColumn('APP_MSG_FROM', 'AppMsgFrom', 'string', CreoleTypes::VARCHAR, true, 100);
|
$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', '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_ATTACH', 'AppMsgAttach', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('APP_MSG_SEND_DATE', 'AppMsgSendDate', 'int', CreoleTypes::TIMESTAMP, true, 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('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('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
|
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $app_msg_type = '';
|
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.
|
* The value for the app_msg_subject field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -111,6 +117,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $app_msg_status;
|
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.
|
* The value for the app_msg_attach field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -135,6 +147,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $app_msg_error;
|
protected $app_msg_error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the pro_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $pro_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the tas_id field.
|
* The value for the tas_id field.
|
||||||
* @var int
|
* @var int
|
||||||
@@ -216,6 +234,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
return $this->app_msg_type;
|
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.
|
* Get the [app_msg_subject] column value.
|
||||||
*
|
*
|
||||||
@@ -336,6 +365,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
return $this->app_msg_status;
|
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.
|
* Get the [app_msg_attach] column value.
|
||||||
*
|
*
|
||||||
@@ -401,6 +441,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
return $this->app_msg_error;
|
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.
|
* Get the [tas_id] column value.
|
||||||
*
|
*
|
||||||
@@ -533,6 +584,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setAppMsgType()
|
} // 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.
|
* Set the value of [app_msg_subject] column.
|
||||||
*
|
*
|
||||||
@@ -738,6 +811,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setAppMsgStatus()
|
} // 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.
|
* Set the value of [app_msg_attach] column.
|
||||||
*
|
*
|
||||||
@@ -833,6 +928,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setAppMsgError()
|
} // 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.
|
* 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_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->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// 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) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating AppMessage object", $e);
|
throw new PropelException("Error populating AppMessage object", $e);
|
||||||
@@ -1159,48 +1282,57 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
return $this->getAppMsgType();
|
return $this->getAppMsgType();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
return $this->getAppMsgSubject();
|
return $this->getAppMsgTypeId();
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
return $this->getAppMsgFrom();
|
return $this->getAppMsgSubject();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
return $this->getAppMsgTo();
|
return $this->getAppMsgFrom();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
return $this->getAppMsgBody();
|
return $this->getAppMsgTo();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
return $this->getAppMsgDate();
|
return $this->getAppMsgBody();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
return $this->getAppMsgCc();
|
return $this->getAppMsgDate();
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
return $this->getAppMsgBcc();
|
return $this->getAppMsgCc();
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
return $this->getAppMsgTemplate();
|
return $this->getAppMsgBcc();
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
return $this->getAppMsgStatus();
|
return $this->getAppMsgTemplate();
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
return $this->getAppMsgAttach();
|
return $this->getAppMsgStatus();
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
return $this->getAppMsgSendDate();
|
return $this->getAppMsgStatusId();
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
return $this->getAppMsgShowMessage();
|
return $this->getAppMsgAttach();
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
return $this->getAppMsgError();
|
return $this->getAppMsgSendDate();
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
return $this->getTasId();
|
return $this->getAppMsgShowMessage();
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
|
return $this->getAppMsgError();
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
return $this->getProId();
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
return $this->getTasId();
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
return $this->getAppNumber();
|
return $this->getAppNumber();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1228,21 +1360,24 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
$keys[2] => $this->getAppUid(),
|
$keys[2] => $this->getAppUid(),
|
||||||
$keys[3] => $this->getDelIndex(),
|
$keys[3] => $this->getDelIndex(),
|
||||||
$keys[4] => $this->getAppMsgType(),
|
$keys[4] => $this->getAppMsgType(),
|
||||||
$keys[5] => $this->getAppMsgSubject(),
|
$keys[5] => $this->getAppMsgTypeId(),
|
||||||
$keys[6] => $this->getAppMsgFrom(),
|
$keys[6] => $this->getAppMsgSubject(),
|
||||||
$keys[7] => $this->getAppMsgTo(),
|
$keys[7] => $this->getAppMsgFrom(),
|
||||||
$keys[8] => $this->getAppMsgBody(),
|
$keys[8] => $this->getAppMsgTo(),
|
||||||
$keys[9] => $this->getAppMsgDate(),
|
$keys[9] => $this->getAppMsgBody(),
|
||||||
$keys[10] => $this->getAppMsgCc(),
|
$keys[10] => $this->getAppMsgDate(),
|
||||||
$keys[11] => $this->getAppMsgBcc(),
|
$keys[11] => $this->getAppMsgCc(),
|
||||||
$keys[12] => $this->getAppMsgTemplate(),
|
$keys[12] => $this->getAppMsgBcc(),
|
||||||
$keys[13] => $this->getAppMsgStatus(),
|
$keys[13] => $this->getAppMsgTemplate(),
|
||||||
$keys[14] => $this->getAppMsgAttach(),
|
$keys[14] => $this->getAppMsgStatus(),
|
||||||
$keys[15] => $this->getAppMsgSendDate(),
|
$keys[15] => $this->getAppMsgStatusId(),
|
||||||
$keys[16] => $this->getAppMsgShowMessage(),
|
$keys[16] => $this->getAppMsgAttach(),
|
||||||
$keys[17] => $this->getAppMsgError(),
|
$keys[17] => $this->getAppMsgSendDate(),
|
||||||
$keys[18] => $this->getTasId(),
|
$keys[18] => $this->getAppMsgShowMessage(),
|
||||||
$keys[19] => $this->getAppNumber(),
|
$keys[19] => $this->getAppMsgError(),
|
||||||
|
$keys[20] => $this->getProId(),
|
||||||
|
$keys[21] => $this->getTasId(),
|
||||||
|
$keys[22] => $this->getAppNumber(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -1290,48 +1425,57 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
$this->setAppMsgType($value);
|
$this->setAppMsgType($value);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
$this->setAppMsgSubject($value);
|
$this->setAppMsgTypeId($value);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
$this->setAppMsgFrom($value);
|
$this->setAppMsgSubject($value);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
$this->setAppMsgTo($value);
|
$this->setAppMsgFrom($value);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
$this->setAppMsgBody($value);
|
$this->setAppMsgTo($value);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
$this->setAppMsgDate($value);
|
$this->setAppMsgBody($value);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
$this->setAppMsgCc($value);
|
$this->setAppMsgDate($value);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
$this->setAppMsgBcc($value);
|
$this->setAppMsgCc($value);
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
$this->setAppMsgTemplate($value);
|
$this->setAppMsgBcc($value);
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
$this->setAppMsgStatus($value);
|
$this->setAppMsgTemplate($value);
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
$this->setAppMsgAttach($value);
|
$this->setAppMsgStatus($value);
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
$this->setAppMsgSendDate($value);
|
$this->setAppMsgStatusId($value);
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
$this->setAppMsgShowMessage($value);
|
$this->setAppMsgAttach($value);
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
$this->setAppMsgError($value);
|
$this->setAppMsgSendDate($value);
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
$this->setTasId($value);
|
$this->setAppMsgShowMessage($value);
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
|
$this->setAppMsgError($value);
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
$this->setProId($value);
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
$this->setTasId($value);
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
$this->setAppNumber($value);
|
$this->setAppNumber($value);
|
||||||
break;
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
@@ -1378,63 +1522,75 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[5], $arr)) {
|
if (array_key_exists($keys[5], $arr)) {
|
||||||
$this->setAppMsgSubject($arr[$keys[5]]);
|
$this->setAppMsgTypeId($arr[$keys[5]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[6], $arr)) {
|
if (array_key_exists($keys[6], $arr)) {
|
||||||
$this->setAppMsgFrom($arr[$keys[6]]);
|
$this->setAppMsgSubject($arr[$keys[6]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[7], $arr)) {
|
if (array_key_exists($keys[7], $arr)) {
|
||||||
$this->setAppMsgTo($arr[$keys[7]]);
|
$this->setAppMsgFrom($arr[$keys[7]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[8], $arr)) {
|
if (array_key_exists($keys[8], $arr)) {
|
||||||
$this->setAppMsgBody($arr[$keys[8]]);
|
$this->setAppMsgTo($arr[$keys[8]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[9], $arr)) {
|
if (array_key_exists($keys[9], $arr)) {
|
||||||
$this->setAppMsgDate($arr[$keys[9]]);
|
$this->setAppMsgBody($arr[$keys[9]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[10], $arr)) {
|
if (array_key_exists($keys[10], $arr)) {
|
||||||
$this->setAppMsgCc($arr[$keys[10]]);
|
$this->setAppMsgDate($arr[$keys[10]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[11], $arr)) {
|
if (array_key_exists($keys[11], $arr)) {
|
||||||
$this->setAppMsgBcc($arr[$keys[11]]);
|
$this->setAppMsgCc($arr[$keys[11]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[12], $arr)) {
|
if (array_key_exists($keys[12], $arr)) {
|
||||||
$this->setAppMsgTemplate($arr[$keys[12]]);
|
$this->setAppMsgBcc($arr[$keys[12]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[13], $arr)) {
|
if (array_key_exists($keys[13], $arr)) {
|
||||||
$this->setAppMsgStatus($arr[$keys[13]]);
|
$this->setAppMsgTemplate($arr[$keys[13]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[14], $arr)) {
|
if (array_key_exists($keys[14], $arr)) {
|
||||||
$this->setAppMsgAttach($arr[$keys[14]]);
|
$this->setAppMsgStatus($arr[$keys[14]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[15], $arr)) {
|
if (array_key_exists($keys[15], $arr)) {
|
||||||
$this->setAppMsgSendDate($arr[$keys[15]]);
|
$this->setAppMsgStatusId($arr[$keys[15]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[16], $arr)) {
|
if (array_key_exists($keys[16], $arr)) {
|
||||||
$this->setAppMsgShowMessage($arr[$keys[16]]);
|
$this->setAppMsgAttach($arr[$keys[16]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[17], $arr)) {
|
if (array_key_exists($keys[17], $arr)) {
|
||||||
$this->setAppMsgError($arr[$keys[17]]);
|
$this->setAppMsgSendDate($arr[$keys[17]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[18], $arr)) {
|
if (array_key_exists($keys[18], $arr)) {
|
||||||
$this->setTasId($arr[$keys[18]]);
|
$this->setAppMsgShowMessage($arr[$keys[18]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[19], $arr)) {
|
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);
|
$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)) {
|
if ($this->isColumnModified(AppMessagePeer::APP_MSG_SUBJECT)) {
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_SUBJECT, $this->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);
|
$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)) {
|
if ($this->isColumnModified(AppMessagePeer::APP_MSG_ATTACH)) {
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_ATTACH, $this->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);
|
$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)) {
|
if ($this->isColumnModified(AppMessagePeer::TAS_ID)) {
|
||||||
$criteria->add(AppMessagePeer::TAS_ID, $this->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->setAppMsgType($this->app_msg_type);
|
||||||
|
|
||||||
|
$copyObj->setAppMsgTypeId($this->app_msg_type_id);
|
||||||
|
|
||||||
$copyObj->setAppMsgSubject($this->app_msg_subject);
|
$copyObj->setAppMsgSubject($this->app_msg_subject);
|
||||||
|
|
||||||
$copyObj->setAppMsgFrom($this->app_msg_from);
|
$copyObj->setAppMsgFrom($this->app_msg_from);
|
||||||
@@ -1608,6 +1778,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$copyObj->setAppMsgStatus($this->app_msg_status);
|
$copyObj->setAppMsgStatus($this->app_msg_status);
|
||||||
|
|
||||||
|
$copyObj->setAppMsgStatusId($this->app_msg_status_id);
|
||||||
|
|
||||||
$copyObj->setAppMsgAttach($this->app_msg_attach);
|
$copyObj->setAppMsgAttach($this->app_msg_attach);
|
||||||
|
|
||||||
$copyObj->setAppMsgSendDate($this->app_msg_send_date);
|
$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->setAppMsgError($this->app_msg_error);
|
||||||
|
|
||||||
|
$copyObj->setProId($this->pro_id);
|
||||||
|
|
||||||
$copyObj->setTasId($this->tas_id);
|
$copyObj->setTasId($this->tas_id);
|
||||||
|
|
||||||
$copyObj->setAppNumber($this->app_number);
|
$copyObj->setAppNumber($this->app_number);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ abstract class BaseAppMessagePeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.AppMessage';
|
const CLASS_DEFAULT = 'classes.model.AppMessage';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 20;
|
const NUM_COLUMNS = 23;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
@@ -46,6 +46,9 @@ abstract class BaseAppMessagePeer
|
|||||||
/** the column name for the APP_MSG_TYPE field */
|
/** the column name for the APP_MSG_TYPE field */
|
||||||
const APP_MSG_TYPE = 'APP_MESSAGE.APP_MSG_TYPE';
|
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 */
|
/** the column name for the APP_MSG_SUBJECT field */
|
||||||
const APP_MSG_SUBJECT = 'APP_MESSAGE.APP_MSG_SUBJECT';
|
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 */
|
/** the column name for the APP_MSG_STATUS field */
|
||||||
const APP_MSG_STATUS = 'APP_MESSAGE.APP_MSG_STATUS';
|
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 */
|
/** the column name for the APP_MSG_ATTACH field */
|
||||||
const APP_MSG_ATTACH = 'APP_MESSAGE.APP_MSG_ATTACH';
|
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 */
|
/** the column name for the APP_MSG_ERROR field */
|
||||||
const APP_MSG_ERROR = 'APP_MESSAGE.APP_MSG_ERROR';
|
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 */
|
/** the column name for the TAS_ID field */
|
||||||
const TAS_ID = 'APP_MESSAGE.TAS_ID';
|
const TAS_ID = 'APP_MESSAGE.TAS_ID';
|
||||||
|
|
||||||
@@ -102,10 +111,10 @@ abstract class BaseAppMessagePeer
|
|||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
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_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_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_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_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_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, )
|
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
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
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_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_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_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_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_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, )
|
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);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
|
$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);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ATTACH);
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ATTACH);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
||||||
@@ -255,6 +268,8 @@ abstract class BaseAppMessagePeer
|
|||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ERROR);
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ERROR);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(AppMessagePeer::PRO_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::TAS_ID);
|
$criteria->addSelectColumn(AppMessagePeer::TAS_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_NUMBER);
|
$criteria->addSelectColumn(AppMessagePeer::APP_NUMBER);
|
||||||
|
|||||||
@@ -337,6 +337,7 @@
|
|||||||
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
|
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||||
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="APP_MSG_TYPE" type="VARCHAR" size="100" required="true" default=""/>
|
<column name="APP_MSG_TYPE" type="VARCHAR" size="100" required="true" default=""/>
|
||||||
|
<column name="APP_MSG_TYPE_ID" type="TINYINT" required="false" default="0"/>
|
||||||
<column name="APP_MSG_SUBJECT" type="VARCHAR" size="150" required="true" default=""/>
|
<column name="APP_MSG_SUBJECT" type="VARCHAR" size="150" required="true" default=""/>
|
||||||
<column name="APP_MSG_FROM" type="VARCHAR" size="100" required="true" default=""/>
|
<column name="APP_MSG_FROM" type="VARCHAR" size="100" required="true" default=""/>
|
||||||
<column name="APP_MSG_TO" type="LONGVARCHAR" required="true"/>
|
<column name="APP_MSG_TO" type="LONGVARCHAR" required="true"/>
|
||||||
@@ -346,10 +347,12 @@
|
|||||||
<column name="APP_MSG_BCC" type="LONGVARCHAR" required="false"/>
|
<column name="APP_MSG_BCC" type="LONGVARCHAR" required="false"/>
|
||||||
<column name="APP_MSG_TEMPLATE" type="LONGVARCHAR" required="false"/>
|
<column name="APP_MSG_TEMPLATE" type="LONGVARCHAR" required="false"/>
|
||||||
<column name="APP_MSG_STATUS" type="VARCHAR" size="20"/>
|
<column name="APP_MSG_STATUS" type="VARCHAR" size="20"/>
|
||||||
|
<column name="APP_MSG_STATUS_ID" type="TINYINT" required="false" default="0"/>
|
||||||
<column name="APP_MSG_ATTACH" type="LONGVARCHAR" required="false"/>
|
<column name="APP_MSG_ATTACH" type="LONGVARCHAR" required="false"/>
|
||||||
<column name="APP_MSG_SEND_DATE" type="TIMESTAMP" required="true"/>
|
<column name="APP_MSG_SEND_DATE" type="TIMESTAMP" required="true"/>
|
||||||
<column name="APP_MSG_SHOW_MESSAGE" type="TINYINT" required="true" default="1"/>
|
<column name="APP_MSG_SHOW_MESSAGE" type="TINYINT" required="true" default="1"/>
|
||||||
<column name="APP_MSG_ERROR" type="LONGVARCHAR" required="false"/>
|
<column name="APP_MSG_ERROR" type="LONGVARCHAR" required="false"/>
|
||||||
|
<column name="PRO_ID" type="INTEGER" required="false" default="0"/>
|
||||||
<column name="TAS_ID" type="INTEGER" required="false" default="0"/>
|
<column name="TAS_ID" type="INTEGER" required="false" default="0"/>
|
||||||
<column name="APP_NUMBER" type="INTEGER" required="false" default="0"/>
|
<column name="APP_NUMBER" type="INTEGER" required="false" default="0"/>
|
||||||
<index name="indexForAppUid">
|
<index name="indexForAppUid">
|
||||||
@@ -358,12 +361,21 @@
|
|||||||
<index name="indexForMsgStatus">
|
<index name="indexForMsgStatus">
|
||||||
<index-column name="APP_MSG_STATUS"/>
|
<index-column name="APP_MSG_STATUS"/>
|
||||||
</index>
|
</index>
|
||||||
|
<index name="INDEX_PRO_ID">
|
||||||
|
<index-column name="PRO_ID"/>
|
||||||
|
</index>
|
||||||
<index name="INDEX_TAS_ID">
|
<index name="INDEX_TAS_ID">
|
||||||
<index-column name="TAS_ID"/>
|
<index-column name="TAS_ID"/>
|
||||||
</index>
|
</index>
|
||||||
<index name="INDEX_APP_NUMBER">
|
<index name="INDEX_APP_NUMBER">
|
||||||
<index-column name="APP_NUMBER"/>
|
<index-column name="APP_NUMBER"/>
|
||||||
</index>
|
</index>
|
||||||
|
<index name="INDEX_APP_MSG_TYPE_ID">
|
||||||
|
<index-column name="APP_MSG_STATUS_ID"/>
|
||||||
|
</index>
|
||||||
|
<index name="INDEX_APP_MSG_STATUS_ID">
|
||||||
|
<index-column name="APP_MSG_STATUS_ID"/>
|
||||||
|
</index>
|
||||||
</table>
|
</table>
|
||||||
<table name="APP_OWNER">
|
<table name="APP_OWNER">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ class adminProxy extends HttpProxyController
|
|||||||
{
|
{
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
|
|
||||||
$aConfiguration = array(
|
$configuration = [
|
||||||
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
'MESS_ENGINE' => $_POST['MESS_ENGINE'],
|
||||||
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
'MESS_SERVER' => $_POST['MESS_SERVER'],
|
||||||
'MESS_PORT' => $_POST['MESS_PORT'],
|
'MESS_PORT' => $_POST['MESS_PORT'],
|
||||||
@@ -592,12 +592,11 @@ class adminProxy extends HttpProxyController
|
|||||||
'MESS_FROM_MAIL' => $_POST["FROM_EMAIL"],
|
'MESS_FROM_MAIL' => $_POST["FROM_EMAIL"],
|
||||||
'MESS_RAUTH' => $_POST['MESS_RAUTH'],
|
'MESS_RAUTH' => $_POST['MESS_RAUTH'],
|
||||||
'SMTPSecure' => isset($_POST['SMTPSecure'])?$_POST['SMTPSecure']:'none'
|
'SMTPSecure' => isset($_POST['SMTPSecure'])?$_POST['SMTPSecure']:'none'
|
||||||
);
|
];
|
||||||
|
|
||||||
$sFrom = G::buildFrom($aConfiguration);
|
$from = G::buildFrom($configuration);
|
||||||
|
$subject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
||||||
$sSubject = G::LoadTranslation('ID_MESS_TEST_SUBJECT');
|
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
||||||
$msg = G::LoadTranslation('ID_MESS_TEST_BODY');
|
|
||||||
|
|
||||||
switch ($_POST['MESS_ENGINE']) {
|
switch ($_POST['MESS_ENGINE']) {
|
||||||
case 'MAIL':
|
case 'MAIL':
|
||||||
@@ -611,50 +610,46 @@ class adminProxy extends HttpProxyController
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sBodyPre = new TemplatePower(PATH_TPL . 'admin' . PATH_SEP . 'email.tpl');
|
$sBodyPre = new TemplatePower(PATH_TPL . 'admin' . PATH_SEP . 'email.tpl');
|
||||||
$sBodyPre->prepare();
|
$sBodyPre->prepare();
|
||||||
$sBodyPre->assign('server', $_SERVER['SERVER_NAME']);
|
$sBodyPre->assign('server', $_SERVER['SERVER_NAME']);
|
||||||
$sBodyPre->assign('date', date('H:i:s'));
|
$sBodyPre->assign('date', date('H:i:s'));
|
||||||
$sBodyPre->assign('ver', System::getVersion());
|
$sBodyPre->assign('ver', System::getVersion());
|
||||||
$sBodyPre->assign('engine', $engine);
|
$sBodyPre->assign('engine', $engine);
|
||||||
$sBodyPre->assign('msg', $msg);
|
$sBodyPre->assign('msg', $msg);
|
||||||
$sBody = $sBodyPre->getOutputContent();
|
$body = $sBodyPre->getOutputContent();
|
||||||
|
|
||||||
$oSpool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
|
$spool->setConfig($configuration);
|
||||||
$oSpool->setConfig($aConfiguration);
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
|
'',
|
||||||
$oSpool->create(
|
'',
|
||||||
array(
|
'',
|
||||||
'msg_uid' => '',
|
'TEST',
|
||||||
'app_uid' => '',
|
$subject,
|
||||||
'del_index' => 0,
|
$from,
|
||||||
'app_msg_type' => 'TEST',
|
$_POST['TO'],
|
||||||
'app_msg_subject' => $sSubject,
|
$body,
|
||||||
'app_msg_from' => $sFrom,
|
'',
|
||||||
'app_msg_to' => $_POST['TO'],
|
'',
|
||||||
'app_msg_body' => $sBody,
|
'',
|
||||||
'app_msg_cc' => '',
|
'',
|
||||||
'app_msg_bcc' => '',
|
'pending'
|
||||||
'app_msg_attach' => '',
|
|
||||||
'app_msg_template' => '',
|
|
||||||
'app_msg_status' => 'pending',
|
|
||||||
'app_msg_attach'=>'' // Added By Ankit
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
$spool->create($messageArray);
|
||||||
|
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
|
|
||||||
$o = new stdclass();
|
$o = new stdclass();
|
||||||
if ($oSpool->status == 'sent') {
|
if ($spool->status == 'sent') {
|
||||||
$o->status = true;
|
$o->status = true;
|
||||||
$o->success = true;
|
$o->success = true;
|
||||||
$o->msg = G::LoadTranslation('ID_MAIL_TEST_SUCCESS');
|
$o->msg = G::LoadTranslation('ID_MAIL_TEST_SUCCESS');
|
||||||
} else {
|
} else {
|
||||||
$o->status = false;
|
$o->status = false;
|
||||||
$o->success = false;
|
$o->success = false;
|
||||||
$o->msg = $oSpool->error;
|
$o->msg = $spool->error;
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ CREATE TABLE `APP_MESSAGE`
|
|||||||
`APP_UID` VARCHAR(32) default '' NOT NULL,
|
`APP_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`DEL_INDEX` INTEGER default 0 NOT NULL,
|
`DEL_INDEX` INTEGER default 0 NOT NULL,
|
||||||
`APP_MSG_TYPE` VARCHAR(100) default '' 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_SUBJECT` VARCHAR(150) default '' NOT NULL,
|
||||||
`APP_MSG_FROM` VARCHAR(100) default '' NOT NULL,
|
`APP_MSG_FROM` VARCHAR(100) default '' NOT NULL,
|
||||||
`APP_MSG_TO` MEDIUMTEXT NOT NULL,
|
`APP_MSG_TO` MEDIUMTEXT NOT NULL,
|
||||||
@@ -159,17 +160,22 @@ CREATE TABLE `APP_MESSAGE`
|
|||||||
`APP_MSG_BCC` MEDIUMTEXT,
|
`APP_MSG_BCC` MEDIUMTEXT,
|
||||||
`APP_MSG_TEMPLATE` MEDIUMTEXT,
|
`APP_MSG_TEMPLATE` MEDIUMTEXT,
|
||||||
`APP_MSG_STATUS` VARCHAR(20),
|
`APP_MSG_STATUS` VARCHAR(20),
|
||||||
|
`APP_MSG_STATUS_ID` TINYINT default 0,
|
||||||
`APP_MSG_ATTACH` MEDIUMTEXT,
|
`APP_MSG_ATTACH` MEDIUMTEXT,
|
||||||
`APP_MSG_SEND_DATE` DATETIME NOT NULL,
|
`APP_MSG_SEND_DATE` DATETIME NOT NULL,
|
||||||
`APP_MSG_SHOW_MESSAGE` TINYINT default 1 NOT NULL,
|
`APP_MSG_SHOW_MESSAGE` TINYINT default 1 NOT NULL,
|
||||||
`APP_MSG_ERROR` MEDIUMTEXT,
|
`APP_MSG_ERROR` MEDIUMTEXT,
|
||||||
|
`PRO_ID` INTEGER default 0,
|
||||||
`TAS_ID` INTEGER default 0,
|
`TAS_ID` INTEGER default 0,
|
||||||
`APP_NUMBER` INTEGER default 0,
|
`APP_NUMBER` INTEGER default 0,
|
||||||
PRIMARY KEY (`APP_MSG_UID`),
|
PRIMARY KEY (`APP_MSG_UID`),
|
||||||
KEY `indexForAppUid`(`APP_UID`),
|
KEY `indexForAppUid`(`APP_UID`),
|
||||||
KEY `indexForMsgStatus`(`APP_MSG_STATUS`),
|
KEY `indexForMsgStatus`(`APP_MSG_STATUS`),
|
||||||
|
KEY `INDEX_PRO_ID`(`PRO_ID`),
|
||||||
KEY `INDEX_TAS_ID`(`TAS_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';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Messages in an Application';
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#-- APP_OWNER
|
#-- APP_OWNER
|
||||||
|
|||||||
@@ -15,32 +15,30 @@ $actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
|||||||
|
|
||||||
switch ($actionAjax) {
|
switch ($actionAjax) {
|
||||||
case 'messageHistoryGridList_JXP':
|
case 'messageHistoryGridList_JXP':
|
||||||
if (!isset($_REQUEST['start']) || $_REQUEST['start'] == '') {
|
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||||
$_REQUEST['start'] = 0;
|
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 20;
|
||||||
}
|
$dir = isset($_POST['dir']) ? $_POST['dir'] : 'DESC';
|
||||||
|
|
||||||
if (!isset($_REQUEST['limit']) || $_REQUEST['limit'] == '') {
|
|
||||||
$_REQUEST['limit'] = 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
$dir = isset($_POST['dir']) ? $_POST['dir'] : 'ASC';
|
|
||||||
$sort = isset($_POST['sort']) ? $_POST['sort'] : '';
|
$sort = isset($_POST['sort']) ? $_POST['sort'] : '';
|
||||||
|
|
||||||
global $G_PUBLISH;
|
global $G_PUBLISH;
|
||||||
$case = new Cases();
|
$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'];
|
$proUid = $_SESSION['PROCESS'];
|
||||||
$appUid = $_SESSION['APPLICATION'];
|
$appUid = $_SESSION['APPLICATION'];
|
||||||
$tasUid = $_SESSION['TASK'];
|
$tasUid = $_SESSION['TASK'];
|
||||||
$usrUid = $_SESSION['USER_LOGGED'];
|
$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');
|
$respBlock = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'BLOCK');
|
||||||
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
|
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
|
||||||
@@ -70,37 +68,31 @@ switch ($actionAjax) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$totalCount = 0;
|
$messageList = [];
|
||||||
foreach ($appMessageArray as $index => $value) {
|
foreach ($appMessageArray as $index => &$value) {
|
||||||
if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK') &&
|
if (
|
||||||
($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex))) {
|
($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'];
|
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||||
if ($respMess == 'BLOCK' || $respMess == '') {
|
if ($respMess == 'BLOCK' || $respMess == '') {
|
||||||
$appMessageArray[$index]['APP_MSG_BODY'] = '';
|
$appMessageArray[$index]['APP_MSG_BODY'] = '';
|
||||||
}
|
}
|
||||||
$process[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
|
$messageList[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
|
||||||
$totalCount++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$process = array_splice($process, $_REQUEST['start'], $_REQUEST['limit']);
|
|
||||||
|
|
||||||
$response = new stdclass();
|
$response = new stdclass();
|
||||||
$response->data = $process;
|
$response->data = $messageList;
|
||||||
$response->totalCount = $totalCount;
|
$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);
|
echo G::json_encode($response);
|
||||||
break;
|
break;
|
||||||
case 'showHistoryMessage':
|
case 'showHistoryMessage':
|
||||||
|
|||||||
@@ -2,28 +2,10 @@
|
|||||||
/**
|
/**
|
||||||
* cases_Derivate.php
|
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* 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'])) {
|
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||||
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
|
G::SendTemporalMessage('ID_LOGIN_AGAIN', 'warning', 'labels');
|
||||||
die( '<script type="text/javascript">
|
die('<script type="text/javascript">
|
||||||
var olink = document.location.href;
|
var olink = document.location.href;
|
||||||
olink = ( olink.search("gmail") == -1 ) ? parent.document.location.href : olink;
|
olink = ( olink.search("gmail") == -1 ) ? parent.document.location.href : olink;
|
||||||
if(olink.search("gmail") == -1){
|
if(olink.search("gmail") == -1){
|
||||||
@@ -50,16 +32,17 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
|||||||
}
|
}
|
||||||
</script>');
|
</script>');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Permissions */
|
/* Permissions */
|
||||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
switch ($RBAC->userCanAccess('PM_CASES')) {
|
||||||
case - 2:
|
case -2:
|
||||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||||
G::header( 'location: ../login/login' );
|
G::header('location: ../login/login');
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
case - 1:
|
case -1:
|
||||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header( 'location: ../login/login' );
|
G::header('location: ../login/login');
|
||||||
die();
|
die();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -67,37 +50,38 @@ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
|||||||
/* Includes */
|
/* Includes */
|
||||||
//If no variables are submitted and the $_POST variable is empty
|
//If no variables are submitted and the $_POST variable is empty
|
||||||
if (!isset($_POST['form'])) {
|
if (!isset($_POST['form'])) {
|
||||||
$_POST['form'] = array();
|
$_POST['form'] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GET , POST & $_SESSION Vars */
|
/* GET , POST & $_SESSION Vars */
|
||||||
/* Process the info */
|
/* Process the info */
|
||||||
$sStatus = 'TO_DO';
|
$sStatus = 'TO_DO';
|
||||||
foreach ($_POST['form']['TASKS'] as $aValues) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Load Session variables
|
||||||
|
$processUid = isset($_SESSION['PROCESS']) ? $_SESSION['PROCESS'] : '';
|
||||||
//load data
|
//load data
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
//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');
|
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
|
||||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
$appFields = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||||
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
$appFields['APP_DATA'] = array_merge($appFields['APP_DATA'], G::getSystemConstants());
|
||||||
//cleaning debug variables
|
//cleaning debug variables
|
||||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
|
$_SESSION['TRIGGER_DEBUG']['DATA'] = [];
|
||||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
|
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = [];
|
||||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
|
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = [];
|
||||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
|
$_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 there are some triggers to execute
|
||||||
if (sizeof( $triggers ) > 0) {
|
if (sizeof($triggers) > 0) {
|
||||||
//Execute triggers before derivation
|
//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
|
//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]['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_NAMES'] = array_column($triggers, 'TRI_TITLE');
|
||||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
||||||
@@ -110,27 +94,27 @@ try {
|
|||||||
unset($appFields['APP_PIN']);
|
unset($appFields['APP_PIN']);
|
||||||
|
|
||||||
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
|
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
|
||||||
$appFields["TAS_UID"] = $_SESSION["TASK"];
|
$appFields["TAS_UID"] = $_SESSION["TASK"];
|
||||||
$appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
|
$appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
|
||||||
$appFields["CURRENT_DYNAFORM"] = "-2";
|
$appFields["CURRENT_DYNAFORM"] = "-2";
|
||||||
$appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
|
$appFields["OBJECT_TYPE"] = "ASSIGN_TASK";
|
||||||
|
|
||||||
$oCase->updateCase($_SESSION["APPLICATION"], $appFields); //Save data
|
$oCase->updateCase($_SESSION["APPLICATION"], $appFields); //Save data
|
||||||
|
|
||||||
//Prepare information for the derivation
|
//Prepare information for the derivation
|
||||||
$oDerivation = new Derivation();
|
$oDerivation = new Derivation();
|
||||||
$aCurrentDerivation = array (
|
$aCurrentDerivation = [
|
||||||
'APP_UID' => $_SESSION['APPLICATION'],
|
'APP_UID' => $_SESSION['APPLICATION'],
|
||||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||||
'APP_STATUS' => $sStatus,
|
'APP_STATUS' => $sStatus,
|
||||||
'TAS_UID' => $_SESSION['TASK'],
|
'TAS_UID' => $_SESSION['TASK'],
|
||||||
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
||||||
);
|
];
|
||||||
$aDataForPrepareInfo = array (
|
$aDataForPrepareInfo = [
|
||||||
'USER_UID' => $_SESSION['USER_LOGGED'],
|
'USER_UID' => $_SESSION['USER_LOGGED'],
|
||||||
'APP_UID' => $_SESSION['APPLICATION'],
|
'APP_UID' => $_SESSION['APPLICATION'],
|
||||||
'DEL_INDEX' => $_SESSION['INDEX']
|
'DEL_INDEX' => $_SESSION['INDEX']
|
||||||
);
|
];
|
||||||
|
|
||||||
//We define some parameters in the before the derivation
|
//We define some parameters in the before the derivation
|
||||||
//Then this function will be route the case
|
//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
|
$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
|
$triggers = $oCase->loadTriggers($_SESSION['TASK'], 'ASSIGN_TASK', -2,
|
||||||
if (sizeof( $triggers ) > 0) {
|
'AFTER'); //load the triggers after derivation
|
||||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER', $appFields['APP_DATA'] ); //Execute 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]['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_NAMES'] = array_column($triggers, 'TRI_TITLE');
|
||||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
||||||
@@ -172,12 +158,12 @@ try {
|
|||||||
unset($appFields['APP_PIN']);
|
unset($appFields['APP_PIN']);
|
||||||
|
|
||||||
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
|
$appFields["DEL_INDEX"] = $_SESSION["INDEX"];
|
||||||
$appFields["TAS_UID"] = $_SESSION["TASK"];
|
$appFields["TAS_UID"] = $_SESSION["TASK"];
|
||||||
$appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
|
$appFields["USER_UID"] = $_SESSION["USER_LOGGED"];
|
||||||
$appFields["CURRENT_DYNAFORM"] = "-2";
|
$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
|
// Send notifications - Start
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
@@ -188,20 +174,21 @@ try {
|
|||||||
|
|
||||||
$flagGmail = false;
|
$flagGmail = false;
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$licensedFeatures = &PMLicensedFeatures::getSingleton ();
|
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||||
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
|
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||||
$pmGoogle = new PmGoogleApi ();
|
$pmGoogle = new PmGoogleApi ();
|
||||||
if ($pmGoogle->getServiceGmailStatus ()) {
|
if ($pmGoogle->getServiceGmailStatus()) {
|
||||||
$flagGmail = true;
|
$flagGmail = true;
|
||||||
|
|
||||||
$appDel = new AppDelegation ();
|
$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 ();
|
$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'])) {
|
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 {
|
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) {
|
} 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
|
// Send notifications - End
|
||||||
// Events - Start
|
// Events - Start
|
||||||
$oEvent = new Event();
|
$oEvent = new Event();
|
||||||
|
|
||||||
$oEvent->closeAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
|
$oEvent->closeAppEvents($processUid, $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
|
||||||
$oCurrentAppDel = AppDelegationPeer::retrieveByPk( $_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1 );
|
$oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1);
|
||||||
$multipleDelegation = false;
|
$multipleDelegation = false;
|
||||||
// check if there are multiple derivations
|
// check if there are multiple derivations
|
||||||
if (count( $_POST['form']['TASKS'] ) > 1) {
|
if (count($_POST['form']['TASKS']) > 1) {
|
||||||
$multipleDelegation = true;
|
$multipleDelegation = true;
|
||||||
}
|
}
|
||||||
// If the case has been delegated
|
// 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 there is just a single derivation the TASK_UID can be set by the delegation data
|
||||||
if (! $multipleDelegation) {
|
if (!$multipleDelegation) {
|
||||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
$aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID'] );
|
$oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'],
|
||||||
|
$aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID']);
|
||||||
} else {
|
} else {
|
||||||
// else we need to check every task and create the events if it have any
|
// else we need to check every task and create the events if it have any
|
||||||
foreach ($_POST['form']['TASKS'] as $taskDelegated) {
|
foreach ($_POST['form']['TASKS'] as $taskDelegated) {
|
||||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
$aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID'] );
|
$oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'],
|
||||||
|
$aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,16 +254,18 @@ try {
|
|||||||
$debuggerAvailable = true;
|
$debuggerAvailable = true;
|
||||||
|
|
||||||
$casesRedirector = 'casesListExtJsRedirector';
|
$casesRedirector = 'casesListExtJsRedirector';
|
||||||
if (isset ( $_SESSION ['user_experience'] ) && $flagGmail === false) {
|
if (isset ($_SESSION ['user_experience']) && $flagGmail === false) {
|
||||||
$aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience'];
|
$aNextStep ['PAGE'] = $casesRedirector . '?ux=' . $_SESSION ['user_experience'];
|
||||||
$debuggerAvailable = false;
|
$debuggerAvailable = false;
|
||||||
} else if ($flagGmail === true) {
|
|
||||||
$aNextStep ['PAGE'] = $casesRedirector . '?gmail=1';
|
|
||||||
} else {
|
} 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'];
|
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||||
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
|
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
|
||||||
} else {
|
} else {
|
||||||
@@ -275,26 +274,26 @@ try {
|
|||||||
//Triggers After
|
//Triggers After
|
||||||
$isIE = Bootstrap::isIE();
|
$isIE = Bootstrap::isIE();
|
||||||
|
|
||||||
if (isset( $_SESSION['TRIGGER_DEBUG']['ISSET'] ) && !$isIE) {
|
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && !$isIE) {
|
||||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
|
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();
|
$oTemplatePower->prepare();
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
|
||||||
$_POST['NextStep'] = $loc;
|
$_POST['NextStep'] = $loc;
|
||||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
|
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
|
||||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
|
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
|
||||||
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
|
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
|
||||||
G::RenderPage( 'publish', 'blank' );
|
G::RenderPage('publish', 'blank');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
unset( $_SESSION['TRIGGER_DEBUG'] );
|
unset($_SESSION['TRIGGER_DEBUG']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//close tab only if IE11
|
//close tab only if IE11
|
||||||
|
|
||||||
if($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__'])) {
|
if ($isIE && !isset($_SESSION['__OUTLOOK_CONNECTOR__'])) {
|
||||||
$script = "<script type='text/javascript'>
|
$script = "<script type='text/javascript'>
|
||||||
try {
|
try {
|
||||||
if(top.opener) {
|
if(top.opener) {
|
||||||
@@ -307,11 +306,11 @@ try {
|
|||||||
die($script);
|
die($script);
|
||||||
}
|
}
|
||||||
|
|
||||||
G::header( "location: $loc" );
|
G::header("location: $loc");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$aMessage = array ();
|
$aMessage = [];
|
||||||
$aMessage['MESSAGE'] = $e->getMessage();
|
$aMessage['MESSAGE'] = $e->getMessage();
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||||
G::RenderPage( 'publish', 'blank' );
|
G::RenderPage('publish', 'blank');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ $userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
|||||||
$userExists = $userData === false ? false : true;
|
$userExists = $userData === false ? false : true;
|
||||||
|
|
||||||
if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL')) {
|
if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL')) {
|
||||||
$aSetup = System::getEmailConfiguration();
|
$setup = System::getEmailConfiguration();
|
||||||
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
if (count($setup) == 0 || !isset($setup['MESS_ENGINE'])) {
|
||||||
G::SendTemporalMessage('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
G::SendTemporalMessage('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
||||||
G::header('location: forgotPassword');
|
G::header('location: forgotPassword');
|
||||||
die;
|
die;
|
||||||
@@ -21,25 +21,26 @@ if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL
|
|||||||
|
|
||||||
$newPass = G::generate_password();
|
$newPass = G::generate_password();
|
||||||
|
|
||||||
$aData['USR_UID'] = $userData['USR_UID'];
|
$infoUser = [];
|
||||||
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($newPass);
|
$infoUser['USR_UID'] = $userData['USR_UID'];
|
||||||
$oUserProperty = new UsersProperties();
|
$infoUser['USR_PASSWORD'] = Bootstrap::hashPassword($newPass);
|
||||||
$aUserPropertyData = $oUserProperty->load($aData['USR_UID']);
|
$userProperty = new UsersProperties();
|
||||||
|
$aUserPropertyData = $userProperty->load($infoUser['USR_UID']);
|
||||||
if (is_array($aUserPropertyData)) {
|
if (is_array($aUserPropertyData)) {
|
||||||
$aUserPropertyData['USR_LOGGED_NEXT_TIME'] = 1;
|
$aUserPropertyData['USR_LOGGED_NEXT_TIME'] = 1;
|
||||||
$oUserProperty = $oUserProperty->update($aUserPropertyData);
|
$userProperty = $userProperty->update($aUserPropertyData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($sFrom)) {
|
if (!isset($from)) {
|
||||||
$sFrom = '';
|
$from = '';
|
||||||
}
|
}
|
||||||
$sFrom = G::buildFrom($aSetup, $sFrom);
|
$from = G::buildFrom($setup, $from);
|
||||||
|
|
||||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD') . ' - ProcessMaker';
|
$subject = G::LoadTranslation('ID_RESET_PASSWORD') . ' - ProcessMaker';
|
||||||
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
||||||
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_USERMANE_IS') . ' : <strong>' . $userData['USR_USERNAME'] . '</strong></p>';
|
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_USERMANE_IS') . ' : <strong>' . $userData['USR_USERNAME'] . '</strong></p>';
|
||||||
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_PASSWORD_IS') . ' : <strong>' . $newPass . '</strong></p>';
|
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_PASSWORD_IS') . ' : <strong>' . $newPass . '</strong></p>';
|
||||||
switch ($aSetup['MESS_ENGINE']) {
|
switch ($setup['MESS_ENGINE']) {
|
||||||
case 'MAIL':
|
case 'MAIL':
|
||||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||||
break;
|
break;
|
||||||
@@ -51,7 +52,7 @@ if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sBody = "
|
$body = "
|
||||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||||
<tbody><tr><td><img id='logo' src='http://" . $_SERVER['SERVER_NAME'] . "/images/processmaker.logo.jpg' /></td></tr>
|
<tbody><tr><td><img id='logo' src='http://" . $_SERVER['SERVER_NAME'] . "/images/processmaker.logo.jpg' /></td></tr>
|
||||||
<tr><td style='font-size: 14px;'>$msg</td></tr>
|
<tr><td style='font-size: 14px;'>$msg</td></tr>
|
||||||
@@ -60,30 +61,30 @@ if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL
|
|||||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||||
</tr></tbody></table>";
|
</tr></tbody></table>";
|
||||||
|
|
||||||
$oSpool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
|
|
||||||
$oSpool->setConfig($aSetup);
|
$spool->setConfig($setup);
|
||||||
$oSpool->create(array(
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
'msg_uid' => '',
|
'',
|
||||||
'app_uid' => '',
|
'',
|
||||||
'del_index' => 0,
|
0,
|
||||||
'app_msg_type' => 'TEST',
|
'TEST',
|
||||||
'app_msg_subject' => $sSubject,
|
$subject,
|
||||||
'app_msg_from' => $sFrom,
|
$from,
|
||||||
'app_msg_to' => $data['USR_EMAIL'],
|
$data['USR_EMAIL'],
|
||||||
'app_msg_body' => $sBody,
|
$body,
|
||||||
'app_msg_cc' => '',
|
'',
|
||||||
'app_msg_bcc' => '',
|
'',
|
||||||
'app_msg_attach' => '',
|
'',
|
||||||
'app_msg_template' => '',
|
'',
|
||||||
'app_msg_status' => 'pending',
|
'pending'
|
||||||
'app_msg_attach' => ''
|
);
|
||||||
));
|
$spool->create($messageArray);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($infoUser);
|
||||||
$user->update($aData);
|
$user->update($infoUser);
|
||||||
G::header("location: login");
|
G::header("location: login");
|
||||||
G::SendTemporalMessage('ID_NEW_PASSWORD_SENT', "info");
|
G::SendTemporalMessage('ID_NEW_PASSWORD_SENT', "info");
|
||||||
} catch (phpmailerException $e) {
|
} catch (phpmailerException $e) {
|
||||||
|
|||||||
@@ -22,18 +22,18 @@ $G_ID_SUB_MENU_SELECTED = 'EMAILS';
|
|||||||
|
|
||||||
//get values for the comboBoxes
|
//get values for the comboBoxes
|
||||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||||
$status = array(
|
|
||||||
array('', G::LoadTranslation('ID_ALL')),
|
|
||||||
array("sent", G::LoadTranslation('ID_SENT')),
|
|
||||||
array("pending", G::LoadTranslation('ID_PENDING'))
|
|
||||||
);
|
|
||||||
|
|
||||||
|
//Get the status values
|
||||||
|
$status = AppMessage::getAllStatus();
|
||||||
|
|
||||||
|
//Get the process values
|
||||||
|
$process = new BmProcess();
|
||||||
|
$processes = $process->getProcessList('', true);
|
||||||
|
|
||||||
|
//Review if the plugin External is enable
|
||||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||||
$flagER = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
$flagER = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||||
|
|
||||||
$process = new BmProcess();
|
|
||||||
$processes = $process->getProcessList();
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
|
|
||||||
$oHeadPublisher = &headPublisher::getSingleton();
|
$oHeadPublisher = &headPublisher::getSingleton();
|
||||||
|
|||||||
@@ -21,23 +21,15 @@ switch ($req) {
|
|||||||
case 'MessageList':
|
case 'MessageList':
|
||||||
$start = (isset($_REQUEST['start'])) ? $_REQUEST['start'] : '0';
|
$start = (isset($_REQUEST['start'])) ? $_REQUEST['start'] : '0';
|
||||||
$limit = (isset($_REQUEST['limit'])) ? $_REQUEST['limit'] : '25';
|
$limit = (isset($_REQUEST['limit'])) ? $_REQUEST['limit'] : '25';
|
||||||
$proUid = (isset($_REQUEST['process'])) ? $_REQUEST['process'] : '';
|
$proId = (isset($_REQUEST['process'])) ? $_REQUEST['process'] : '';
|
||||||
$eventype = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : '';
|
$eventype = (isset($_REQUEST['type'])) ? $_REQUEST['type'] : '';
|
||||||
$emailStatus = (isset($_REQUEST['status'])) ? $_REQUEST['status'] : '';
|
$msgStatusId = (isset($_REQUEST['status'])) ? $_REQUEST['status'] : '';
|
||||||
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||||
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||||
$dateFrom = isset($_POST["dateFrom"]) ? substr($_POST["dateFrom"], 0, 10) : "";
|
$dateFrom = isset($_POST["dateFrom"]) ? substr($_POST["dateFrom"], 0, 10) : "";
|
||||||
$dateTo = isset($_POST["dateTo"]) ? substr($_POST["dateTo"], 0, 10) : "";
|
$dateTo = isset($_POST["dateTo"]) ? substr($_POST["dateTo"], 0, 10) : "";
|
||||||
$filterBy = (isset($_REQUEST['filterBy'])) ? $_REQUEST['filterBy'] : 'ALL';
|
$filterBy = (isset($_REQUEST['filterBy'])) ? $_REQUEST['filterBy'] : 'ALL';
|
||||||
|
|
||||||
//Review the External Registration
|
|
||||||
$arrayType = [];
|
|
||||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
|
||||||
$flagEr = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
|
||||||
if ($flagEr == 0) {
|
|
||||||
$arrayType[] = 'EXTERNAL_REGISTRATION';
|
|
||||||
}
|
|
||||||
|
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
|
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
|
||||||
$criteria->addSelectColumn(AppMessagePeer::APP_UID);
|
$criteria->addSelectColumn(AppMessagePeer::APP_UID);
|
||||||
@@ -58,31 +50,33 @@ switch ($req) {
|
|||||||
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||||
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
|
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
|
||||||
$criteria->addJoin(ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
|
||||||
$criteria->addJoin(AppMessagePeer::TAS_ID, TaskPeer::TAS_ID, Criteria::LEFT_JOIN);
|
$criteria->addJoin(AppMessagePeer::TAS_ID, TaskPeer::TAS_ID, Criteria::LEFT_JOIN);
|
||||||
|
$criteria->addJoin(AppMessagePeer::PRO_ID, ProcessPeer::PRO_ID, Criteria::LEFT_JOIN);
|
||||||
|
|
||||||
//Status can be: All, Participated, Pending
|
//Status can be: All, Participated, Pending, Failed
|
||||||
if (!empty($emailStatus)) {
|
if (!empty($msgStatusId)) {
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_STATUS, $emailStatus);
|
$criteria->add(AppMessagePeer::APP_MSG_STATUS_ID, $msgStatusId);
|
||||||
}
|
}
|
||||||
//Process uid
|
//Process uid
|
||||||
if (!empty($proUid)) {
|
if (!empty($proId)) {
|
||||||
$criteria->add(ApplicationPeer::PRO_UID, $proUid);
|
$criteria->add(AppMessagePeer::PRO_ID, $proId);
|
||||||
}
|
}
|
||||||
//Filter by can be: All, Cases, Test
|
//Filter by can be: All, Cases, Test
|
||||||
switch ($filterBy) {
|
switch ($filterBy) {
|
||||||
case 'CASES':
|
case 'CASES': //TRIGGER and DERIVATION
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, ['TEST', 'EXTERNAL_REGISTRATION'], Criteria::NOT_IN);
|
$criteria->add(AppMessagePeer::APP_MSG_TYPE_ID, [AppMessage::TYPE_TRIGGER, AppMessage::TYPE_DERIVATION], Criteria::IN);
|
||||||
break;
|
break;
|
||||||
case 'TEST':
|
case 'TEST':
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, 'TEST', Criteria::EQUAL);
|
$criteria->add(AppMessagePeer::APP_MSG_TYPE_ID, AppMessage::TYPE_TEST, Criteria::EQUAL);
|
||||||
break;
|
break;
|
||||||
case 'EXTERNAL-REGISTRATION':
|
case 'EXTERNAL-REGISTRATION':
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, 'EXTERNAL_REGISTRATION', Criteria::EQUAL);
|
$criteria->add(AppMessagePeer::APP_MSG_TYPE_ID, AppMessage::TYPE_EXTERNAL_REGISTRATION, Criteria::EQUAL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!empty($arrayType)) {
|
//Review the External Registration
|
||||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, $arrayType, Criteria::NOT_IN);
|
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||||
|
if (!$pluginRegistry->isEnable('externalRegistration')) {
|
||||||
|
$criteria->add(AppMessagePeer::APP_MSG_TYPE_ID, AppMessage::TYPE_EXTERNAL_REGISTRATION, Criteria::NOT_EQUAL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -157,9 +151,9 @@ switch ($req) {
|
|||||||
die(G::json_encode($response));
|
die(G::json_encode($response));
|
||||||
break;
|
break;
|
||||||
case 'updateStatusMessage':
|
case 'updateStatusMessage':
|
||||||
if (isset($_REQUEST['APP_MSG_UID']) && isset($_REQUEST['APP_MSG_STATUS'])) {
|
if (isset($_REQUEST['APP_MSG_UID']) && isset($_REQUEST['APP_MSG_STATUS_ID'])) {
|
||||||
$message = new AppMessage();
|
$message = new AppMessage();
|
||||||
$result = $message->updateStatus($_REQUEST['APP_MSG_UID'], $_REQUEST['APP_MSG_STATUS']);
|
$result = $message->updateStatus($_REQUEST['APP_MSG_UID'], $_REQUEST['APP_MSG_STATUS_ID']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,10 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
|||||||
$ws = new WsBase();
|
$ws = new WsBase();
|
||||||
|
|
||||||
$result = $ws->derivateCase(
|
$result = $ws->derivateCase(
|
||||||
$caseFieldsABE['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'], true
|
$caseFieldsABE['CURRENT_USER_UID'],
|
||||||
|
$_REQUEST['APP_UID'],
|
||||||
|
$_REQUEST['DEL_INDEX'],
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$code = (is_array($result))? $result['status_code'] : $result->status_code;
|
$code = (is_array($result))? $result['status_code'] : $result->status_code;
|
||||||
@@ -101,9 +104,9 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
|||||||
$response = new stdClass();
|
$response = new stdClass();
|
||||||
$response->usrUid = $caseFieldsABE['APP_DATA']['USER_LOGGED'];
|
$response->usrUid = $caseFieldsABE['APP_DATA']['USER_LOGGED'];
|
||||||
$response->appUid = $_REQUEST['APP_UID'];
|
$response->appUid = $_REQUEST['APP_UID'];
|
||||||
|
$response->delIndex = $_REQUEST['DEL_INDEX'];
|
||||||
$response->noteText = 'Check the information that was sent for the receiver: ' .
|
$response->noteText = 'Check the information that was sent for the receiver: ' .
|
||||||
$dataAbeRequests['ABE_REQ_SENT_TO'];
|
$dataAbeRequests['ABE_REQ_SENT_TO'];
|
||||||
|
|
||||||
postNote($response);
|
postNote($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,28 +5,7 @@ if (PMLicensedFeatures
|
|||||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
try {
|
try {
|
||||||
/**
|
|
||||||
* $backupSession = serialize($_SESSION);
|
|
||||||
* This script runs with $ _SESSION ['USER_LOGGED'] = '00000000000000000000000000000001',
|
|
||||||
* this action enables login as admin if you enter the url 'http://myserver.net/sysworkflow/en/neoclassic/processes/main',
|
|
||||||
* in the Browser that invoked this script.
|
|
||||||
* This action ensures that any changes to the session variables required by
|
|
||||||
* this script do not affect the main session if it exists, for example
|
|
||||||
* when multiple tabs are open.
|
|
||||||
* Serialization is used because for object types the simple assignment:
|
|
||||||
* $backupSession = $ _SESSION will not work because the assignment is by
|
|
||||||
* reference, eg:
|
|
||||||
* <?php
|
|
||||||
* $obj = new stdClass();
|
|
||||||
* $obj->value = "value";
|
|
||||||
*
|
|
||||||
* $a = ["one" => 1, "two" => $obj, "three" => 3];
|
|
||||||
* $b = $a;
|
|
||||||
|
|
||||||
* $a["two"]->value = "modify";
|
|
||||||
*
|
|
||||||
* In 'b' is reflected the output of 'a'.
|
|
||||||
*/
|
|
||||||
$backupSession = serialize($_SESSION);
|
$backupSession = serialize($_SESSION);
|
||||||
|
|
||||||
if (empty($_GET['APP_UID'])) {
|
if (empty($_GET['APP_UID'])) {
|
||||||
@@ -52,46 +31,19 @@ if (PMLicensedFeatures
|
|||||||
$aber = G::decrypt($_REQUEST['ABER'], URL_KEY);
|
$aber = G::decrypt($_REQUEST['ABER'], URL_KEY);
|
||||||
$forms = isset($_REQUEST['form']) ? $_REQUEST['form'] : [];
|
$forms = isset($_REQUEST['form']) ? $_REQUEST['form'] : [];
|
||||||
|
|
||||||
|
//Load data related to the case
|
||||||
$case = new Cases();
|
$case = new Cases();
|
||||||
$casesFields = $case->loadCase($appUid, $delIndex);
|
$casesFields = $case->loadCase($appUid, $delIndex);
|
||||||
|
|
||||||
$casesFields['APP_DATA'] = array_merge($casesFields['APP_DATA'], $forms);
|
$casesFields['APP_DATA'] = array_merge($casesFields['APP_DATA'], $forms);
|
||||||
|
|
||||||
//Get user info
|
//Get current user info
|
||||||
$current_user_uid = null;
|
$delegation = new AppDelegation();
|
||||||
$currentUsrName = null;
|
$currentUsrUid = $delegation->getUserAssignedInThread($appUid, $delIndex);
|
||||||
|
if (!is_null($currentUsrUid)) {
|
||||||
$criteria = new Criteria("workflow");
|
$users = new Users();
|
||||||
|
$userInfo = $users->loadDetails($currentUsrUid);
|
||||||
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
$casesFields["APP_DATA"]["USER_LOGGED"] = $currentUsrUid;
|
||||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
$casesFields["APP_DATA"]["USR_USERNAME"] = $userInfo['USR_USERNAME'];
|
||||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delIndex);
|
|
||||||
|
|
||||||
$rsSQL = AppDelegationPeer::doSelectRS($criteria);
|
|
||||||
$rsSQL->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
while ($rsSQL->next()) {
|
|
||||||
$row = $rsSQL->getRow();
|
|
||||||
|
|
||||||
$current_user_uid = $row["USR_UID"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($current_user_uid != null) {
|
|
||||||
$criteria = new Criteria("workflow");
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
|
||||||
$criteria->add(UsersPeer::USR_UID, $current_user_uid);
|
|
||||||
|
|
||||||
$rsSQL = UsersPeer::doSelectRS($criteria);
|
|
||||||
$rsSQL->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$rsSQL->next();
|
|
||||||
|
|
||||||
$row = $rsSQL->getRow();
|
|
||||||
$currentUsrName = $row["USR_USERNAME"];
|
|
||||||
|
|
||||||
$casesFields["APP_DATA"]["USER_LOGGED"] = $current_user_uid;
|
|
||||||
$casesFields["APP_DATA"]["USR_USERNAME"] = $currentUsrName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($casesFields["APP_DATA"] as $index => $value) {
|
foreach ($casesFields["APP_DATA"] as $index => $value) {
|
||||||
@@ -102,7 +54,12 @@ if (PMLicensedFeatures
|
|||||||
$case->updateCase($appUid, $casesFields);
|
$case->updateCase($appUid, $casesFields);
|
||||||
|
|
||||||
$wsBaseInstance = new WsBase();
|
$wsBaseInstance = new WsBase();
|
||||||
$result = $wsBaseInstance->derivateCase($casesFields['CURRENT_USER_UID'], $appUid, $delIndex, true);
|
$result = $wsBaseInstance->derivateCase(
|
||||||
|
$casesFields['CURRENT_USER_UID'],
|
||||||
|
$appUid,
|
||||||
|
$delIndex,
|
||||||
|
true
|
||||||
|
);
|
||||||
$code = (is_array($result) ? $result['status_code'] : $result->status_code);
|
$code = (is_array($result) ? $result['status_code'] : $result->status_code);
|
||||||
|
|
||||||
$dataResponses = array();
|
$dataResponses = array();
|
||||||
@@ -130,8 +87,8 @@ if (PMLicensedFeatures
|
|||||||
$response = new stdclass();
|
$response = new stdclass();
|
||||||
$response->usrUid = $casesFields['APP_DATA']['USER_LOGGED'];
|
$response->usrUid = $casesFields['APP_DATA']['USER_LOGGED'];
|
||||||
$response->appUid = $appUid;
|
$response->appUid = $appUid;
|
||||||
|
$response->delIndex = $delIndex;
|
||||||
$response->noteText = "Check the information that was sent for the receiver: " . $dataAbeRequests['ABE_REQ_SENT_TO'];
|
$response->noteText = "Check the information that was sent for the receiver: " . $dataAbeRequests['ABE_REQ_SENT_TO'];
|
||||||
|
|
||||||
postNote($response);
|
postNote($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +98,7 @@ if (PMLicensedFeatures
|
|||||||
if (isset($_FILES ['form'])) {
|
if (isset($_FILES ['form'])) {
|
||||||
if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
|
if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
|
||||||
$oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
|
$oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
|
||||||
$oInputDocument->uploadFileCase($_FILES, $case, $casesFields, $current_user_uid, $appUid, $delIndex);
|
$oInputDocument->uploadFileCase($_FILES, $case, $casesFields, $currentUsrUid, $appUid, $delIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,19 +4,23 @@ namespace ProcessMaker\BusinessModel;
|
|||||||
|
|
||||||
use AbeConfiguration;
|
use AbeConfiguration;
|
||||||
use AbeConfigurationPeer;
|
use AbeConfigurationPeer;
|
||||||
|
use AppMessage;
|
||||||
use AbeRequests;
|
use AbeRequests;
|
||||||
use AbeRequestsPeer;
|
use AbeRequestsPeer;
|
||||||
use AbeResponsesPeer;
|
use AbeResponsesPeer;
|
||||||
use ApplicationPeer;
|
use ApplicationPeer;
|
||||||
use AppDelegationPeer;
|
use AppDelegationPeer;
|
||||||
use Criteria;
|
use Criteria;
|
||||||
|
use EmailServerPeer;
|
||||||
use Exception;
|
use Exception;
|
||||||
use G;
|
use G;
|
||||||
use Publisher;
|
use Publisher;
|
||||||
|
use ProcessMaker\BusinessModel\EmailServer;
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
use ProcessMaker\Plugins\PluginRegistry;
|
use ProcessMaker\Plugins\PluginRegistry;
|
||||||
use PmDynaform;
|
use PmDynaform;
|
||||||
use PMLicensedFeatures;
|
use PMLicensedFeatures;
|
||||||
|
use ProcessPeer;
|
||||||
use ResultSet;
|
use ResultSet;
|
||||||
use SpoolRun;
|
use SpoolRun;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
@@ -378,9 +382,11 @@ class ActionsByEmail
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Forward the Mail
|
* Forward the Mail
|
||||||
|
*
|
||||||
* @param array $arrayData
|
* @param array $arrayData
|
||||||
*
|
*
|
||||||
* @return string $message
|
* @return string $message
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function forwardMail(array $arrayData)
|
public function forwardMail(array $arrayData)
|
||||||
{
|
{
|
||||||
@@ -388,38 +394,15 @@ class ActionsByEmail
|
|||||||
$arrayData['REQ_UID'] = '';
|
$arrayData['REQ_UID'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria = new Criteria();
|
$abeRequest = new AbeRequests();
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
$dataRes = $abeRequest->getAbeRequest($arrayData['REQ_UID']);
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
|
||||||
$criteria->addSelectColumn(TaskPeer::TAS_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::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, $arrayData['REQ_UID']);
|
|
||||||
$resultRes = AbeRequestsPeer::doSelectRS($criteria);
|
|
||||||
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$resultRes->next();
|
|
||||||
$dataRes = [];
|
|
||||||
|
|
||||||
if ($dataRes = $resultRes->getRow()) {
|
if (!empty($dataRes)) {
|
||||||
if (is_null($dataRes['DEL_FINISH_DATE'])) {
|
if (is_null($dataRes['DEL_FINISH_DATE'])) {
|
||||||
|
|
||||||
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
$emailServer = new EmailServer();
|
||||||
$criteria = $emailServer->getEmailServerCriteria();
|
$criteria = $emailServer->getEmailServerCriteria();
|
||||||
$rsCriteria = \EmailServerPeer::doSelectRS($criteria);
|
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
if ($rsCriteria->next()) {
|
if ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
@@ -431,24 +414,29 @@ class ActionsByEmail
|
|||||||
|
|
||||||
$spool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
$spool->setConfig($aSetup);
|
$spool->setConfig($aSetup);
|
||||||
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
|
'',
|
||||||
|
$dataRes['APP_UID'],
|
||||||
|
$dataRes['DEL_INDEX'],
|
||||||
|
'TEST',
|
||||||
|
$dataRes['ABE_REQ_SUBJECT'],
|
||||||
|
$aSetup['MESS_ACCOUNT'],
|
||||||
|
$dataRes['ABE_REQ_SENT_TO'],
|
||||||
|
$dataRes['ABE_REQ_BODY'],
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'pending',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
isset($dataRes['APP_NUMBER']) ? $dataRes['APP_NUMBER'] : 0,
|
||||||
|
$dataRes['PRO_ID'],
|
||||||
|
$dataRes['TAS_ID']
|
||||||
|
);
|
||||||
|
|
||||||
$spool->create([
|
$spool->create($messageArray);
|
||||||
'msg_uid' => '',
|
|
||||||
'app_uid' => $dataRes['APP_UID'],
|
|
||||||
'del_index' => $dataRes['DEL_INDEX'],
|
|
||||||
'app_msg_type' => 'TEST',
|
|
||||||
'app_msg_subject' => $dataRes['ABE_REQ_SUBJECT'],
|
|
||||||
'app_msg_from' => $aSetup['MESS_ACCOUNT'],
|
|
||||||
'app_msg_to' => $dataRes['ABE_REQ_SENT_TO'],
|
|
||||||
'app_msg_body' => $dataRes['ABE_REQ_BODY'],
|
|
||||||
'app_msg_cc' => '',
|
|
||||||
'app_msg_bcc' => '',
|
|
||||||
'app_msg_attach' => '',
|
|
||||||
'app_msg_template' => '',
|
|
||||||
'app_msg_status' => 'pending',
|
|
||||||
"tas_id" => $dataRes['TAS_ID'],
|
|
||||||
"app_number" => isset($dataRes['APP_NUMBER']) ? $dataRes['APP_NUMBER'] : ''
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($spool->sendMail()) {
|
if ($spool->sendMail()) {
|
||||||
$dataRes['ABE_REQ_STATUS'] = 'SENT';
|
$dataRes['ABE_REQ_STATUS'] = 'SENT';
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProcessMaker\BusinessModel;
|
namespace ProcessMaker\BusinessModel;
|
||||||
use G;
|
|
||||||
use Exception;
|
use AppMessage;
|
||||||
use Bootstrap;
|
use Bootstrap;
|
||||||
use SpoolRun;
|
use Exception;
|
||||||
|
use G;
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
|
use SpoolRun;
|
||||||
|
use TemplatePower;
|
||||||
|
|
||||||
class EmailServer
|
class EmailServer
|
||||||
{
|
{
|
||||||
@@ -158,7 +161,7 @@ class EmailServer
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$aConfiguration = array(
|
$configuration = array(
|
||||||
"MESS_ENGINE" => $arrayData["MESS_ENGINE"],
|
"MESS_ENGINE" => $arrayData["MESS_ENGINE"],
|
||||||
"MESS_SERVER" => $arrayData["MESS_SERVER"],
|
"MESS_SERVER" => $arrayData["MESS_SERVER"],
|
||||||
"MESS_PORT" => (int)($arrayData["MESS_PORT"]),
|
"MESS_PORT" => (int)($arrayData["MESS_PORT"]),
|
||||||
@@ -170,9 +173,6 @@ class EmailServer
|
|||||||
"SMTPSecure" => (isset($arrayData["SMTPSecure"]))? $arrayData["SMTPSecure"] : "none"
|
"SMTPSecure" => (isset($arrayData["SMTPSecure"]))? $arrayData["SMTPSecure"] : "none"
|
||||||
);
|
);
|
||||||
|
|
||||||
$sFrom = G::buildFrom($aConfiguration);
|
|
||||||
|
|
||||||
$sSubject = G::LoadTranslation("ID_MESS_TEST_SUBJECT");
|
|
||||||
$msg = G::LoadTranslation("ID_MESS_TEST_BODY");
|
$msg = G::LoadTranslation("ID_MESS_TEST_BODY");
|
||||||
|
|
||||||
switch ($arrayData["MESS_ENGINE"]) {
|
switch ($arrayData["MESS_ENGINE"]) {
|
||||||
@@ -187,52 +187,47 @@ class EmailServer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sBodyPre = new \TemplatePower(PATH_TPL . "admin" . PATH_SEP . "email.tpl");
|
$bodyPre = new TemplatePower(PATH_TPL . "admin" . PATH_SEP . "email.tpl");
|
||||||
|
|
||||||
$sBodyPre->prepare();
|
$bodyPre->prepare();
|
||||||
$sBodyPre->assign("server", $_SERVER["SERVER_NAME"]);
|
$bodyPre->assign("server", $_SERVER["SERVER_NAME"]);
|
||||||
$sBodyPre->assign("date", date("H:i:s"));
|
$bodyPre->assign("date", date("H:i:s"));
|
||||||
$sBodyPre->assign("ver", System::getVersion());
|
$bodyPre->assign("ver", System::getVersion());
|
||||||
$sBodyPre->assign("engine", $engine);
|
$bodyPre->assign("engine", $engine);
|
||||||
$sBodyPre->assign("msg", $msg);
|
$bodyPre->assign("msg", $msg);
|
||||||
$sBody = $sBodyPre->getOutputContent();
|
$body = $bodyPre->getOutputContent();
|
||||||
|
|
||||||
$oSpool = new SpoolRun();
|
$spool = new SpoolRun();
|
||||||
|
$spool->setConfig($configuration);
|
||||||
$oSpool->setConfig($aConfiguration);
|
$messageArray = AppMessage::buildMessageRow(
|
||||||
|
'',
|
||||||
$oSpool->create(
|
'',
|
||||||
array(
|
0,
|
||||||
"msg_uid" => "",
|
'TEST',
|
||||||
"app_uid" => "",
|
G::LoadTranslation("ID_MESS_TEST_SUBJECT"),
|
||||||
"del_index" => 0,
|
G::buildFrom($configuration),
|
||||||
"app_msg_type" => "TEST",
|
$arrayData["TO"],
|
||||||
"app_msg_subject" => $sSubject,
|
$body,
|
||||||
"app_msg_from" => $sFrom,
|
'',
|
||||||
"app_msg_to" => $arrayData["TO"],
|
'',
|
||||||
"app_msg_body" => $sBody,
|
'',
|
||||||
"app_msg_cc" => "",
|
'',
|
||||||
"app_msg_bcc" => "",
|
'pending'
|
||||||
"app_msg_attach" => "",
|
|
||||||
"app_msg_template" => "",
|
|
||||||
"app_msg_status" => "pending",
|
|
||||||
"app_msg_attach" => ""
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
$spool->create($messageArray);
|
||||||
$oSpool->sendMail();
|
$spool->sendMail();
|
||||||
|
|
||||||
//Return
|
//Return
|
||||||
$arrayTestMailResult = array();
|
$arrayTestMailResult = [];
|
||||||
|
|
||||||
if ($oSpool->status == "sent") {
|
if ($spool->status == "sent") {
|
||||||
$arrayTestMailResult["status"] = true;
|
$arrayTestMailResult["status"] = true;
|
||||||
$arrayTestMailResult["success"] = true;
|
$arrayTestMailResult["success"] = true;
|
||||||
$arrayTestMailResult["msg"] = G::LoadTranslation("ID_MAIL_TEST_SUCCESS");
|
$arrayTestMailResult["msg"] = G::LoadTranslation("ID_MAIL_TEST_SUCCESS");
|
||||||
} else {
|
} else {
|
||||||
$arrayTestMailResult["status"] = false;
|
$arrayTestMailResult["status"] = false;
|
||||||
$arrayTestMailResult["success"] = false;
|
$arrayTestMailResult["success"] = false;
|
||||||
$arrayTestMailResult["msg"] = $oSpool->error;
|
$arrayTestMailResult["msg"] = $spool->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $arrayTestMailResult;
|
return $arrayTestMailResult;
|
||||||
|
|||||||
@@ -1862,6 +1862,7 @@ class Process
|
|||||||
if (!empty($search)) {
|
if (!empty($search)) {
|
||||||
$process->add(ProcessPeer::PRO_TITLE, "%$search%", Criteria::LIKE);
|
$process->add(ProcessPeer::PRO_TITLE, "%$search%", Criteria::LIKE);
|
||||||
}
|
}
|
||||||
|
$process->addAscendingOrderByColumn(ProcessPeer::PRO_TITLE);
|
||||||
$dataset = ProcessPeer::doSelectRS($process);
|
$dataset = ProcessPeer::doSelectRS($process);
|
||||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ function postNote($httpData)
|
|||||||
{
|
{
|
||||||
$appUid = (isset($httpData->appUid)) ? $httpData->appUid : '';
|
$appUid = (isset($httpData->appUid)) ? $httpData->appUid : '';
|
||||||
$usrUid = (isset($httpData->usrUid)) ? $httpData->usrUid : '';
|
$usrUid = (isset($httpData->usrUid)) ? $httpData->usrUid : '';
|
||||||
|
$delIndex = (isset($httpData->delIndex)) ? $httpData->delIndex : 0;
|
||||||
$appNotes = new AppNotes();
|
$appNotes = new AppNotes();
|
||||||
$noteContent = addslashes($httpData->noteText);
|
$noteContent = addslashes($httpData->noteText);
|
||||||
$result = $appNotes->postNewNote($appUid, $usrUid, $noteContent, false);
|
$result = $appNotes->postNewNote($appUid, $usrUid, $noteContent, false);
|
||||||
@@ -33,7 +34,7 @@ function postNote($httpData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$noteRecipients = implode(",", $noteRecipientsList);
|
$noteRecipients = implode(",", $noteRecipientsList);
|
||||||
$appNotes->sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients);
|
$appNotes->sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, '', $delIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -358,10 +358,11 @@ Ext.onReady(function(){
|
|||||||
params : {
|
params : {
|
||||||
request : 'updateStatusMessage',
|
request : 'updateStatusMessage',
|
||||||
APP_MSG_UID: row.data.APP_MSG_UID,
|
APP_MSG_UID: row.data.APP_MSG_UID,
|
||||||
APP_MSG_STATUS: this.value
|
APP_MSG_STATUS_ID: this.value
|
||||||
},
|
},
|
||||||
success: function ( result, request ) {
|
success: function ( result, request ) {
|
||||||
Ext.MessageBox.hide();
|
Ext.MessageBox.hide();
|
||||||
|
emailsGrid.store.load();
|
||||||
},
|
},
|
||||||
failure: function ( result, request) {
|
failure: function ( result, request) {
|
||||||
if (typeof(result.responseText) != 'undefined') {
|
if (typeof(result.responseText) != 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user