Merged in zeitmaster/processmaker-goose (pull request #1675)

PM-1718: Actions By Email feature integrated as part of the core classes of ProcessMaker
This commit is contained in:
Julio Cesar Laura Avendaño
2015-03-23 09:29:40 -04:00
33 changed files with 7171 additions and 19 deletions

View File

@@ -337,7 +337,6 @@ class WebApplication
$this->rest->addAPIClass($namespace);
}
}
// adding aliases for Restler
if (array_key_exists('alias', $config)) {
foreach ($config['alias'] as $alias => $aliasData) {

View File

@@ -264,4 +264,4 @@
}
return found;
}
})();
})();

View File

@@ -0,0 +1,238 @@
<?php
class actionsByEmailClass extends PMPlugin
{
public function __construct()
{
}
public function setup()
{
}
public function getFieldsForPageSetup()
{
return array();
}
public function updateFieldsForPageSetup()
{
}
public function sendActionsByEmail($data)
{
try {
// Validations
if (!is_object($data)) {
throw new Exception('The parameter $data is null.');
}
if (!isset($data->TAS_UID)) {
throw new Exception('The parameter $data->TAS_UID is null.');
}
if (!isset($data->APP_UID)) {
throw new Exception('The parameter $data->APP_UID is null.');
}
if (!isset($data->DEL_INDEX)) {
throw new Exception('The parameter $data->DEL_INDEX is null.');
}
if ($data->TAS_UID == '') {
throw new Exception('The parameter $data->TAS_UID is empty.');
}
if ($data->APP_UID == '') {
throw new Exception('The parameter $data->APP_UID is empty.');
}
if ($data->DEL_INDEX == '') {
throw new Exception('The parameter $data->DEL_INDEX is empty.');
}
G::LoadClass('pmFunctions');
$emailSetup = getEmailConfiguration();
if (!empty($emailSetup)) {
require_once 'classes/model/AbeConfiguration.php';
G::LoadClass('case');
$cases = new Cases();
$caseFields = $cases->loadCase($data->APP_UID);
$criteria = new Criteria();
$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']);
if ($configuration['ABE_EMAIL_FIELD'] != '' && isset($caseFields['APP_DATA'][$configuration['ABE_EMAIL_FIELD']])) {
$email = trim($caseFields['APP_DATA'][$configuration['ABE_EMAIL_FIELD']]);
} else {
require_once 'classes/model/Users.php';
$userInstance = new Users();
$userInfo = $userInstance->getAllInformation($data->USR_UID);
$email = $userInfo['mail'];
}
if ($email != '') {
$subject = $caseFields['APP_TITLE'];
// Create
require_once 'classes/model/AbeRequests.php';
$abeRequest = array();
$abeRequest['ABE_REQ_UID'] = '';
$abeRequest['ABE_UID'] = $configuration['ABE_UID'];
$abeRequest['APP_UID'] = $data->APP_UID;
$abeRequest['DEL_INDEX'] = $data->DEL_INDEX;
$abeRequest['ABE_REQ_SENT_TO'] = $email;
$abeRequest['ABE_REQ_SUBJECT'] = $subject;
$abeRequest['ABE_REQ_BODY'] = '';
$abeRequest['ABE_REQ_ANSWERED'] = 0;
$abeRequest['ABE_REQ_STATUS'] = 'PENDING';
try {
$abeRequestsInstance = new AbeRequests();
$abeRequest['ABE_REQ_UID'] = $abeRequestsInstance->createOrUpdate($abeRequest);
} catch (Exception $error) {
throw $error;
}
if ($configuration['ABE_TYPE'] != '') {
// Email
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
$scriptCode = '';
// foreach ($dynaform->fields as $fieldName => $field) {
// if ($field->type == 'submit') {
// unset($dynaform->fields[$fieldName]);
// }
// }
$__ABE__ = '';
$link = (G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/ActionsByEmail';
switch ($configuration['ABE_TYPE']) {
case 'LINK':
// $__ABE__ .= $dynaform->render(PATH_FEATURES . 'actionsByEmail/xmlform.html', $scriptCode) . '<br />';
$__ABE__ .= '<a href="' . $link . 'dataForm?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&DYN_UID=' . G::encrypt($configuration['DYN_UID'], URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Please complete this form</a>';
break;
// coment
case 'FIELD':
$variableService = new \ProcessMaker\Services\Api\Project\Variable();
$variables = $variableService->doGetVariables($caseFields['PRO_UID']);
$field = new stdClass();
$field->label = 'Test';
$field->type = 'dropdown';
$field->options = array();
$actionField = str_replace('@@', '', $configuration['ABE_ACTION_FIELD']);
foreach ($variables as $variable) {
if ($variable['var_name'] == $actionField) {
$field->label = $variable['var_name'];
$field->type = 'dropdown';
$values = json_decode($variable['var_accepted_values']);
foreach ($values as $value) {
$field->options[$value->keyValue] = $value->value;
}
}
}
$__ABE__ .= '<strong>' . $field->label . '</strong><br /><table align="left" border="0"><tr>';
switch ($field->type) {
case 'dropdown':
case 'radiogroup':
$index = 1;
$__ABE__.='<br /><td><table align="left" cellpadding="2"><tr>';
foreach ($field->options as $optValue => $optName) {
$__ABE__ .= '<td align="center"><a style="text-decoration: none; color: #000; background-color: #E5E5E5; ';
$__ABE__ .= 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EFEFEF, endColorstr=#BCBCBC); ';
$__ABE__ .= 'background-image: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), #BCBCBC); ';
$__ABE__ .= 'background-image: -webkit-linear-gradient(top, #EFEFEF, #BCBCBC); ';
$__ABE__ .= 'background-image: -moz-linear-gradient(top, #EFEFEF, #BCBCBC); background-image: -ms-linear-gradient(top, #EFEFEF, #BCBCBC); ';
$__ABE__ .= 'background-image: -o-linear-gradient(top, #EFEFEF, #BCBCBC); border: 1px solid #AAAAAA; ';
$__ABE__ .= 'border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); ';
$__ABE__ .= 'font-family: Arial,serif; font-size: 9pt; font-weight: 400; line-height: 14px; margin: 2px 0; padding: 2px 7px; ';
$__ABE__ .= 'text-decoration: none; text-transform: capitalize;" href="' .urldecode(urlencode($link)). '?ACTION='.G::encrypt('processABE', URL_KEY).'&APP_UID=';
$__ABE__ .= G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY);
$__ABE__ .= '&FIELD=' . G::encrypt($actionField, URL_KEY) . '&VALUE=' . G::encrypt($optValue, URL_KEY);
$__ABE__ .= '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank" >' . $optName;
$__ABE__ .= '</a></td>' . (($index % 5 == 0) ? '</tr><tr>' : ' ');
$index++;
}
$__ABE__.='</tr></table></td>';
break;
case 'yesno':
$__ABE__ .= '<td align="center"><a href="' . $link . 'dataField?APP_UID=' . urlencode(G::encrypt($data->APP_UID, URL_KEY)) . '&DEL_INDEX=' . urlencode(G::encrypt($data->DEL_INDEX, URL_KEY)). '&FIELD=' . urlencode(G::encrypt($actionField, URL_KEY)) . '&VALUE=' . urlencode(G::encrypt(1, URL_KEY)) . '&ABER=' . urlencode(G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY)) . '" target="_blank">' . G::LoadTranslation('ID_YES_VALUE') . '</a></td>';
$__ABE__ .= '<td align="center"><a href="' . $link . 'dataField?APP_UID=' . urlencode(G::encrypt($data->APP_UID, URL_KEY)) . '&DEL_INDEX=' . urlencode(G::encrypt($data->DEL_INDEX, URL_KEY)) . '&FIELD=' . urlencode(G::encrypt($actionField, URL_KEY)) . '&VALUE=' . urlencode(G::encrypt(0, URL_KEY)) . '&ABER=' . urlencode(G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY)) . '" target="_blank">' . G::LoadTranslation('ID_NO_VALUE') . '</a></td>';
break;
case 'checkbox':
$__ABE__ .= '<td align="center"><a href="' . $link . 'dataField?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&FIELD=' . G::encrypt($actionField, URL_KEY) . '&VALUE=' . G::encrypt($field->value, URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Check</a></td>';
$__ABE__ .= '<td align="center"><a href="' . $link . 'dataField?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&FIELD=' . G::encrypt($actionField, URL_KEY) . '&VALUE=' . G::encrypt($field->value, URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Uncheck</a></td>';
break;
}
$__ABE__ .= '</tr></table>';
break;
}
$__ABE__ = preg_replace('/\<img src=\"\/js\/maborak\/core\/images\/(.+?)\>/', '' , $__ABE__);
$__ABE__ = preg_replace('/\<input\b[^>]*\/>/', '' , $__ABE__);
$__ABE__ = preg_replace('/<select\b[^>]*>(.*?)<\/select>/is', "", $__ABE__);
$__ABE__ = preg_replace('/align=\"center\"/', '' , $__ABE__);
$__ABE__ = preg_replace('/class="tableGrid_view" /', 'class="tableGrid_view" width="100%" ', $__ABE__);
$caseFields['APP_DATA']['__ABE__'] = $__ABE__;
G::LoadClass("Users");
$user = new Users();
$userDetails = $user->loadDetails($data->USR_UID);
$emailFrom = $userDetails["USR_EMAIL"];
G::LoadClass('wsBase');
$wsBaseInstance = new wsBase();
$result = $wsBaseInstance->sendMessage($data->APP_UID,
$emailFrom,
$email,
'',
'',
$subject,
$configuration['ABE_TEMPLATE'],
$caseFields['APP_DATA'],
'');
$abeRequest['ABE_REQ_STATUS'] = ($result->status_code == 0 ? 'SENT' : 'ERROR');
$body = '';
$messageSent = executeQuery('SELECT `APP_MSG_BODY` FROM `APP_MESSAGE` ORDER BY `APP_MSG_SEND_DATE` DESC LIMIT 1');
if (!empty($messageSent) && is_array($messageSent)) {
$body = $messageSent[1]['APP_MSG_BODY'];
}
$abeRequest['ABE_REQ_BODY'] = $body;
// Update
try {
$abeRequestsInstance = new AbeRequests();
$abeRequestsInstance->createOrUpdate($abeRequest);
} catch (Exception $error) {
throw $error;
}
}
}
}
}
} catch (Exception $error) {
throw $error;
}
}
}

