HOR-287-A "Page Not Found en Log de email..." SOLVED
This commit is contained in:
@@ -288,9 +288,10 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
$pluginRegistry = &PMPluginRegistry::getSingleton(); //lsl
|
||||||
$oObject = $oPluginRegistry->getPlugin("actionsByEmail");
|
$status = $pluginRegistry->getStatusPlugin('actionsByEmail');
|
||||||
if (!(get_class($oObject) === "actionsByEmailPlugin") &&
|
|
||||||
|
if ((string)($status) !== 'enabled' &&
|
||||||
$licensedFeatures->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=') &&
|
$licensedFeatures->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=') &&
|
||||||
$RBAC->userCanAccess('PM_SETUP_LOGS') == 1
|
$RBAC->userCanAccess('PM_SETUP_LOGS') == 1
|
||||||
) {
|
) {
|
||||||
|
|||||||
4
workflow/engine/methods/actionsByEmail/ActionByEmail.php
Normal file
4
workflow/engine/methods/actionsByEmail/ActionByEmail.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
$oHeadPublisher->addExtJsScript('actionsByEmail/report', false); //adding a javascript file .js
|
||||||
|
|
||||||
|
G::RenderPage('publish', 'extJs');
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
// General Validations
|
||||||
|
if (!isset($_REQUEST['action'])) {
|
||||||
|
$_REQUEST['action'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($_REQUEST['limit'])) {
|
||||||
|
$_REQUEST['limit'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($_REQUEST['start'])) {
|
||||||
|
$_REQUEST['start'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Initialize response object
|
||||||
|
$response = new stdclass();
|
||||||
|
$response->status = 'OK';
|
||||||
|
|
||||||
|
//Main switch
|
||||||
|
try {
|
||||||
|
$actionsByEmail = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
||||||
|
|
||||||
|
switch ($_REQUEST['action']) {
|
||||||
|
case 'editTemplate':
|
||||||
|
$actionsByEmail->editTemplate($_REQUEST);
|
||||||
|
die();
|
||||||
|
break;
|
||||||
|
case 'updateTemplate':
|
||||||
|
$actionsByEmail->updateTemplate($_REQUEST);
|
||||||
|
break;
|
||||||
|
case 'loadFields':
|
||||||
|
$actionsByEmail->loadFields($_REQUEST);
|
||||||
|
break;
|
||||||
|
case 'saveConfiguration':
|
||||||
|
$actionsByEmail->saveConfiguration2($_REQUEST);
|
||||||
|
break;
|
||||||
|
case 'loadActionByEmail':
|
||||||
|
$actionsByEmail->loadActionByEmail($_REQUEST);
|
||||||
|
break;
|
||||||
|
case 'forwardMail':
|
||||||
|
$actionsByEmail->forwardMail($_REQUEST);
|
||||||
|
die;
|
||||||
|
break;
|
||||||
|
case 'viewForm':
|
||||||
|
$actionsByEmail->viewForm($_REQUEST);
|
||||||
|
die;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception $error) {
|
||||||
|
$response = new stdclass();
|
||||||
|
$response->status = 'ERROR';
|
||||||
|
$response->message = $error->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: application/json;');
|
||||||
|
|
||||||
|
die(G::json_encode($response));
|
||||||
@@ -71,4 +71,464 @@ class ActionsByEmail
|
|||||||
return $configuration;
|
return $configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function editTemplate(array $arrayData)
|
||||||
|
{
|
||||||
|
//Action Validations
|
||||||
|
if (!isset($arrayData['TEMPLATE'])) {
|
||||||
|
$arrayData['TEMPLATE'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayData['TEMPLATE'] == '') {
|
||||||
|
throw new Exception(\G::LoadTranslation('ID_TEMPLATE_PARAMETER_EMPTY'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'CONTENT' => file_get_contents(
|
||||||
|
PATH_DATA_MAILTEMPLATES . $arrayData['PRO_UID'] . PATH_SEP . $arrayData['TEMPLATE']
|
||||||
|
),
|
||||||
|
'TEMPLATE' => $arrayData['TEMPLATE'],
|
||||||
|
);
|
||||||
|
|
||||||
|
global $G_PUBLISH;
|
||||||
|
|
||||||
|
$G_PUBLISH = new \Publisher();
|
||||||
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'actionsByEmail/actionsByEmail_FileEdit', '', $data);
|
||||||
|
|
||||||
|
\G::RenderPage('publish', 'raw');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateTemplate(array $arrayData)
|
||||||
|
{
|
||||||
|
//Action Validations
|
||||||
|
if (!isset($arrayData['TEMPLATE'])) {
|
||||||
|
$arrayData['TEMPLATE'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['CONTENT'])) {
|
||||||
|
$arrayData['CONTENT'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayData['TEMPLATE'] == '') {
|
||||||
|
throw new Exception(\G::LoadTranslation('ID_TEMPLATE_PARAMETER_EMPTY'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$templateFile = fopen(PATH_DATA_MAILTEMPLATES . $arrayData['PRO_UID'] . PATH_SEP . $arrayData['TEMPLATE'], 'w');
|
||||||
|
$content = stripslashes($arrayData['CONTENT']);
|
||||||
|
$content = str_replace('@amp@', '&', $content);
|
||||||
|
$content = base64_decode($content);
|
||||||
|
|
||||||
|
fwrite($templateFile, $content);
|
||||||
|
fclose($templateFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadFields(array $arrayData)
|
||||||
|
{
|
||||||
|
if (!isset($arrayData['DYN_UID'])) {
|
||||||
|
$arrayData['DYN_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['PRO_UID'])) {
|
||||||
|
$arrayData['PRO_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->emailFields = array();
|
||||||
|
$response->actionFields = array();
|
||||||
|
|
||||||
|
if ($arrayData['PRO_UID'] != '' && $arrayData['DYN_UID']) {
|
||||||
|
$dynaform = new Form($arrayData['PRO_UID'] . PATH_SEP . $arrayData['DYN_UID'], PATH_DYNAFORM, SYS_LANG, false);
|
||||||
|
|
||||||
|
foreach ($dynaform->fields as $fieldName => $data) {
|
||||||
|
switch ($data->type) {
|
||||||
|
case 'text':
|
||||||
|
case 'suggest':
|
||||||
|
case 'hidden':
|
||||||
|
case 'textarea':
|
||||||
|
$response->emailFields[] = array('value' => $data->name, 'label' => $data->label . ' (@@' . $data->name . ')');
|
||||||
|
break;
|
||||||
|
case 'dropdown':
|
||||||
|
case 'radiogroup':
|
||||||
|
case 'yesno':
|
||||||
|
case 'checkbox':
|
||||||
|
$response->actionFields[] = array('value' => $data->name, 'label' => $data->label . ' (@@' . $data->name . ')');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveConfiguration2(array $arrayData)
|
||||||
|
{
|
||||||
|
if (!isset($arrayData['ABE_UID'])) {
|
||||||
|
$arrayData['ABE_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['PRO_UID'])) {
|
||||||
|
$arrayData['PRO_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['TAS_UID'])) {
|
||||||
|
$arrayData['TAS_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['ABE_TYPE'])) {
|
||||||
|
$arrayData['ABE_TYPE'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['ABE_TEMPLATE'])) {
|
||||||
|
$arrayData['ABE_TEMPLATE'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['DYN_UID'])) {
|
||||||
|
$arrayData['DYN_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['ABE_EMAIL_FIELD'])) {
|
||||||
|
$arrayData['ABE_EMAIL_FIELD'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['ABE_ACTION_FIELD'])) {
|
||||||
|
$arrayData['ABE_ACTION_FIELD'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($arrayData['ABE_CASE_NOTE_IN_RESPONSE'])) {
|
||||||
|
$arrayData['ABE_CASE_NOTE_IN_RESPONSE'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayData['PRO_UID'] == '') {
|
||||||
|
throw new Exception(\G::LoadTranslation('ID_PRO_UID_PARAMETER_IS_EMPTY'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($arrayData['TAS_UID'] == '') {
|
||||||
|
throw new Exception(\G::LoadTranslation('ID_TAS_UID_PARAMETER_IS_EMPTY'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$abeConfigurationInstance = new \AbeConfiguration();
|
||||||
|
|
||||||
|
if ($arrayData['ABE_TYPE'] != '') {
|
||||||
|
if ($arrayData['DYN_UID'] == '') {
|
||||||
|
throw new Exception(\G::LoadTranslation('ID_DYN_UID_PARAMETER_IS_EMPTY'));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$response->ABE_UID = $abeConfigurationInstance->createOrUpdate($arrayData);
|
||||||
|
} catch (\Exception $error) {
|
||||||
|
throw $error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
$abeConfigurationInstance->deleteByTasUid($arrayData['TAS_UID']);
|
||||||
|
$response->ABE_UID = '';
|
||||||
|
} catch (\Exception $error) {
|
||||||
|
throw $error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadActionByEmail(array $arrayData)
|
||||||
|
{
|
||||||
|
$criteria = new \Criteria();
|
||||||
|
$criteria->addSelectColumn('COUNT(*)');
|
||||||
|
|
||||||
|
$criteria->addJoin(\AbeConfigurationPeer::ABE_UID, \AbeRequestsPeer::ABE_UID);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::APP_UID, \AbeRequestsPeer::APP_UID);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::DEL_INDEX, \AbeRequestsPeer::DEL_INDEX);
|
||||||
|
$result = \AbeConfigurationPeer::doSelectRS($criteria);
|
||||||
|
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$result->next();
|
||||||
|
$totalCount = $result->getRow();
|
||||||
|
$totalCount = $totalCount['COUNT(*)'];
|
||||||
|
|
||||||
|
$criteria = new \Criteria();
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::PRO_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::TAS_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_UPDATE_DATE);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_TEMPLATE);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_ACTION_FIELD);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::DYN_UID);
|
||||||
|
|
||||||
|
$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_STATUS);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::ABE_REQ_SUBJECT);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::ABE_REQ_ANSWERED);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::ABE_REQ_BODY);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::ABE_REQ_DATE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\ApplicationPeer::APP_NUMBER);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\AppDelegationPeer::DEL_PREVIOUS);
|
||||||
|
|
||||||
|
$criteria->addJoin(\AbeConfigurationPeer::ABE_UID, \AbeRequestsPeer::ABE_UID);
|
||||||
|
$criteria->addJoin(\ApplicationPeer::APP_UID, \AbeRequestsPeer::APP_UID);
|
||||||
|
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::APP_UID, \AbeRequestsPeer::APP_UID);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::DEL_INDEX, \AbeRequestsPeer::DEL_INDEX);
|
||||||
|
$criteria->addDescendingOrderByColumn(\AbeRequestsPeer::ABE_REQ_DATE);
|
||||||
|
$criteria->setLimit($arrayData['limit']);
|
||||||
|
$criteria->setOffset($arrayData['start']);
|
||||||
|
$result = \AbeConfigurationPeer::doSelectRS($criteria);
|
||||||
|
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$data = Array();
|
||||||
|
$arrayPro = Array();
|
||||||
|
$arrayTAS = Array();
|
||||||
|
$index = 0;
|
||||||
|
|
||||||
|
while ($result->next()) {
|
||||||
|
$data[] = $result->getRow();
|
||||||
|
$criteriaRes = new \Criteria();
|
||||||
|
|
||||||
|
$criteriaRes->addSelectColumn(\AbeResponsesPeer::ABE_RES_UID);
|
||||||
|
$criteriaRes->addSelectColumn(\AbeResponsesPeer::ABE_RES_CLIENT_IP);
|
||||||
|
$criteriaRes->addSelectColumn(\AbeResponsesPeer::ABE_RES_DATA);
|
||||||
|
$criteriaRes->addSelectColumn(\AbeResponsesPeer::ABE_RES_STATUS);
|
||||||
|
$criteriaRes->addSelectColumn(\AbeResponsesPeer::ABE_RES_MESSAGE);
|
||||||
|
|
||||||
|
$criteriaRes->add(\AbeResponsesPeer::ABE_REQ_UID, $data[$index]['ABE_REQ_UID']);
|
||||||
|
|
||||||
|
$resultRes = \AbeResponsesPeer::doSelectRS($criteriaRes);
|
||||||
|
$resultRes->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$resultRes->next();
|
||||||
|
$dataRes = Array();
|
||||||
|
|
||||||
|
if ($dataRes = $resultRes->getRow()) {
|
||||||
|
$data[$index]['ABE_RES_UID'] = $dataRes['ABE_RES_UID'];
|
||||||
|
$data[$index]['ABE_RES_CLIENT_IP'] = $dataRes['ABE_RES_CLIENT_IP'];
|
||||||
|
$data[$index]['ABE_RES_DATA'] = $dataRes['ABE_RES_DATA'];
|
||||||
|
$data[$index]['ABE_RES_STATUS'] = $dataRes['ABE_RES_STATUS'];
|
||||||
|
$data[$index]['ABE_RES_MESSAGE'] = $dataRes['ABE_RES_MESSAGE'];
|
||||||
|
} else {
|
||||||
|
$data[$index]['ABE_RES_UID'] = '';
|
||||||
|
$data[$index]['ABE_RES_CLIENT_IP'] = '';
|
||||||
|
$data[$index]['ABE_RES_DATA'] = '';
|
||||||
|
$data[$index]['ABE_RES_STATUS'] = '';
|
||||||
|
$data[$index]['ABE_RES_MESSAGE'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteriaRes = new \Criteria();
|
||||||
|
|
||||||
|
$criteriaRes->addSelectColumn(\AppDelegationPeer::USR_UID);
|
||||||
|
$criteriaRes->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||||
|
$criteriaRes->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||||
|
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::APP_UID, $data[$index]['APP_UID']);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::DEL_INDEX, $data[$index]['DEL_PREVIOUS']);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::USR_UID, \UsersPeer::USR_UID);
|
||||||
|
$resultRes = \AppDelegationPeer::doSelectRS($criteriaRes);
|
||||||
|
$resultRes->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$resultRes->next();
|
||||||
|
|
||||||
|
if ($dataRes = $resultRes->getRow()) {
|
||||||
|
$data[$index]['USER'] = $dataRes['USR_FIRSTNAME'] . ' ' . $dataRes['USR_LASTNAME'];
|
||||||
|
} else {
|
||||||
|
$data[$index]['USER'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[$index]['ABE_REQ_ANSWERED'] = ($data[$index]['ABE_REQ_ANSWERED'] == 1) ? 'YES' : 'NO';
|
||||||
|
$index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = array();
|
||||||
|
$response['totalCount'] = $totalCount;
|
||||||
|
$response['data'] = $data;
|
||||||
|
|
||||||
|
//Return
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forwardMail(array $arrayData)
|
||||||
|
{
|
||||||
|
if (!isset($arrayData['REQ_UID'])) {
|
||||||
|
$arrayData['REQ_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria = new \Criteria();
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::PRO_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::TAS_UID);
|
||||||
|
|
||||||
|
$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->add(\AbeRequestsPeer::ABE_REQ_UID, $arrayData['REQ_UID']);
|
||||||
|
$criteria->addJoin(\AbeRequestsPeer::ABE_UID, \AbeConfigurationPeer::ABE_UID);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::APP_UID, \AbeRequestsPeer::APP_UID);
|
||||||
|
$criteria->addJoin(\AppDelegationPeer::DEL_INDEX, \AbeRequestsPeer::DEL_INDEX);
|
||||||
|
$resultRes = AbeRequestsPeer::doSelectRS($criteria);
|
||||||
|
$resultRes->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
$resultRes->next();
|
||||||
|
$dataRes = Array();
|
||||||
|
|
||||||
|
if ($dataRes = $resultRes->getRow()) {
|
||||||
|
if (is_null($dataRes['DEL_FINISH_DATE'])) {
|
||||||
|
\G::LoadClass('spool');
|
||||||
|
|
||||||
|
$configuration = new \Configuration();
|
||||||
|
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||||
|
$criteria = new \Criteria('workflow');
|
||||||
|
$criteria->add(\ConfigurationPeer::CFG_UID, 'Emails');
|
||||||
|
$criteria->add(\ConfigurationPeer::OBJ_UID, '');
|
||||||
|
$criteria->add(\ConfigurationPeer::PRO_UID, '');
|
||||||
|
$criteria->add(\ConfigurationPeer::USR_UID, '');
|
||||||
|
$criteria->add(\ConfigurationPeer::APP_UID, '');
|
||||||
|
|
||||||
|
if (\ConfigurationPeer::doCount($criteria) == 0) {
|
||||||
|
$configuration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
|
||||||
|
$newConfiguration = array();
|
||||||
|
} else {
|
||||||
|
$newConfiguration = $configuration->load('Emails', '', '', '', '');
|
||||||
|
|
||||||
|
if ($newConfiguration['CFG_VALUE'] != '') {
|
||||||
|
$newConfiguration = unserialize($newConfiguration['CFG_VALUE']);
|
||||||
|
} else {
|
||||||
|
$newConfiguration = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$spool = new \spoolRun();
|
||||||
|
$spool->setConfig(array(
|
||||||
|
'MESS_ENGINE' => $newConfiguration['MESS_ENGINE'],
|
||||||
|
'MESS_SERVER' => $newConfiguration['MESS_SERVER'],
|
||||||
|
'MESS_PORT' => $newConfiguration['MESS_PORT'],
|
||||||
|
'MESS_ACCOUNT' => $newConfiguration['MESS_ACCOUNT'],
|
||||||
|
'MESS_PASSWORD' => $newConfiguration['MESS_PASSWORD'],
|
||||||
|
'SMTPAuth' => $newConfiguration['MESS_RAUTH']
|
||||||
|
));
|
||||||
|
|
||||||
|
$spool->create(array(
|
||||||
|
'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' => $newConfiguration['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'
|
||||||
|
));
|
||||||
|
|
||||||
|
if ($spool->sendMail()) {
|
||||||
|
$dataRes['ABE_REQ_STATUS'] = 'SENT';
|
||||||
|
|
||||||
|
$message = G::LoadTranslation('ID_EMAIL_RESENT_TO') . ': '. $dataRes['ABE_REQ_SENT_TO'];
|
||||||
|
} else {
|
||||||
|
$dataRes['ABE_REQ_STATUS'] = 'ERROR';
|
||||||
|
$message = G::LoadTranslation('ID_THERE_PROBLEM_SENDING_EMAIL') . ': '. $dataRes['ABE_REQ_SENT_TO'] . ', ' . G::LoadTranslation('ID_PLEASE_TRY_LATER');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$abeRequestsInstance = new \AbeRequests();
|
||||||
|
$abeRequestsInstance->createOrUpdate($dataRes);
|
||||||
|
} catch (\Exception $error) {
|
||||||
|
throw $error;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$message = \G::LoadTranslation('ID_UNABLE_TO_SEND_EMAIL');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$message = \G::LoadTranslation('ID_UNEXPECTED_ERROR_OCCURRED_PLEASE');
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function viewForm(array $arrayData)
|
||||||
|
{
|
||||||
|
//coment
|
||||||
|
if (!isset($arrayData['REQ_UID'])) {
|
||||||
|
$arrayData['REQ_UID'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria = new \Criteria();
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::PRO_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::TAS_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::DYN_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeConfigurationPeer::ABE_ACTION_FIELD);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::ABE_REQ_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::APP_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeRequestsPeer::DEL_INDEX);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\AbeResponsesPeer::ABE_RES_UID);
|
||||||
|
$criteria->addSelectColumn(\AbeResponsesPeer::ABE_RES_DATA);
|
||||||
|
|
||||||
|
$criteria->add(\AbeRequestsPeer::ABE_REQ_UID, $arrayData['REQ_UID']);
|
||||||
|
$criteria->addJoin(\AbeRequestsPeer::ABE_UID, \AbeConfigurationPeer::ABE_UID);
|
||||||
|
$criteria->addJoin(\AbeResponsesPeer::ABE_REQ_UID, \AbeRequestsPeer::ABE_REQ_UID);
|
||||||
|
$resultRes = AbeRequestsPeer::doSelectRS($criteria);
|
||||||
|
$resultRes->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
$resultRes->next();
|
||||||
|
$dataRes = Array();
|
||||||
|
$message = \G::LoadTranslation('ID_USER_NOT_RESPONDED_REQUEST');
|
||||||
|
|
||||||
|
if ($dataRes = $resultRes->getRow()) {
|
||||||
|
$_SESSION['CURRENT_DYN_UID'] = trim($dataRes['DYN_UID']);
|
||||||
|
$dynaform = new \Form($dataRes['PRO_UID'] . PATH_SEP . trim($dataRes['DYN_UID']), PATH_DYNAFORM, SYS_LANG, false);
|
||||||
|
$dynaform->mode = 'view';
|
||||||
|
|
||||||
|
if ($dataRes['ABE_RES_DATA'] != '') {
|
||||||
|
$value = unserialize($dataRes['ABE_RES_DATA']);
|
||||||
|
|
||||||
|
if (is_array($value)) {
|
||||||
|
$dynaform->values = $value;
|
||||||
|
|
||||||
|
foreach ($dynaform->fields as $fieldName => $field) {
|
||||||
|
if ($field->type == 'submit') {
|
||||||
|
unset($dynaform->fields[$fieldName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$message = $dynaform->render(PATH_CORE . 'templates/xmlform.html', $scriptCode);
|
||||||
|
} else {
|
||||||
|
$response = $dynaform->render(PATH_CORE . 'templates/xmlform.html', $scriptCode);
|
||||||
|
$field = $dynaform->fields[$dataRes['ABE_ACTION_FIELD']];
|
||||||
|
$message = '<b>Type: </b>' . $field->type . '<br>';
|
||||||
|
|
||||||
|
switch ($field->type) {
|
||||||
|
case 'dropdown':
|
||||||
|
case 'radiogroup':
|
||||||
|
$message .=$field->label . ' - ';
|
||||||
|
$message .= $field->options[$value];
|
||||||
|
break;
|
||||||
|
case 'yesno':
|
||||||
|
$message .= '<b>' . $field->label . ' </b>- ';
|
||||||
|
$message .= ($value == 1) ? 'Yes' : 'No';
|
||||||
|
break;
|
||||||
|
case 'checkbox':
|
||||||
|
$message .= '<b>' . $field->label . '</b> - ';
|
||||||
|
$message .= ($value == 'On') ? 'Check' : 'Uncheck';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,21 @@ require_once 'classes/model/Users.php';
|
|||||||
*/
|
*/
|
||||||
class ActionsByEmail extends Api
|
class ActionsByEmail extends Api
|
||||||
{
|
{
|
||||||
|
private $actionsByEmail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor of the class
|
||||||
|
*
|
||||||
|
* return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->actionsByEmail = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @url GET
|
* @url GET
|
||||||
@@ -44,27 +59,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function editTemplate($params)
|
public function editTemplate($params)
|
||||||
{
|
{
|
||||||
// Action Validations
|
$this->actionsByEmail->editTemplate($_REQUEST);
|
||||||
if (!isset($_REQUEST['TEMPLATE'])) {
|
|
||||||
$_REQUEST['TEMPLATE'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_REQUEST['TEMPLATE'] == '') {
|
|
||||||
throw new Exception('The TEMPLATE parameter is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = array(
|
|
||||||
'CONTENT' => file_get_contents(PATH_DATA_MAILTEMPLATES . $_REQUEST['PRO_UID'] . PATH_SEP . $_REQUEST['TEMPLATE']),
|
|
||||||
'TEMPLATE' => $_REQUEST['TEMPLATE'],
|
|
||||||
);
|
|
||||||
|
|
||||||
global $G_PUBLISH;
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'actionsByEmail/actionsByEmail_FileEdit', '', $data);
|
|
||||||
|
|
||||||
G::RenderPage('publish', 'raw');
|
|
||||||
die();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,26 +68,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function updateTemplate($params)
|
public function updateTemplate($params)
|
||||||
{
|
{
|
||||||
// Action Validations
|
$this->actionsByEmail->updateTemplate($_REQUEST);
|
||||||
if (!isset($_REQUEST['TEMPLATE'])) {
|
|
||||||
$_REQUEST['TEMPLATE'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['CONTENT'])) {
|
|
||||||
$_REQUEST['CONTENT'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_REQUEST['TEMPLATE'] == '') {
|
|
||||||
throw new Exception('The TEMPLATE parameter is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$templateFile = fopen(PATH_DATA_MAILTEMPLATES . $_REQUEST['PRO_UID'] . PATH_SEP . $_REQUEST['TEMPLATE'], 'w');
|
|
||||||
$content = stripslashes($_REQUEST['CONTENT']);
|
|
||||||
$content = str_replace('@amp@', '&', $content);
|
|
||||||
$content = base64_decode($content);
|
|
||||||
|
|
||||||
fwrite($templateFile, $content);
|
|
||||||
fclose($templateFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,38 +77,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function loadFields($params)
|
public function loadFields($params)
|
||||||
{
|
{
|
||||||
if (!isset($_REQUEST['DYN_UID'])) {
|
return $this->actionsByEmail->loadFields($_REQUEST);
|
||||||
$_REQUEST['DYN_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['PRO_UID'])) {
|
|
||||||
$_REQUEST['PRO_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->emailFields = array();
|
|
||||||
$response->actionFields = array();
|
|
||||||
|
|
||||||
if ($_REQUEST['PRO_UID'] != '' && $_REQUEST['DYN_UID']) {
|
|
||||||
$dynaform = new Form($_REQUEST['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'], PATH_DYNAFORM, SYS_LANG, false);
|
|
||||||
|
|
||||||
foreach ($dynaform->fields as $fieldName => $data) {
|
|
||||||
switch ($data->type) {
|
|
||||||
case 'text':
|
|
||||||
case 'suggest':
|
|
||||||
case 'hidden':
|
|
||||||
case 'textarea':
|
|
||||||
$response->emailFields[] = array('value' => $data->name, 'label' => $data->label . ' (@@' . $data->name . ')');
|
|
||||||
break;
|
|
||||||
case 'dropdown':
|
|
||||||
case 'radiogroup':
|
|
||||||
case 'yesno':
|
|
||||||
case 'checkbox':
|
|
||||||
$response->actionFields[] = array('value' => $data->name, 'label' => $data->label . ' (@@' . $data->name . ')');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -141,73 +86,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function saveConfiguration($params)
|
public function saveConfiguration($params)
|
||||||
{
|
{
|
||||||
if (!isset($_REQUEST['ABE_UID'])) {
|
return $this->actionsByEmail->saveConfiguration2($_REQUEST);
|
||||||
$_REQUEST['ABE_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['PRO_UID'])) {
|
|
||||||
$_REQUEST['PRO_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['TAS_UID'])) {
|
|
||||||
$_REQUEST['TAS_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['ABE_TYPE'])) {
|
|
||||||
$_REQUEST['ABE_TYPE'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['ABE_TEMPLATE'])) {
|
|
||||||
$_REQUEST['ABE_TEMPLATE'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['DYN_UID'])) {
|
|
||||||
$_REQUEST['DYN_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['ABE_EMAIL_FIELD'])) {
|
|
||||||
$_REQUEST['ABE_EMAIL_FIELD'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['ABE_ACTION_FIELD'])) {
|
|
||||||
$_REQUEST['ABE_ACTION_FIELD'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_REQUEST['ABE_CASE_NOTE_IN_RESPONSE'])) {
|
|
||||||
$_REQUEST['ABE_CASE_NOTE_IN_RESPONSE'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_REQUEST['PRO_UID'] == '') {
|
|
||||||
throw new Exception('The PRO_UID parameter is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_REQUEST['TAS_UID'] == '') {
|
|
||||||
throw new Exception('The TAS_UID parameter is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once 'classes/model/AbeConfiguration.php';
|
|
||||||
|
|
||||||
$abeConfigurationInstance = new AbeConfiguration();
|
|
||||||
|
|
||||||
if ($_REQUEST['ABE_TYPE'] != '') {
|
|
||||||
if ($_REQUEST['DYN_UID'] == '') {
|
|
||||||
throw new Exception('The DYN_UID parameter is empty.');
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$response->ABE_UID = $abeConfigurationInstance->createOrUpdate($_REQUEST);
|
|
||||||
} catch (Exception $error) {
|
|
||||||
throw $error;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$abeConfigurationInstance->deleteByTasUid($_REQUEST['TAS_UID']);
|
|
||||||
$response->ABE_UID = '';
|
|
||||||
} catch (Exception $error) {
|
|
||||||
throw $error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,114 +95,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function loadActionByEmail($params)
|
public function loadActionByEmail($params)
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
return $this->actionsByEmail->loadActionByEmail($_REQUEST);
|
||||||
$criteria->addSelectColumn('COUNT(*)');
|
|
||||||
|
|
||||||
$criteria->addJoin(AbeConfigurationPeer::ABE_UID, AbeRequestsPeer::ABE_UID);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
|
|
||||||
$result = AbeConfigurationPeer::doSelectRS($criteria);
|
|
||||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$result->next();
|
|
||||||
$totalCount = $result->getRow();
|
|
||||||
$totalCount = $totalCount['COUNT(*)'];
|
|
||||||
|
|
||||||
$criteria = new Criteria();
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UPDATE_DATE);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
|
|
||||||
|
|
||||||
$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_STATUS);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SUBJECT);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_ANSWERED);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_BODY);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_DATE);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
|
||||||
|
|
||||||
$criteria->addJoin(AbeConfigurationPeer::ABE_UID, AbeRequestsPeer::ABE_UID);
|
|
||||||
$criteria->addJoin(ApplicationPeer::APP_UID, AbeRequestsPeer::APP_UID);
|
|
||||||
|
|
||||||
$criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
|
|
||||||
$criteria->addDescendingOrderByColumn(AbeRequestsPeer::ABE_REQ_DATE);
|
|
||||||
$criteria->setLimit($_REQUEST['limit']);
|
|
||||||
$criteria->setOffset($_REQUEST['start']);
|
|
||||||
$result = AbeConfigurationPeer::doSelectRS($criteria);
|
|
||||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$data = Array();
|
|
||||||
$arrayPro = Array();
|
|
||||||
$arrayTAS = Array();
|
|
||||||
$index = 0;
|
|
||||||
|
|
||||||
while ($result->next()) {
|
|
||||||
$data[] = $result->getRow();
|
|
||||||
$criteriaRes = new Criteria();
|
|
||||||
|
|
||||||
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_UID);
|
|
||||||
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_CLIENT_IP);
|
|
||||||
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_DATA);
|
|
||||||
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_STATUS);
|
|
||||||
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_MESSAGE);
|
|
||||||
|
|
||||||
$criteriaRes->add(AbeResponsesPeer::ABE_REQ_UID, $data[$index]['ABE_REQ_UID']);
|
|
||||||
|
|
||||||
$resultRes = AbeResponsesPeer::doSelectRS($criteriaRes);
|
|
||||||
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$resultRes->next();
|
|
||||||
$dataRes = Array();
|
|
||||||
|
|
||||||
if ($dataRes = $resultRes->getRow()) {
|
|
||||||
$data[$index]['ABE_RES_UID'] = $dataRes['ABE_RES_UID'];
|
|
||||||
$data[$index]['ABE_RES_CLIENT_IP'] = $dataRes['ABE_RES_CLIENT_IP'];
|
|
||||||
$data[$index]['ABE_RES_DATA'] = $dataRes['ABE_RES_DATA'];
|
|
||||||
$data[$index]['ABE_RES_STATUS'] = $dataRes['ABE_RES_STATUS'];
|
|
||||||
$data[$index]['ABE_RES_MESSAGE'] = $dataRes['ABE_RES_MESSAGE'];
|
|
||||||
} else {
|
|
||||||
$data[$index]['ABE_RES_UID'] = '';
|
|
||||||
$data[$index]['ABE_RES_CLIENT_IP'] = '';
|
|
||||||
$data[$index]['ABE_RES_DATA'] = '';
|
|
||||||
$data[$index]['ABE_RES_STATUS'] = '';
|
|
||||||
$data[$index]['ABE_RES_MESSAGE'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$criteriaRes = new Criteria();
|
|
||||||
|
|
||||||
$criteriaRes->addSelectColumn(AppDelegationPeer::USR_UID);
|
|
||||||
$criteriaRes->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
|
||||||
$criteriaRes->addSelectColumn(UsersPeer::USR_LASTNAME);
|
|
||||||
|
|
||||||
$criteria->addJoin(AppDelegationPeer::APP_UID, $data[$index]['APP_UID']);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, $data[$index]['DEL_PREVIOUS']);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID);
|
|
||||||
$resultRes = AppDelegationPeer::doSelectRS($criteriaRes);
|
|
||||||
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$resultRes->next();
|
|
||||||
|
|
||||||
if ($dataRes = $resultRes->getRow()) {
|
|
||||||
$data[$index]['USER'] = $dataRes['USR_FIRSTNAME'] . ' ' . $dataRes['USR_LASTNAME'];
|
|
||||||
} else {
|
|
||||||
$data[$index]['USER'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$data[$index]['ABE_REQ_ANSWERED'] = ($data[$index]['ABE_REQ_ANSWERED'] == 1) ? 'YES' : 'NO';
|
|
||||||
$index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$response = array();
|
|
||||||
$response['totalCount'] = $totalCount;
|
|
||||||
$response['data'] = $data;
|
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -332,112 +104,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function forwardMail($params)
|
public function forwardMail($params)
|
||||||
{
|
{
|
||||||
if (!isset($_REQUEST['REQ_UID'])) {
|
return $this->actionsByEmail->forwardMail($_REQUEST);
|
||||||
$_REQUEST['REQ_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$criteria = new Criteria();
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
|
||||||
|
|
||||||
$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->add(AbeRequestsPeer::ABE_REQ_UID, $_REQUEST['REQ_UID']);
|
|
||||||
$criteria->addJoin(AbeRequestsPeer::ABE_UID, AbeConfigurationPeer::ABE_UID);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
|
|
||||||
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
|
|
||||||
$resultRes = AbeRequestsPeer::doSelectRS($criteria);
|
|
||||||
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$resultRes->next();
|
|
||||||
$dataRes = Array();
|
|
||||||
|
|
||||||
if ($dataRes = $resultRes->getRow()) {
|
|
||||||
if (is_null($dataRes['DEL_FINISH_DATE'])) {
|
|
||||||
require_once 'classes/model/Configuration.php';
|
|
||||||
G::LoadClass('spool');
|
|
||||||
|
|
||||||
$configuration = new Configuration();
|
|
||||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
|
||||||
$criteria = new Criteria('workflow');
|
|
||||||
$criteria->add(ConfigurationPeer::CFG_UID, 'Emails');
|
|
||||||
$criteria->add(ConfigurationPeer::OBJ_UID, '');
|
|
||||||
$criteria->add(ConfigurationPeer::PRO_UID, '');
|
|
||||||
$criteria->add(ConfigurationPeer::USR_UID, '');
|
|
||||||
$criteria->add(ConfigurationPeer::APP_UID, '');
|
|
||||||
|
|
||||||
if (ConfigurationPeer::doCount($criteria) == 0) {
|
|
||||||
$configuration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
|
|
||||||
$newConfiguration = array();
|
|
||||||
} else {
|
|
||||||
$newConfiguration = $configuration->load('Emails', '', '', '', '');
|
|
||||||
|
|
||||||
if ($newConfiguration['CFG_VALUE'] != '') {
|
|
||||||
$newConfiguration = unserialize($newConfiguration['CFG_VALUE']);
|
|
||||||
} else {
|
|
||||||
$newConfiguration = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$spool = new spoolRun();
|
|
||||||
$spool->setConfig(array(
|
|
||||||
'MESS_ENGINE' => $newConfiguration['MESS_ENGINE'],
|
|
||||||
'MESS_SERVER' => $newConfiguration['MESS_SERVER'],
|
|
||||||
'MESS_PORT' => $newConfiguration['MESS_PORT'],
|
|
||||||
'MESS_ACCOUNT' => $newConfiguration['MESS_ACCOUNT'],
|
|
||||||
'MESS_PASSWORD' => $newConfiguration['MESS_PASSWORD'],
|
|
||||||
'SMTPAuth' => $newConfiguration['MESS_RAUTH']
|
|
||||||
));
|
|
||||||
|
|
||||||
$spool->create(array(
|
|
||||||
'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' => $newConfiguration['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'
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($spool->sendMail()) {
|
|
||||||
$dataRes['ABE_REQ_STATUS'] = 'SENT';
|
|
||||||
|
|
||||||
$message = 'The email was resend to: ' . $dataRes['ABE_REQ_SENT_TO'];
|
|
||||||
} else {
|
|
||||||
$dataRes['ABE_REQ_STATUS'] = 'ERROR';
|
|
||||||
$message = 'There was a problem sending the email to: ' . $dataRes['ABE_REQ_SENT_TO'] . ', please try later.';
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$abeRequestsInstance = new AbeRequests();
|
|
||||||
$abeRequestsInstance->createOrUpdate($dataRes);
|
|
||||||
} catch (Exception $error) {
|
|
||||||
throw $error;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$message = 'Unable to send email, the task is closed.';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$message = 'An unexpected error occurred please try again later.';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -446,78 +113,7 @@ class ActionsByEmail extends Api
|
|||||||
*/
|
*/
|
||||||
public function viewForm($params)
|
public function viewForm($params)
|
||||||
{
|
{
|
||||||
//coment
|
return $this->actionsByEmail->viewForm($_REQUEST);
|
||||||
if (!isset($_REQUEST['REQ_UID'])) {
|
|
||||||
$_REQUEST['REQ_UID'] = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$criteria = new Criteria();
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
|
|
||||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_UID);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
|
|
||||||
$criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(AbeResponsesPeer::ABE_RES_UID);
|
|
||||||
$criteria->addSelectColumn(AbeResponsesPeer::ABE_RES_DATA);
|
|
||||||
|
|
||||||
|
|
||||||
$criteria->add(AbeRequestsPeer::ABE_REQ_UID, $_REQUEST['REQ_UID']);
|
|
||||||
$criteria->addJoin(AbeRequestsPeer::ABE_UID, AbeConfigurationPeer::ABE_UID);
|
|
||||||
$criteria->addJoin(AbeResponsesPeer::ABE_REQ_UID, AbeRequestsPeer::ABE_REQ_UID);
|
|
||||||
$resultRes = AbeRequestsPeer::doSelectRS($criteria);
|
|
||||||
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
||||||
|
|
||||||
$resultRes->next();
|
|
||||||
$dataRes = Array();
|
|
||||||
$message = 'The user has not responded to this request.';
|
|
||||||
|
|
||||||
if ($dataRes = $resultRes->getRow()) {
|
|
||||||
$_SESSION['CURRENT_DYN_UID'] = trim($dataRes['DYN_UID']);
|
|
||||||
$dynaform = new Form($dataRes['PRO_UID'] . PATH_SEP . trim($dataRes['DYN_UID']), PATH_DYNAFORM, SYS_LANG, false);
|
|
||||||
$dynaform->mode = 'view';
|
|
||||||
|
|
||||||
if ($dataRes['ABE_RES_DATA'] != '') {
|
|
||||||
$value = unserialize($dataRes['ABE_RES_DATA']);
|
|
||||||
|
|
||||||
if (is_array($value)) {
|
|
||||||
$dynaform->values = $value;
|
|
||||||
|
|
||||||
foreach ($dynaform->fields as $fieldName => $field) {
|
|
||||||
if ($field->type == 'submit') {
|
|
||||||
unset($dynaform->fields[$fieldName]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$message = $dynaform->render(PATH_CORE . 'templates/xmlform.html', $scriptCode);
|
|
||||||
} else {
|
|
||||||
$response = $dynaform->render(PATH_CORE . 'templates/xmlform.html', $scriptCode);
|
|
||||||
$field = $dynaform->fields[$dataRes['ABE_ACTION_FIELD']];
|
|
||||||
$message = '<b>Type: </b>' . $field->type . '<br>';
|
|
||||||
|
|
||||||
switch ($field->type) {
|
|
||||||
case 'dropdown':
|
|
||||||
case 'radiogroup':
|
|
||||||
$message .=$field->label . ' - ';
|
|
||||||
$message .= $field->options[$value];
|
|
||||||
break;
|
|
||||||
case 'yesno':
|
|
||||||
$message .= '<b>' . $field->label . ' </b>- ';
|
|
||||||
$message .= ($value == 1) ? 'Yes' : 'No';
|
|
||||||
break;
|
|
||||||
case 'checkbox':
|
|
||||||
$message .= '<b>' . $field->label . '</b> - ';
|
|
||||||
$message .= ($value == 'On') ? 'Check' : 'Uncheck';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $message;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
229
workflow/engine/templates/actionsByEmail/report.js
Normal file
229
workflow/engine/templates/actionsByEmail/report.js
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
var actionsByEmailGrid;
|
||||||
|
var store;
|
||||||
|
var win ;
|
||||||
|
|
||||||
|
new Ext.KeyMap(document, {
|
||||||
|
key: Ext.EventObject.F5,
|
||||||
|
fn: function(keycode, e) {
|
||||||
|
if (! e.ctrlKey) {
|
||||||
|
if (Ext.isIE) {
|
||||||
|
e.browserEvent.keyCode = 8;
|
||||||
|
}
|
||||||
|
e.stopEvent();
|
||||||
|
document.location = document.location;
|
||||||
|
} else {
|
||||||
|
Ext.Msg.alert(_('ID_REFRESH_LABEL'), _('ID_REFRESH_MESSAGE'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Ext.onReady(function(){
|
||||||
|
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||||
|
Ext.QuickTips.init();
|
||||||
|
|
||||||
|
store = new Ext.data.GroupingStore( {
|
||||||
|
proxy : new Ext.data.HttpProxy({
|
||||||
|
url: '../actionsByEmail/actionsByEmailAjax',
|
||||||
|
method: 'POST'
|
||||||
|
}),
|
||||||
|
|
||||||
|
reader : new Ext.data.JsonReader( {
|
||||||
|
totalProperty: 'totalCount',
|
||||||
|
root: 'data',
|
||||||
|
fields : [
|
||||||
|
{name : 'ABE_UID'},
|
||||||
|
{name : 'ABE_REQ_UID'},
|
||||||
|
{name : 'APP_UID'},
|
||||||
|
{name : 'TAS_UID'},
|
||||||
|
{name : 'ABE_REQ_DATE'},
|
||||||
|
{name : 'ABE_REQ_SUBJECT'},
|
||||||
|
{name : 'APP_NUMBER'},
|
||||||
|
{name : 'USER'},
|
||||||
|
{name : 'ABE_REQ_SENT_TO'},
|
||||||
|
{name : 'ABE_REQ_STATUS'},
|
||||||
|
{name : 'ABE_REQ_ANSWERED'},
|
||||||
|
{name : 'ABE_RES_MESSAGE'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
store.setBaseParam( 'action', 'loadActionByEmail' );
|
||||||
|
|
||||||
|
actionsByEmailGrid = new Ext.grid.GridPanel( {
|
||||||
|
region: 'center',
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'actionsByEmailGrid',
|
||||||
|
title : '',
|
||||||
|
stateful : true,
|
||||||
|
stateId : 'grid',
|
||||||
|
enableColumnResize: true,
|
||||||
|
enableHdMenu: true,
|
||||||
|
frame:false,
|
||||||
|
columnLines: true,
|
||||||
|
|
||||||
|
cm: new Ext.grid.ColumnModel({
|
||||||
|
defaults: {
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{id: "ABE_UID", dataIndex: "ABE_UID", hidden:true, hideable:false},
|
||||||
|
{header: _("ID_DATE").toUpperCase(), width: 100, dataIndex: "ABE_REQ_DATE", sortable: true},
|
||||||
|
{header: "Case Number".toUpperCase(), width: 70, dataIndex: "APP_NUMBER", sortable: true},
|
||||||
|
{header: _("ID_SUBJECT").toUpperCase(), width: 150, dataIndex: "ABE_REQ_SUBJECT", sortable: true},
|
||||||
|
{header: _("ID_FROM").toUpperCase(), width: 110, dataIndex: "USER", sortable: true},
|
||||||
|
{header: _("ID_TO").toUpperCase(), width: 110, dataIndex: "ABE_REQ_SENT_TO", sortable: true},
|
||||||
|
{header: _("ID_STATUS").toUpperCase(), width: 40, dataIndex: "ABE_REQ_STATUS", sortable: true},
|
||||||
|
{header: "Answered".toUpperCase(), width: 60, dataIndex: "ABE_REQ_ANSWERED"},
|
||||||
|
{header: "View Response".toUpperCase(), width: 80, sortable: false, align: 'center', renderer: function(val){ return '<img src="/images/ext/default/s.gif" class="x-tree-node-icon ss_layout_header" unselectable="off" id="extdd-17" onclick="openForm()" '; }, dataIndex: 'somefieldofyourstore'},
|
||||||
|
{header: "Error message".toUpperCase(), width: 130,dataIndex: "ABE_RES_MESSAGE",sortable: false}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
store: store,
|
||||||
|
tbar:[
|
||||||
|
{
|
||||||
|
text: _("ID_RESEND_EMAIL"),
|
||||||
|
iconCls: 'button_menu_ext ss_sprite ss_world',
|
||||||
|
handler:ForwardEmail
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// paging bar on the bottom
|
||||||
|
bbar: new Ext.PagingToolbar({
|
||||||
|
pageSize: 25,
|
||||||
|
store: store,
|
||||||
|
displayInfo: true,
|
||||||
|
displayMsg: _('ID_DISPLATING_ACTIONSBYEMAIL') + ' {0} - {1} ' + _('ID_DISPLAY_OF') + ' {2}'//,
|
||||||
|
}),
|
||||||
|
viewConfig: {
|
||||||
|
forceFit: true
|
||||||
|
},
|
||||||
|
listeners: {
|
||||||
|
render: function(){
|
||||||
|
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
store.load({params:{ start : 0 , limit : 25 }});
|
||||||
|
actionsByEmailGrid.addListener('rowcontextmenu', onMessageContextMenu,this);
|
||||||
|
actionsByEmailGrid.on('rowcontextmenu', function (grid, rowIndex, evt) {
|
||||||
|
var sm = grid.getSelectionModel();
|
||||||
|
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||||
|
|
||||||
|
var rowSelected = Ext.getCmp('actionsByEmailGrid').getSelectionModel().getSelected();
|
||||||
|
|
||||||
|
}, this);
|
||||||
|
actionsByEmailGrid.on('contextmenu', function (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
}, this);
|
||||||
|
|
||||||
|
function onMessageContextMenu(grid, rowIndex, e) {
|
||||||
|
e.stopEvent();
|
||||||
|
var coords = e.getXY();
|
||||||
|
messageContextMenu.showAt([coords[0], coords[1]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var viewport = new Ext.Viewport({
|
||||||
|
layout: 'border',
|
||||||
|
autoScroll: true,
|
||||||
|
items: [
|
||||||
|
actionsByEmailGrid
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function openForm(){
|
||||||
|
var rows = actionsByEmailGrid.getSelectionModel().getSelections();
|
||||||
|
var REQ_UID = '';
|
||||||
|
var ids = '';
|
||||||
|
for (i=0; i<rows.length; i++) {
|
||||||
|
if (i != 0 ) {
|
||||||
|
ids += ',';
|
||||||
|
}
|
||||||
|
ids += rows[i].get('APP_NUMBER') + ', ';
|
||||||
|
ids += rows[i].get('ABE_REQ_SUBJECT');
|
||||||
|
REQ_UID += rows[i].get('ABE_REQ_UID');
|
||||||
|
}
|
||||||
|
if ( REQ_UID != '' ) {
|
||||||
|
win = new Ext.Window({
|
||||||
|
id: 'win',
|
||||||
|
title: ids,
|
||||||
|
pageX: 100 ,
|
||||||
|
pageY: 100 ,
|
||||||
|
width: 500,
|
||||||
|
floatable: true,
|
||||||
|
autoHeight:true,
|
||||||
|
modal: true,
|
||||||
|
layout: 'fit',
|
||||||
|
autoLoad : {
|
||||||
|
url : '../actionsByEmail/actionsByEmailAjax',
|
||||||
|
params : { action:'viewForm',REQ_UID : REQ_UID },
|
||||||
|
scripts: true
|
||||||
|
},
|
||||||
|
plain: true,
|
||||||
|
buttons: [{
|
||||||
|
id: 'btn',
|
||||||
|
text: _('ID_CLOSE'),
|
||||||
|
handler: function() {
|
||||||
|
win.hide();
|
||||||
|
}
|
||||||
|
}]}).show();
|
||||||
|
} else {
|
||||||
|
Ext.Msg.show({
|
||||||
|
title:'',
|
||||||
|
msg: TRANSLATIONS.ID_NO_SELECTION_WARNING,
|
||||||
|
buttons: Ext.Msg.INFO,
|
||||||
|
fn: function(){},
|
||||||
|
animEl: 'elId',
|
||||||
|
icon: Ext.MessageBox.INFO,
|
||||||
|
buttons: Ext.MessageBox.OK
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ForwardEmail(){
|
||||||
|
var rows = actionsByEmailGrid.getSelectionModel().getSelections();
|
||||||
|
var REQ_UID = '';
|
||||||
|
var ids = '';
|
||||||
|
for (i=0; i<rows.length; i++) {
|
||||||
|
if (i != 0 ) {
|
||||||
|
ids += ',';
|
||||||
|
}
|
||||||
|
REQ_UID += rows[i].get('ABE_REQ_UID');
|
||||||
|
ids += rows[i].get('APP_NUMBER') + ', ';
|
||||||
|
ids += rows[i].get('ABE_REQ_SUBJECT');
|
||||||
|
}
|
||||||
|
if ( REQ_UID != '' ) {
|
||||||
|
win = new Ext.Window({
|
||||||
|
id: 'win',
|
||||||
|
title: ids,
|
||||||
|
pageX: 100 ,
|
||||||
|
pageY: 100 ,
|
||||||
|
width: 500,
|
||||||
|
floatable: true,
|
||||||
|
autoHeight:true,
|
||||||
|
modal: true,
|
||||||
|
layout: 'fit',
|
||||||
|
autoLoad : {
|
||||||
|
url : '../actionsByEmail/actionsByEmailAjax',
|
||||||
|
params : { action:'forwardMail',REQ_UID :REQ_UID},
|
||||||
|
scripts: true
|
||||||
|
},
|
||||||
|
plain: true,
|
||||||
|
buttons: [{
|
||||||
|
id: 'btn',
|
||||||
|
text: _('ID_CLOSE'),
|
||||||
|
handler: function() {
|
||||||
|
win.hide();
|
||||||
|
}
|
||||||
|
}]}).show();
|
||||||
|
} else {
|
||||||
|
Ext.Msg.show({
|
||||||
|
title:'',
|
||||||
|
msg: _("ID_SELECT_ITEM_FROM_LIST"),
|
||||||
|
buttons: Ext.Msg.INFO,
|
||||||
|
fn: function(){},
|
||||||
|
animEl: 'elId',
|
||||||
|
icon: Ext.MessageBox.INFO,
|
||||||
|
buttons: Ext.MessageBox.OK
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user