View File

@@ -0,0 +1,84 @@
<?php
function postNote($httpData)
{
//extract(getExtJSParams());
$appUid = (isset($httpData->appUid))? $httpData->appUid : '';
$usrUid = (isset($httpData->usrUid))? $httpData->usrUid : '' ;
require_once ( "classes/model/AppNotes.php" );
$appNotes = new AppNotes();
$noteContent = addslashes($httpData->noteText);
$result = $appNotes->postNewNote($appUid, $usrUid, $noteContent, false);
//return true;
//die();
//send the response to client
@ini_set('implicit_flush', 1);
ob_start();
//echo G::json_encode($result);
@ob_flush();
@flush();
@ob_end_flush();
ob_implicit_flush(1);
//return true;
//send notification in background
$noteRecipientsList = array();
G::LoadClass('case');
$oCase = new Cases();
$p = $oCase->getUsersParticipatedInCase($appUid);
foreach ($p['array'] as $key => $userParticipated) {
$noteRecipientsList[] = $key;
}
$noteRecipients = implode(",", $noteRecipientsList);
$appNotes->sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients);
}
function loadAbeRequest($AbeRequestsUid)
{
require_once 'classes/model/AbeRequests.php';
$criteria = new Criteria();
$criteria->add(AbeRequestsPeer::ABE_REQ_UID, $AbeRequestsUid);
$resultRequests = AbeRequestsPeer::doSelectRS($criteria);
$resultRequests->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$resultRequests->next();
$abeRequests = $resultRequests->getRow();
return $abeRequests;
}
function loadAbeConfiguration($AbeConfigurationUid)
{
require_once 'classes/model/AbeConfiguration.php';
$criteria = new Criteria();
$criteria->add(AbeConfigurationPeer::ABE_UID, $AbeConfigurationUid);
$result = AbeConfigurationPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$result->next();
$abeConfiguration = $result->getRow();
return $abeConfiguration;
}
function uploadAbeRequest($data)
{
require_once 'classes/model/AbeRequests.php';
try {
$abeRequestsInstance = new AbeRequests();
$abeRequestsInstance->createOrUpdate($data);
} catch (Exception $error) {
throw $error;
}
}

View File

@@ -0,0 +1,97 @@
<?php
require_once 'classes/model/om/BaseAbeConfiguration.php';
/**
* Skeleton subclass for representing a row from the 'ABE_CONFIGURATION' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeConfiguration extends BaseAbeConfiguration
{
private $filterThisFields = array('ABE_UID', 'PRO_UID', 'TAS_UID', 'ABE_TYPE',
'ABE_TEMPLATE', 'ABE_DYN_TYPE', 'DYN_UID','ABE_EMAIL_FIELD',
'ABE_ACTION_FIELD', 'ABE_CASE_NOTE_IN_RESPONSE', 'ABE_CREATE_DATE','ABE_UPDATE_DATE');
public function load($abeUid)
{
try {
$abeConfigurationInstance = AbeConfigurationPeer::retrieveByPK($abeUid);
$fields = $abeConfigurationInstance->toArray(BasePeer::TYPE_FIELDNAME);
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
foreach ($data as $field => $value) {
if (!in_array($field, $this->filterThisFields)) {
unset($data[$field]);
}
}
$connection = Propel::getConnection(AbeConfigurationPeer::DATABASE_NAME);
try {
if (!isset($data['ABE_UID'])) {
$data['ABE_UID'] = '';
}
if ($data['ABE_UID'] == '') {
$data['ABE_UID'] = G::generateUniqueID();
$data['ABE_CREATE_DATE'] = date('Y-m-d H:i:s');
$abeConfigurationInstance = new AbeConfiguration();
} else {
$abeConfigurationInstance = AbeConfigurationPeer::retrieveByPK($data['ABE_UID']);
}
$data['ABE_UPDATE_DATE'] = date('Y-m-d H:i:s');
$abeConfigurationInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($abeConfigurationInstance->validate()) {
$connection->begin();
$result = $abeConfigurationInstance->save();
$connection->commit();
return $data['ABE_UID'];
} else {
$message = '';
$validationFailures = $abeConfigurationInstance->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw (new Exception('Error trying to update: ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function deleteByTasUid($tasUid)
{
try {
$criteria = new Criteria('workflow');
$criteria->add(AbeConfigurationPeer::TAS_UID, $tasUid);
AbeConfigurationPeer::doDelete($criteria);
} catch (Exception $error) {
throw $error;
}
}
}
// AbeConfiguration

View File

@@ -0,0 +1,25 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseAbeConfigurationPeer.php';
// include object class
include_once 'classes/model/AbeConfiguration.php';
/**
* Skeleton subclass for performing query and update operations on the 'ABE_CONFIGURATION' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeConfigurationPeer extends BaseAbeConfigurationPeer
{
}
// AbeConfigurationPeer

View File

@@ -0,0 +1,87 @@
<?php
require_once 'classes/model/om/BaseAbeRequests.php';
/**
* Skeleton subclass for representing a row from the 'ABE_REQUESTS' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeRequests extends BaseAbeRequests
{
private $filterThisFields = array('ABE_REQ_UID', 'ABE_UID', 'APP_UID', 'DEL_INDEX',
'ABE_REQ_SENT_TO', 'ABE_REQ_SUBJECT', 'ABE_REQ_BODY',
'ABE_REQ_DATE', 'ABE_REQ_STATUS', 'ABE_REQ_ANSWERED');
public function load($abeRequestUid)
{
try {
$abeRequestInstance = AbeRequestsPeer::retrieveByPK($abeRequestUid);
$fields = $abeRequestInstance->toArray(BasePeer::TYPE_FIELDNAME);
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
$additionalFields = array();
foreach ($data as $field => $value) {
if (!in_array($field, $this->filterThisFields)) {
$additionalFields[$field] = $value;
unset($data[$field]);
}
}
$connection = Propel::getConnection(AbeRequestsPeer::DATABASE_NAME);
try {
if (!isset($data['ABE_REQ_UID'])) {
$data['ABE_REQ_UID'] = '';
}
if ($data['ABE_REQ_UID'] == '') {
$data['ABE_REQ_UID'] = G::generateUniqueID();
$data['ABE_REQ_DATE'] = date('Y-m-d H:i:s');
$AbeRequestsInstance = new AbeRequests();
} else {
$AbeRequestsInstance = AbeRequestsPeer::retrieveByPK($data['ABE_REQ_UID']);
}
$AbeRequestsInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($AbeRequestsInstance->validate()) {
$connection->begin();
$result = $AbeRequestsInstance->save();
$connection->commit();
return $data['ABE_REQ_UID'];
} else {
$message = '';
$validationFailures = $AbeRequestsInstance->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception('Error trying to update: ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
}
// AbeRequests

View File

@@ -0,0 +1,24 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseAbeRequestsPeer.php';
// include object class
include_once 'classes/model/AbeRequests.php';
/**
* Skeleton subclass for performing query and update operations on the 'ABE_REQUESTS' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeRequestsPeer extends BaseAbeRequestsPeer
{
}
// AbeRequestsPeer

View File

@@ -0,0 +1,88 @@
<?php
require_once 'classes/model/om/BaseAbeResponses.php';
/**
* Skeleton subclass for representing a row from the 'ABE_RESPONSES' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeResponses extends BaseAbeResponses
{
private $filterThisFields = array('ABE_RES_UID', 'ABE_REQ_UID', 'ABE_RES_CLIENT_IP', 'ABE_RES_DATA',
'ABE_RES_DATE', 'ABE_RES_STATUS', 'ABE_RES_MESSAGE');
public function load($abeResponsesUid)
{
try {
$abeResponsesInstance = AbeResponsesPeer::retrieveByPK($abeResponsesUid);
$fields = $abeResponsesInstance->toArray(BasePeer::TYPE_FIELDNAME);
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
$additionalFields = array();
foreach ($data as $field => $value) {
if (!in_array($field, $this->filterThisFields)) {
$additionalFields[$field] = $value;
unset($data[$field]);
}
}
$connection = Propel::getConnection(AbeResponsesPeer::DATABASE_NAME);
try {
if (!isset($data['ABE_RES_UID'])) {
$data['ABE_RES_UID'] = '';
}
if ($data['ABE_RES_UID'] == '') {
$data['ABE_RES_UID'] = G::generateUniqueID();
$data['ABE_RES_DATE'] = date('Y-m-d H:i:s');
$AbeResponsesInstance = new AbeResponses();
} else {
$AbeResponsesInstance = AbeResponsesPeer::retrieveByPK($data['ABE_RES_UID']);
}
//$data['ABE_RES_UPDATE'] = date('Y-m-d H:i:s');
$AbeResponsesInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($AbeResponsesInstance->validate()) {
$connection->begin();
$result = $AbeResponsesInstance->save();
$connection->commit();
return $data['ABE_RES_UID'];
} else {
$message = '';
$validationFailures = $AbeResponsesInstance->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception('Error trying to update: ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
}
// AbeResponses

View File

@@ -0,0 +1,25 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseAbeResponsesPeer.php';
// include object class
include_once 'classes/model/AbeResponses.php';
/**
* Skeleton subclass for performing query and update operations on the 'ABE_RESPONSES' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class AbeResponsesPeer extends BaseAbeResponsesPeer
{
}
// AbeResponsesPeer

View File

@@ -174,7 +174,20 @@ class AppDelegation extends BaseAppDelegation
$data->DEL_INDEX = $delIndex;
$data->USR_UID = $sUsrUid;
$oPluginRegistry = &PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers( PM_CREATE_NEW_DELEGATION, $data );
$oPluginRegistry->executeTriggers(PM_CREATE_NEW_DELEGATION, $data);
/*----------------------------------********---------------------------------*/
// this section evaluates the actions by email trigger execution please
// modify this section carefully, the if evaluation checks if the license has been
// activated in order to send the mail according to the configuration table
if (PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
G::LoadClass('actionsByEmail');
$actionsByEmail = new actionsByEmailClass();
$actionsByEmail->sendActionsByEmail($data);
}
/*----------------------------------********---------------------------------*/
}
return $delIndex;

View File

@@ -0,0 +1,94 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'ABE_CONFIGURATION' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class AbeConfigurationMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.AbeConfigurationMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('ABE_CONFIGURATION');
$tMap->setPhpName('AbeConfiguration');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('ABE_UID', 'AbeUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('ABE_TYPE', 'AbeType', 'string', CreoleTypes::VARCHAR, true, 10);
$tMap->addColumn('ABE_TEMPLATE', 'AbeTemplate', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('ABE_DYN_TYPE', 'AbeDynType', 'string', CreoleTypes::VARCHAR, true, 10);
$tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('ABE_EMAIL_FIELD', 'AbeEmailField', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('ABE_ACTION_FIELD', 'AbeActionField', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('ABE_CASE_NOTE_IN_RESPONSE', 'AbeCaseNoteInResponse', 'int', CreoleTypes::INTEGER, false, null);
$tMap->addColumn('ABE_CREATE_DATE', 'AbeCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('ABE_UPDATE_DATE', 'AbeUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
} // doBuild()
} // AbeConfigurationMapBuilder

View File

@@ -0,0 +1,90 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'ABE_REQUESTS' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class AbeRequestsMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.AbeRequestsMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('ABE_REQUESTS');
$tMap->setPhpName('AbeRequests');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('ABE_REQ_UID', 'AbeReqUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('ABE_UID', 'AbeUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('ABE_REQ_SENT_TO', 'AbeReqSentTo', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('ABE_REQ_SUBJECT', 'AbeReqSubject', 'string', CreoleTypes::VARCHAR, true, 150);
$tMap->addColumn('ABE_REQ_BODY', 'AbeReqBody', 'string', CreoleTypes::LONGVARCHAR, true, null);
$tMap->addColumn('ABE_REQ_DATE', 'AbeReqDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('ABE_REQ_STATUS', 'AbeReqStatus', 'string', CreoleTypes::VARCHAR, false, 10);
$tMap->addColumn('ABE_REQ_ANSWERED', 'AbeReqAnswered', 'int', CreoleTypes::TINYINT, true, null);
} // doBuild()
} // AbeRequestsMapBuilder

View File

@@ -0,0 +1,84 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'ABE_RESPONSES' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class AbeResponsesMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.AbeResponsesMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('ABE_RESPONSES');
$tMap->setPhpName('AbeResponses');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('ABE_RES_UID', 'AbeResUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('ABE_REQ_UID', 'AbeReqUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('ABE_RES_CLIENT_IP', 'AbeResClientIp', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('ABE_RES_DATA', 'AbeResData', 'string', CreoleTypes::LONGVARCHAR, true, null);
$tMap->addColumn('ABE_RES_DATE', 'AbeResDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('ABE_RES_STATUS', 'AbeResStatus', 'string', CreoleTypes::VARCHAR, true, 10);
$tMap->addColumn('ABE_RES_MESSAGE', 'AbeResMessage', 'string', CreoleTypes::VARCHAR, false, 255);
} // doBuild()
} // AbeResponsesMapBuilder

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -38,7 +38,7 @@ class Installer extends Controller
public function index ($httpData)
{
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))){
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') && (file_exists($this->path_shared . 'partner.info'))) {
$this->includeExtJS( 'installer/stopInstall');
$this->setView( 'installer/mainStopInstall' );
G::RenderPage( 'publish', 'extJs' );
@@ -786,11 +786,12 @@ class Installer extends Controller
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/schema.sql' );
$this->mysqlFileQuery( PATH_RBAC_HOME . 'engine/data/mysql/insert.sql' );
$query = sprintf( "USE %s;", $wf_workpace );
$this->mysqlQuery( $query );
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/schema.sql' );
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/insert.sql' );
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
$this->setPartner();

View File

@@ -2591,13 +2591,74 @@ DROP TABLE IF EXISTS `ELEMENT_TASK_RELATION`;
CREATE TABLE `ELEMENT_TASK_RELATION`
(
`ETR_UID` VARCHAR(32) NOT NULL,
`PRJ_UID` VARCHAR(32) NOT NULL,
`ELEMENT_UID` VARCHAR(32) NOT NULL,
`ELEMENT_TYPE` VARCHAR(50) default '' NOT NULL,
`TAS_UID` VARCHAR(32) NOT NULL,
PRIMARY KEY (`ETR_UID`)
`ETR_UID` VARCHAR(32) NOT NULL,
`PRJ_UID` VARCHAR(32) NOT NULL,
`ELEMENT_UID` VARCHAR(32) NOT NULL,
`ELEMENT_TYPE` VARCHAR(50) default '' NOT NULL,
`TAS_UID` VARCHAR(32) NOT NULL,
PRIMARY KEY (`ETR_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- ABE_CONFIGURATION
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `ABE_CONFIGURATION`;
CREATE TABLE `ABE_CONFIGURATION`
(
`ABE_UID` VARCHAR(32) default '' NOT NULL,
`PRO_UID` VARCHAR(32) default '' NOT NULL,
`TAS_UID` VARCHAR(32) default '' NOT NULL,
`ABE_TYPE` VARCHAR(10) default '' NOT NULL,
`ABE_TEMPLATE` VARCHAR(100) default '' NOT NULL,
`ABE_DYN_TYPE` VARCHAR(10) default 'NORMAL' NOT NULL,
`DYN_UID` VARCHAR(32) default '' NOT NULL,
`ABE_EMAIL_FIELD` VARCHAR(255) default '' NOT NULL,
`ABE_ACTION_FIELD` VARCHAR(255) default '',
`ABE_CASE_NOTE_IN_RESPONSE` INTEGER default 0,
`ABE_CREATE_DATE` DATETIME NOT NULL,
`ABE_UPDATE_DATE` DATETIME,
PRIMARY KEY (`ABE_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='The plugin table for actionsByEmail';
#-----------------------------------------------------------------------------
#-- ABE_REQUESTS
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `ABE_REQUESTS`;
CREATE TABLE `ABE_REQUESTS`
(
`ABE_REQ_UID` VARCHAR(32) default '' NOT NULL,
`ABE_UID` VARCHAR(32) default '' NOT NULL,
`APP_UID` VARCHAR(32) default '' NOT NULL,
`DEL_INDEX` INTEGER default 0 NOT NULL,
`ABE_REQ_SENT_TO` VARCHAR(100) default '' NOT NULL,
`ABE_REQ_SUBJECT` VARCHAR(150) default '' NOT NULL,
`ABE_REQ_BODY` MEDIUMTEXT NOT NULL,
`ABE_REQ_DATE` DATETIME NOT NULL,
`ABE_REQ_STATUS` VARCHAR(10) default '',
`ABE_REQ_ANSWERED` TINYINT default 0 NOT NULL,
PRIMARY KEY (`ABE_REQ_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='The plugin table for actionsByEmail';
#-----------------------------------------------------------------------------
#-- ABE_RESPONSES
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `ABE_RESPONSES`;
CREATE TABLE `ABE_RESPONSES`
(
`ABE_RES_UID` VARCHAR(32) default '' NOT NULL,
`ABE_REQ_UID` VARCHAR(32) default '' NOT NULL,
`ABE_RES_CLIENT_IP` VARCHAR(20) default '' NOT NULL,
`ABE_RES_DATA` MEDIUMTEXT NOT NULL,
`ABE_RES_DATE` DATETIME NOT NULL,
`ABE_RES_STATUS` VARCHAR(10) default '' NOT NULL,
`ABE_RES_MESSAGE` VARCHAR(255) default '',
PRIMARY KEY (`ABE_RES_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='The plugin table for actionsByEmail';
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,121 @@
<?php
/*----------------------------------********---------------------------------*/
if (PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
// since all the request parameters using this script are encrypted
// using the URL_KEY the probability of injecting any kind of code using
// this entry point are only possible knowing the aforementioned key.
switch (G::decrypt(urldecode(utf8_encode($_REQUEST['ACTION'])), URL_KEY)) {
case 'processABE' :
$G_PUBLISH = new Publisher();
try {
// Validations
if (!isset($_REQUEST['APP_UID'])) {
$_REQUEST['APP_UID'] = '';
}
if (!isset($_REQUEST['DEL_INDEX'])) {
$_REQUEST['DEL_INDEX'] = '';
}
if ($_REQUEST['APP_UID'] == '') {
throw new Exception('The parameter APP_UID is empty.');
}
if ($_REQUEST['DEL_INDEX'] == '') {
throw new Exception('The parameter DEL_INDEX is empty.');
}
$_REQUEST['APP_UID'] = G::decrypt(urldecode(utf8_encode($_REQUEST['APP_UID'])), URL_KEY);
$_REQUEST['DEL_INDEX'] = G::decrypt(urldecode(utf8_encode($_REQUEST['DEL_INDEX'])), URL_KEY);
$_REQUEST['FIELD'] = G::decrypt(urldecode(utf8_encode($_REQUEST['FIELD'])), URL_KEY);
$_REQUEST['VALUE'] = G::decrypt(urldecode(utf8_encode($_REQUEST['VALUE'])), URL_KEY);
$_REQUEST['ABER'] = G::decrypt(urldecode(utf8_encode($_REQUEST['ABER'])), URL_KEY);
G::LoadClass('case');
$cases = new Cases();
$caseFieldsABE = $cases->loadCase($_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX']);
if (is_null($caseFieldsABE['DEL_FINISH_DATE'])) {
$dataField = array();
$dataField[$_REQUEST['FIELD']] = $_REQUEST['VALUE'];
$caseFieldsABE ['APP_DATA'] = array_merge($caseFieldsABE ['APP_DATA'], $dataField);
$dataResponses = array();
$dataResponses['ABE_REQ_UID'] = $_REQUEST['ABER'];
$dataResponses['ABE_RES_CLIENT_IP'] = $_SERVER['REMOTE_ADDR'];
$dataResponses['ABE_RES_DATA'] = serialize($_REQUEST['VALUE']);
$dataResponses['ABE_RES_STATUS'] = 'PENDING';
$dataResponses['ABE_RES_MESSAGE'] = '';
try {
require_once 'classes/model/AbeResponses.php';
$abeAbeResponsesInstance = new AbeResponses();
$dataResponses['ABE_RES_UID'] = $abeAbeResponsesInstance->createOrUpdate($dataResponses);
} catch (Exception $error) {
throw $error;
}
$cases->updateCase($_REQUEST['APP_UID'], $caseFieldsABE);
G::LoadClass('wsBase');
$ws = new wsBase();
$result = $ws->derivateCase($caseFieldsABE['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'], true);
$code = (is_array($result) ? $result['status_code'] : $result->status_code);
if ($code != 0) {
throw new Exception('An error occurred while the application was being processed.<br /><br />
Error code: ' . $result->status_code . '<br />
Error message: ' . $result->message . '<br /><br />');
}
// Update
$dataResponses['ABE_RES_STATUS'] = ($code == 0 ? 'SENT' : 'ERROR');
$dataResponses['ABE_RES_MESSAGE'] = ($code == 0 ? '-' : $result->message);
try {
$abeAbeResponsesInstance = new AbeResponses();
$abeAbeResponsesInstance->createOrUpdate($dataResponses);
} catch (Exception $error) {
throw $error;
}
$message = '<strong>The answer has been submited. Thank you</strong>';
//Save Cases Notes
G::LoadClass('actionsByEmailUtils');
$dataAbeRequests = loadAbeRequest($_REQUEST['ABER']);
$dataAbeConfiguration = loadAbeConfiguration($dataAbeRequests['ABE_UID']);
if ($dataAbeConfiguration['ABE_CASE_NOTE_IN_RESPONSE'] == 1) {
$response = new stdclass();
$response->usrUid = $caseFieldsABE['APP_DATA']['USER_LOGGED'];
$response->appUid = $_REQUEST['APP_UID'];
$response->noteText = "Check the information that was sent for the receiver: " . $dataAbeRequests['ABE_REQ_SENT_TO'];
postNote($response);
}
$dataAbeRequests['ABE_REQ_ANSWERED'] = 1;
$code == 0 ? uploadAbeRequest($dataAbeRequests) : '';
} else {
$message = '<strong>The response has already been sent.</strong>';
}
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', array('MESSAGE' => $message));
} catch (Exception $error) {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => $error->getMessage() . 'Please contact to your system administrator.'));
}
G::RenderPage('publish', 'blank');
break;
}
}
/*----------------------------------********---------------------------------*/

View File

@@ -0,0 +1,65 @@
<?php
namespace ProcessMaker\BusinessModel;
/**
* Description of ActionsByEmailService
*
*/
class ActionsByEmail
{
public function saveConfiguration($params)
{
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
$feature = $params['ActionsByEmail'];
switch ($feature['type']) {
case 'configuration':
require_once 'classes/model/AbeConfiguration.php';
$abeConfigurationInstance = new \AbeConfiguration();
$noteValues = json_decode($feature['fields']['ABE_CASE_NOTE_IN_RESPONSE']);
foreach ($noteValues as $value) {
$feature['fields']['ABE_CASE_NOTE_IN_RESPONSE'] = $value;
}
$abeConfigurationInstance->createOrUpdate($feature['fields']);
break;
default:
break;
}
}
}
public function loadConfiguration($params)
{
if ($params['type'] != 'activity'
|| !\PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0='))
{
return false;
}
require_once 'classes/model/AbeConfiguration.php';
$criteria = new \Criteria();
$criteria->add(\AbeConfigurationPeer::PRO_UID, $params['PRO_UID']);
$criteria->add(\AbeConfigurationPeer::TAS_UID, $params['TAS_UID']);
$result = \AbeConfigurationPeer::doSelectRS($criteria);
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$result->next();
$configuration = array();
if ($configuration = $result->getRow()) {
$configuration['ABE_EMAIL_FIELD_VALUE'] = $configuration['ABE_EMAIL_FIELD'];
$configuration['ABE_ACTION_FIELD_VALUE'] = $configuration['ABE_ACTION_FIELD'];
$configuration['ABE_CASE_NOTE_IN_RESPONSE'] = $configuration['ABE_CASE_NOTE_IN_RESPONSE'] ? '["1"]' : '[]';
}
$configuration['feature'] = 'ActionsByEmail';
$configuration['prefix'] = 'abe';
$configuration['PRO_UID'] = $params['PRO_UID'];
$configuration['TAS_UID'] = $params['TAS_UID'];
$configuration['SYS_LANG'] = SYS_LANG;
return $configuration;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -59,7 +59,44 @@ class Activity extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/*----------------------------------********---------------------------------*/
/**
* @param string $pro_uid {@min 32} {@max 32}
* @param string $tas_uid {@min 32} {@max 32}
* @param string $filter {@choice definition,,properties}
*
* @author Gustavo Cruz <gustavo.cruz@colosa.com>
* @copyright Colosa - Bolivia
* @return array
*
* @url GET /:pro_uid/activity/:tas_uid/feature-configuration
*/
public function doGetProjectActivityFeatureConfiguration($pro_uid, $tas_uid, $filter = '')
{
try {
$configurations = array();
/*** starts retrieval of action by emails configuration ***/
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
$params = array(
'type' => 'activity',
'form' => 'configuration',
'PRO_UID' => $pro_uid,
'TAS_UID' => $tas_uid
);
$actionsByEmailService = new \ProcessMaker\BusinessModel\ActionsByEmail();
$configurations[] = $actionsByEmailService->loadConfiguration($params);
}
/*** end retrieval of action by emails configuration ***/
return $configurations;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/*----------------------------------********---------------------------------*/
/**
* @param string $prj_uid {@min 32} {@max 32}
* @param string $act_uid {@min 32} {@max 32}
@@ -79,6 +116,15 @@ class Activity extends Api
}
$task = new \ProcessMaker\BusinessModel\Task();
$properties = $task->updateProperties($prj_uid, $act_uid, $request_data);
/*----------------------------------********---------------------------------*/
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
$actionsByEmailService = new \ProcessMaker\BusinessModel\ActionsByEmail();
$actionsByEmailService->saveConfiguration($request_data['properties']['_features']);
}
/*----------------------------------********---------------------------------*/
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}

View File

@@ -30,7 +30,7 @@ class DynaForm extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url POST /:prj_uid/dynaform
*

View File

@@ -51,5 +51,30 @@ class System extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}
/**
* @return array
*
* @author Gustavo Cruz <gustavo.cruz@colosa.com>
* @copyright Colosa - Bolivia
*
* @url GET /enabled-features
*/
public function doGetEnabledFeatures()
{
try {
$enabledFeatures = [];
$keys = array ('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=');
foreach ($keys as $key) {
if (\PMLicensedFeatures
::getSingleton()
->verifyfeature($key)) {
$enabledFeatures[] = $key;
}
}
return $enabledFeatures;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}

View File

@@ -0,0 +1,18 @@
<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%">
<tr>
<td style="font-size: 14px;"><b>ACTIONS BY EMAIL</b></td>
</tr>
<tr>
<td style="vertical-align:middle;">
<hr>
<br />
@#__ABE__
<br />
<br />
<hr><b>This Business Process is powered by ProcessMaker.<b>
<br />
<a href="http://www.processmaker.com" style="color:#c40000;">www.processmaker.com</a>
<br />
</td>
</tr>
</table>

Some files were not shown because too many files have changed in this diff Show More