Merged in paulis/processmaker/PM-2376 (pull request #2029)
PM-2376 PM-2403: New feature e implementacion de actionsByEmail in Bpmn
This commit is contained in:
@@ -64,6 +64,18 @@ class actionsByEmailClass extends PMPlugin
|
||||
$cases = new Cases();
|
||||
$caseFields = $cases->loadCase($data->APP_UID);
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TYPE);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_DYN_TYPE);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_EMAIL_FIELD);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_SUBJECT_FIELD);
|
||||
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
|
||||
$criteria->addJoin( AbeConfigurationPeer::DYN_UID, DynaformPeer::DYN_UID, Criteria::LEFT_JOIN );
|
||||
$criteria->add(AbeConfigurationPeer::PRO_UID, $caseFields['PRO_UID']);
|
||||
$criteria->add(AbeConfigurationPeer::TAS_UID, $data->TAS_UID);
|
||||
$result = AbeConfigurationPeer::doSelectRS($criteria);
|
||||
@@ -82,7 +94,10 @@ class actionsByEmailClass extends PMPlugin
|
||||
}
|
||||
|
||||
if ($email != '') {
|
||||
$subject = $caseFields['APP_TITLE'];
|
||||
$subject = G::replaceDataField( $configuration['ABE_SUBJECT_FIELD'], $caseFields['APP_DATA'] );
|
||||
if($subject == ''){
|
||||
$subject = $caseFields['APP_TITLE'];
|
||||
}
|
||||
|
||||
// Create
|
||||
require_once 'classes/model/AbeRequests.php';
|
||||
@@ -122,7 +137,7 @@ class actionsByEmailClass extends PMPlugin
|
||||
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>';
|
||||
$__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':
|
||||
@@ -133,19 +148,31 @@ class actionsByEmailClass extends PMPlugin
|
||||
$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;
|
||||
$dynaform = $configuration['DYN_UID'];
|
||||
$variables = G::json_decode($configuration['DYN_CONTENT'], true);
|
||||
if(isset($variables['items'][0]['items'])){
|
||||
$fields = $variables['items'][0]['items'];
|
||||
foreach ($fields as $key => $value) {
|
||||
foreach($value as $var){ G::pr($var);
|
||||
if(isset($var['variable'])){
|
||||
if ($var['variable'] == $actionField) {
|
||||
$field->label = $var['label'];
|
||||
$field->type = $var['type'];
|
||||
$values = $var['options'];
|
||||
foreach ($values as $val){
|
||||
$field->options[$val['value']] = $val['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G::LoadClass('pmDynaform');
|
||||
$obj = new pmDynaform($configuration['DYN_UID']);
|
||||
$configuration['CURRENT_DYNAFORM'] = $configuration['DYN_UID'];
|
||||
$file = $obj->printPmDynaformAbe($configuration);
|
||||
$__ABE__ .= $file;
|
||||
$__ABE__ .= '<strong>' . $field->label . '</strong><br /><table align="left" border="0"><tr>';
|
||||
|
||||
switch ($field->type) {
|
||||
case 'dropdown':
|
||||
case 'radiogroup':
|
||||
|
||||
@@ -456,6 +456,39 @@ class pmDynaform
|
||||
exit();
|
||||
}
|
||||
|
||||
public function printABE($filename, $record)
|
||||
{
|
||||
ob_clean();
|
||||
$this->record = $record;
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
"var pm_run_outside_main_app = null;\n" .
|
||||
"var dyn_uid = '" . $this->fields["CURRENT_DYNAFORM"] . "';\n" .
|
||||
"var __DynaformName__ = null;\n" .
|
||||
"var app_uid = null;\n" .
|
||||
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
|
||||
"var step_mode = null;\n" .
|
||||
"var workspace = '" . SYS_SYS . "';\n" .
|
||||
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
|
||||
"var filePost = '" . $filename . "';\n" .
|
||||
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
|
||||
"var triggerDebug = null;\n" .
|
||||
"</script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
|
||||
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
|
||||
" <a id='dyn_forward' href='' style='float:right;font-size:12px;line-height:1;margin:0px 5px 1px 0px;'>\n" .
|
||||
" </a>\n" .
|
||||
"</div>";
|
||||
|
||||
$file = file_get_contents(PATH_HOME . 'public_html/lib/pmdynaform/build/pmdynaform.html');
|
||||
$file = str_replace("{javascript}", $javascrip, $file);
|
||||
echo $file;
|
||||
exit();
|
||||
}
|
||||
|
||||
public function printPmDynaform()
|
||||
{
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
@@ -472,6 +505,34 @@ class pmDynaform
|
||||
exit();
|
||||
}
|
||||
|
||||
public function printPmDynaformAbe($record)
|
||||
{
|
||||
ob_clean();
|
||||
$this->record = $record;
|
||||
$json = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
$javascrip = "" .
|
||||
"<script type='text/javascript'>\n" .
|
||||
"var jsondata = " . G::json_encode($json) . ";\n" .
|
||||
"var pm_run_outside_main_app = null;\n" .
|
||||
"var dyn_uid = '" . $this->fields["CURRENT_DYNAFORM"] . "';\n" .
|
||||
"var __DynaformName__ = null;\n" .
|
||||
"var app_uid = null;\n" .
|
||||
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
|
||||
"var step_mode = null;\n" .
|
||||
"var workspace = '" . SYS_SYS . "';\n" .
|
||||
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
|
||||
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
|
||||
"var triggerDebug = null;\n" .
|
||||
"</script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
|
||||
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
|
||||
"</div>";
|
||||
$file = file_get_contents(PATH_HOME . 'public_html/lib/pmdynaform/build/pmdynaform.html');
|
||||
$file = str_replace("{javascript}", $javascrip, $file);
|
||||
return $file;
|
||||
}
|
||||
|
||||
public function synchronizeVariable($processUid, $newVariable, $oldVariable)
|
||||
{
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
@@ -18,7 +18,7 @@ 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');
|
||||
'ABE_ACTION_FIELD', 'ABE_CASE_NOTE_IN_RESPONSE', 'ABE_CREATE_DATE','ABE_UPDATE_DATE', 'ABE_SUBJECT_FIELD');
|
||||
|
||||
public function load($abeUid)
|
||||
{
|
||||
|
||||
@@ -89,6 +89,7 @@ class AbeConfigurationMapBuilder
|
||||
|
||||
$tMap->addColumn('ABE_UPDATE_DATE', 'AbeUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('ABE_SUBJECT_FIELD', 'AbeSubjectField', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
} // doBuild()
|
||||
|
||||
} // AbeConfigurationMapBuilder
|
||||
|
||||
@@ -99,6 +99,12 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $abe_update_date;
|
||||
|
||||
/**
|
||||
* The value for the abe_subject_field field.
|
||||
* @var string
|
||||
*/
|
||||
protected $abe_subject_field;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -287,6 +293,17 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [abe_subject_field] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAbeSubjectField()
|
||||
{
|
||||
|
||||
return $this->abe_subject_field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [abe_uid] column.
|
||||
*
|
||||
@@ -565,6 +582,28 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
|
||||
} // setAbeUpdateDate()
|
||||
|
||||
/**
|
||||
* Set the value of [abe_subject_field] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAbeSubjectField($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->abe_subject_field !== $v || $v === '') {
|
||||
$this->abe_subject_field = $v;
|
||||
$this->modifiedColumns[] = AbeConfigurationPeer::ABE_SUBJECT_FIELD;
|
||||
}
|
||||
|
||||
} // setAbeSubjectField()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -606,12 +645,14 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
|
||||
$this->abe_update_date = $rs->getTimestamp($startcol + 11, null);
|
||||
|
||||
$this->abe_subject_field = $rs->getString($startcol + 12, null);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 12; // 12 = AbeConfigurationPeer::NUM_COLUMNS - AbeConfigurationPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 13; // 13 = AbeConfigurationPeer::NUM_COLUMNS - AbeConfigurationPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating AbeConfiguration object", $e);
|
||||
@@ -851,6 +892,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
case 11:
|
||||
return $this->getAbeUpdateDate();
|
||||
break;
|
||||
case 12:
|
||||
return $this->getAbeSubjectField();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -883,6 +927,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
$keys[9] => $this->getAbeCaseNoteInResponse(),
|
||||
$keys[10] => $this->getAbeCreateDate(),
|
||||
$keys[11] => $this->getAbeUpdateDate(),
|
||||
$keys[12] => $this->getAbeSubjectField(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -950,6 +995,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
case 11:
|
||||
$this->setAbeUpdateDate($value);
|
||||
break;
|
||||
case 12:
|
||||
$this->setAbeSubjectField($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1021,6 +1069,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
$this->setAbeUpdateDate($arr[$keys[11]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[12], $arr)) {
|
||||
$this->setAbeSubjectField($arr[$keys[12]]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1080,6 +1131,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
$criteria->add(AbeConfigurationPeer::ABE_UPDATE_DATE, $this->abe_update_date);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AbeConfigurationPeer::ABE_SUBJECT_FIELD)) {
|
||||
$criteria->add(AbeConfigurationPeer::ABE_SUBJECT_FIELD, $this->abe_subject_field);
|
||||
}
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1156,6 +1210,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAbeUpdateDate($this->abe_update_date);
|
||||
|
||||
$copyObj->setAbeSubjectField($this->abe_subject_field);
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ abstract class BaseAbeConfigurationPeer
|
||||
/** the column name for the ABE_UPDATE_DATE field */
|
||||
const ABE_UPDATE_DATE = 'ABE_CONFIGURATION.ABE_UPDATE_DATE';
|
||||
|
||||
/** the column name for the ABE_SUBJECT_FIELD field */
|
||||
const ABE_SUBJECT_FIELD = 'ABE_CONFIGURATION.ABE_SUBJECT_FIELD';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -78,10 +81,10 @@ abstract class BaseAbeConfigurationPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AbeUid', 'ProUid', 'TasUid', 'AbeType', 'AbeTemplate', 'AbeDynType', 'DynUid', 'AbeEmailField', 'AbeActionField', 'AbeCaseNoteInResponse', 'AbeCreateDate', 'AbeUpdateDate', ),
|
||||
BasePeer::TYPE_COLNAME => array (AbeConfigurationPeer::ABE_UID, AbeConfigurationPeer::PRO_UID, AbeConfigurationPeer::TAS_UID, AbeConfigurationPeer::ABE_TYPE, AbeConfigurationPeer::ABE_TEMPLATE, AbeConfigurationPeer::ABE_DYN_TYPE, AbeConfigurationPeer::DYN_UID, AbeConfigurationPeer::ABE_EMAIL_FIELD, AbeConfigurationPeer::ABE_ACTION_FIELD, AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE, AbeConfigurationPeer::ABE_CREATE_DATE, AbeConfigurationPeer::ABE_UPDATE_DATE, ),
|
||||
BasePeer::TYPE_FIELDNAME => 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', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AbeUid', 'ProUid', 'TasUid', 'AbeType', 'AbeTemplate', 'AbeDynType', 'DynUid', 'AbeEmailField', 'AbeActionField', 'AbeCaseNoteInResponse', 'AbeCreateDate', 'AbeUpdateDate', 'AbeSubjectField', ),
|
||||
BasePeer::TYPE_COLNAME => array (AbeConfigurationPeer::ABE_UID, AbeConfigurationPeer::PRO_UID, AbeConfigurationPeer::TAS_UID, AbeConfigurationPeer::ABE_TYPE, AbeConfigurationPeer::ABE_TEMPLATE, AbeConfigurationPeer::ABE_DYN_TYPE, AbeConfigurationPeer::DYN_UID, AbeConfigurationPeer::ABE_EMAIL_FIELD, AbeConfigurationPeer::ABE_ACTION_FIELD, AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE, AbeConfigurationPeer::ABE_CREATE_DATE, AbeConfigurationPeer::ABE_UPDATE_DATE, AbeConfigurationPeer::ABE_SUBJECT_FIELD, ),
|
||||
BasePeer::TYPE_FIELDNAME => 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', 'ABE_SUBJECT_FIELD', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -91,10 +94,10 @@ abstract class BaseAbeConfigurationPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AbeUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'AbeType' => 3, 'AbeTemplate' => 4, 'AbeDynType' => 5, 'DynUid' => 6, 'AbeEmailField' => 7, 'AbeActionField' => 8, 'AbeCaseNoteInResponse' => 9, 'AbeCreateDate' => 10, 'AbeUpdateDate' => 11, ),
|
||||
BasePeer::TYPE_COLNAME => array (AbeConfigurationPeer::ABE_UID => 0, AbeConfigurationPeer::PRO_UID => 1, AbeConfigurationPeer::TAS_UID => 2, AbeConfigurationPeer::ABE_TYPE => 3, AbeConfigurationPeer::ABE_TEMPLATE => 4, AbeConfigurationPeer::ABE_DYN_TYPE => 5, AbeConfigurationPeer::DYN_UID => 6, AbeConfigurationPeer::ABE_EMAIL_FIELD => 7, AbeConfigurationPeer::ABE_ACTION_FIELD => 8, AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE => 9, AbeConfigurationPeer::ABE_CREATE_DATE => 10, AbeConfigurationPeer::ABE_UPDATE_DATE => 11, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ABE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'ABE_TYPE' => 3, 'ABE_TEMPLATE' => 4, 'ABE_DYN_TYPE' => 5, 'DYN_UID' => 6, 'ABE_EMAIL_FIELD' => 7, 'ABE_ACTION_FIELD' => 8, 'ABE_CASE_NOTE_IN_RESPONSE' => 9, 'ABE_CREATE_DATE' => 10, 'ABE_UPDATE_DATE' => 11, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AbeUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'AbeType' => 3, 'AbeTemplate' => 4, 'AbeDynType' => 5, 'DynUid' => 6, 'AbeEmailField' => 7, 'AbeActionField' => 8, 'AbeCaseNoteInResponse' => 9, 'AbeCreateDate' => 10, 'AbeUpdateDate' => 11, 'AbeSubjectField' => 12, ),
|
||||
BasePeer::TYPE_COLNAME => array (AbeConfigurationPeer::ABE_UID => 0, AbeConfigurationPeer::PRO_UID => 1, AbeConfigurationPeer::TAS_UID => 2, AbeConfigurationPeer::ABE_TYPE => 3, AbeConfigurationPeer::ABE_TEMPLATE => 4, AbeConfigurationPeer::ABE_DYN_TYPE => 5, AbeConfigurationPeer::DYN_UID => 6, AbeConfigurationPeer::ABE_EMAIL_FIELD => 7, AbeConfigurationPeer::ABE_ACTION_FIELD => 8, AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE => 9, AbeConfigurationPeer::ABE_CREATE_DATE => 10, AbeConfigurationPeer::ABE_UPDATE_DATE => 11, AbeConfigurationPeer::ABE_SUBJECT_FIELD => 12, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ABE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'ABE_TYPE' => 3, 'ABE_TEMPLATE' => 4, 'ABE_DYN_TYPE' => 5, 'DYN_UID' => 6, 'ABE_EMAIL_FIELD' => 7, 'ABE_ACTION_FIELD' => 8, 'ABE_CASE_NOTE_IN_RESPONSE' => 9, 'ABE_CREATE_DATE' => 10, 'ABE_UPDATE_DATE' => 11, 'ABE_SUBJECT_FIELD' => 12, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -219,6 +222,8 @@ abstract class BaseAbeConfigurationPeer
|
||||
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UPDATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_SUBJECT_FIELD);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(ABE_CONFIGURATION.ABE_UID)';
|
||||
|
||||
@@ -4629,6 +4629,16 @@
|
||||
<parameter name="Extra" value=""/>
|
||||
</vendor>
|
||||
</column>
|
||||
<column name="ABE_SUBJECT_FIELD" type="VARCHAR" size="100" required="false" default="">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Field" value="ABE_SUBJECT_FIELD"/>
|
||||
<parameter name="Type" value="varchar(100)"/>
|
||||
<parameter name="Null" value="NO"/>
|
||||
<parameter name="Key" value=""/>
|
||||
<parameter name="Default" value=""/>
|
||||
<parameter name="Extra" value=""/>
|
||||
</vendor>
|
||||
</column>
|
||||
</table>
|
||||
|
||||
<table name="ABE_REQUESTS">
|
||||
|
||||
@@ -2644,6 +2644,7 @@ CREATE TABLE `ABE_CONFIGURATION`
|
||||
`ABE_CASE_NOTE_IN_RESPONSE` INTEGER default 0,
|
||||
`ABE_CREATE_DATE` DATETIME NOT NULL,
|
||||
`ABE_UPDATE_DATE` DATETIME,
|
||||
`ABE_SUBJECT_FIELD` VARCHAR(100) default '' NOT NULL,
|
||||
PRIMARY KEY (`ABE_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='The plugin table for actionsByEmail';
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
61
workflow/engine/methods/services/ActionsByEmailDataForm.php
Executable file
61
workflow/engine/methods/services/ActionsByEmailDataForm.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
if (PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||
global $G_PUBLISH;
|
||||
$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.');
|
||||
}
|
||||
|
||||
G::LoadClass('case');
|
||||
G::LoadClass('pmDynaform');
|
||||
|
||||
$cases = new Cases();
|
||||
$caseFields = $cases->loadCase(G::decrypt($_REQUEST['APP_UID'], URL_KEY),G::decrypt($_REQUEST['DEL_INDEX'], URL_KEY));
|
||||
|
||||
//
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
|
||||
$criteria->addSelectColumn(DynaformPeer::PRO_UID);
|
||||
$criteria->add(DynaformPeer::DYN_UID, G::decrypt($_REQUEST['DYN_UID'], URL_KEY));
|
||||
$result = DynaformPeer::doSelectRS($criteria);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result->next();
|
||||
$configuration = $result->getRow();
|
||||
$a = new pmDynaform(G::decrypt($_REQUEST['DYN_UID'], URL_KEY));
|
||||
$action = 'ActionsByEmailDataFormPost.php?APP_UID=' . $_REQUEST['APP_UID'] . '&DEL_INDEX=' . $_REQUEST['DEL_INDEX'] . '&ABER=' . $_REQUEST['ABER'];
|
||||
$record['DYN_CONTENT'] = $configuration['DYN_CONTENT'];
|
||||
$record['PRO_UID'] = $configuration['PRO_UID'];
|
||||
$record['CURRENT_DYNAFORM'] = G::decrypt($_REQUEST['DYN_UID'], URL_KEY);
|
||||
$record['APP_UID'] = $_REQUEST['APP_UID'];
|
||||
$record['DEL_INDEX'] = $_REQUEST['DEL_INDEX'];
|
||||
$record['ABER'] = $_REQUEST['ABER'];
|
||||
if (is_null($caseFields['DEL_FINISH_DATE'])) {
|
||||
$a->printABE($action,$record);
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', array('MESSAGE' => '<strong>The form has already been filled and sent.</strong>'));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', array('MESSAGE' => $error->getMessage()));
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
|
||||
209
workflow/engine/methods/services/ActionsByEmailDataFormPost.php
Executable file
209
workflow/engine/methods/services/ActionsByEmailDataFormPost.php
Executable file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
if (PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
try {
|
||||
if ($_REQUEST['APP_UID'] == '') {
|
||||
if($_GET['APP_UID'] == ''){
|
||||
throw new Exception('The parameter APP_UID is empty.');
|
||||
} else {
|
||||
$_REQUEST['APP_UID'] = $_GET['APP_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST['DEL_INDEX'] == '') {
|
||||
throw new Exception('The parameter DEL_INDEX is empty.');
|
||||
}
|
||||
|
||||
if ($_REQUEST['ABER'] == '') {
|
||||
throw new Exception('The parameter ABER is empty.');
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['form'])) {
|
||||
$_REQUEST['form'] = array();
|
||||
}
|
||||
|
||||
$_REQUEST['APP_UID'] = G::decrypt($_REQUEST['APP_UID'], URL_KEY);
|
||||
$_REQUEST['DEL_INDEX'] = G::decrypt($_REQUEST['DEL_INDEX'], URL_KEY);
|
||||
$_REQUEST['ABER'] = G::decrypt($_REQUEST['ABER'], URL_KEY);
|
||||
G::LoadClass('case');
|
||||
|
||||
$case = new Cases();
|
||||
$casesFields = $case->loadCase($_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX']);
|
||||
|
||||
$casesFields['APP_DATA'] = array_merge($casesFields['APP_DATA'], $_REQUEST['form']);
|
||||
|
||||
//Get user info
|
||||
$current_user_uid = null;
|
||||
$currentUsrName = null;
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $_REQUEST["APP_UID"]);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $_REQUEST["DEL_INDEX"]);
|
||||
|
||||
$rsSQL = AppDelegationPeer::doSelectRS($criteria);
|
||||
$rsSQL->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsSQL->next()) {
|
||||
$row = $rsSQL->getRow();
|
||||
|
||||
$current_user_uid = $row["USR_UID"];
|
||||
}
|
||||
|
||||
if ($current_user_uid != null) {
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->add(UsersPeer::USR_UID, $current_user_uid);
|
||||
|
||||
$rsSQL = UsersPeer::doSelectRS($criteria);
|
||||
$rsSQL->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsSQL->next();
|
||||
|
||||
$row = $rsSQL->getRow();
|
||||
$currentUsrName = $row["USR_USERNAME"];
|
||||
|
||||
$casesFields["APP_DATA"]["USER_LOGGED"] = $current_user_uid;
|
||||
$casesFields["APP_DATA"]["USR_USERNAME"] = $currentUsrName;
|
||||
}
|
||||
|
||||
foreach ($casesFields["APP_DATA"] as $index => $value) {
|
||||
$_SESSION[$index] = $value;
|
||||
}
|
||||
|
||||
//Update case info
|
||||
$case->updateCase($_REQUEST['APP_UID'], $casesFields);
|
||||
|
||||
G::LoadClass('wsBase');
|
||||
|
||||
$wsBaseInstance = new wsBase();
|
||||
$result = $wsBaseInstance->derivateCase($casesFields['CURRENT_USER_UID'], $_REQUEST['APP_UID'], $_REQUEST ['DEL_INDEX'], true);
|
||||
$code = (is_array($result) ? $result['status_code'] : $result->status_code);
|
||||
|
||||
$dataResponses = array();
|
||||
$dataResponses['ABE_REQ_UID'] = $_REQUEST['ABER'];
|
||||
$dataResponses['ABE_RES_CLIENT_IP'] = $_SERVER['REMOTE_ADDR'];
|
||||
$dataResponses['ABE_RES_DATA'] = serialize($_REQUEST['form']);
|
||||
$dataResponses['ABE_RES_STATUS'] = 'PENDING';
|
||||
$dataResponses['ABE_RES_MESSAGE'] = '';
|
||||
|
||||
try {
|
||||
set_include_path(PATH_PLUGINS . 'actionsByEmail' . PATH_SEPARATOR . get_include_path());
|
||||
require_once 'classes/model/AbeResponses.php';
|
||||
|
||||
$abeAbeResponsesInstance = new AbeResponses();
|
||||
$dataResponses['ABE_RES_UID'] = $abeAbeResponsesInstance->createOrUpdate($dataResponses);
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
|
||||
if ($code == 0) {
|
||||
//Save Cases Notes
|
||||
include_once 'utils.php';
|
||||
|
||||
$dataAbeRequests = loadAbeRequest($_REQUEST['ABER']);
|
||||
$dataAbeConfiguration = loadAbeConfiguration($dataAbeRequests['ABE_UID']);
|
||||
|
||||
if ($dataAbeConfiguration['ABE_CASE_NOTE_IN_RESPONSE'] == 1) {
|
||||
$response = new stdclass();
|
||||
$response->usrUid = $casesFields['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) : '';
|
||||
|
||||
if (isset ( $_FILES ['form'] )) {
|
||||
foreach ($_FILES ['form'] ['name'] as $fieldName => $value) {
|
||||
if ($_FILES ['form'] ['error'] [$fieldName] == 0) {
|
||||
$appDocument = new AppDocument ( );
|
||||
|
||||
if ( isset ( $_REQUEST['INPUTS'] [$fieldName] ) && $_REQUEST['INPUTS'] [$fieldName] != '' ) {
|
||||
require_once 'classes/model/AppFolder.php';
|
||||
require_once 'classes/model/InputDocument.php';
|
||||
|
||||
$inputDocument = new InputDocument();
|
||||
$id = $inputDocument->load($_REQUEST['INPUTS'] [$fieldName]);
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder=new AppFolder();
|
||||
$folderId=$oFolder->createFromPath($id['INP_DOC_DESTINATION_PATH']);
|
||||
|
||||
//Tags
|
||||
$fileTags=$oFolder->parseTags($id['INP_DOC_TAGS']);
|
||||
|
||||
$fields = array (
|
||||
'APP_UID' => $_REQUEST['APP_UID'],
|
||||
'DEL_INDEX' => $_REQUEST ['DEL_INDEX'],
|
||||
'USR_UID' => $casesFields['APP_DATA']['USER_LOGGED'],
|
||||
'DOC_UID' => $_REQUEST['INPUTS'] [$fieldName],
|
||||
'APP_DOC_TYPE' => 'INPUT',
|
||||
'APP_DOC_CREATE_DATE' => date ( 'Y-m-d H:i:s' ),
|
||||
'APP_DOC_COMMENT' => '',
|
||||
'APP_DOC_TITLE' => '',
|
||||
'APP_DOC_FILENAME' => $_FILES ['form'] ['name'] [$fieldName],
|
||||
'FOLDER_UID' => $folderId,
|
||||
'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
} else {
|
||||
$fields = array (
|
||||
'APP_UID' => $_REQUEST['APP_UID'],
|
||||
'DEL_INDEX' => $_REQUEST ['DEL_INDEX'],
|
||||
'USR_UID' => $casesFields['APP_DATA']['USER_LOGGED'],
|
||||
'DOC_UID' => - 1,
|
||||
'APP_DOC_TYPE' => 'ATTACHED',
|
||||
'APP_DOC_CREATE_DATE' => date ( 'Y-m-d H:i:s' ),
|
||||
'APP_DOC_COMMENT' => '',
|
||||
'APP_DOC_TITLE' => '',
|
||||
'APP_DOC_FILENAME' => $_FILES ['form'] ['name'] [$fieldName]
|
||||
);
|
||||
}
|
||||
|
||||
$appDocument->create($fields);
|
||||
$docVersion = $appDocument->getDocVersion();
|
||||
$appDocUid = $appDocument->getAppDocUid ();
|
||||
$info = pathinfo ( $appDocument->getAppDocFilename () );
|
||||
$extension = (isset ( $info ['extension'] ) ? $info ['extension'] : '');
|
||||
$pathName = PATH_DOCUMENT . $_REQUEST['APP_UID'] . PATH_SEP;
|
||||
$fileName = $appDocUid . '_'.$docVersion.'.' . $extension;
|
||||
|
||||
G::uploadFile ( $_FILES ['form'] ['tmp_name'] [$fieldName], $pathName, $fileName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$assign = $result['message'];
|
||||
$aMessage['MESSAGE'] = '<strong>The information was submitted. Thank you.</strong>';
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showInfo', '', $aMessage);
|
||||
} catch (Exception $error) {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => $error->getMessage().'Please contact to your system administrator.'));
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
|
||||
84
workflow/engine/methods/services/utils.php
Executable file
84
workflow/engine/methods/services/utils.php
Executable 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@ class ActionsByEmail
|
||||
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;
|
||||
if(isset($feature['fields']['ABE_CASE_NOTE_IN_RESPONSE'])){
|
||||
$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;
|
||||
@@ -50,8 +52,13 @@ class ActionsByEmail
|
||||
$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_UID'] = $configuration['ABE_UID'];
|
||||
$configuration['ABE_TYPE'] = $configuration['ABE_TYPE'];
|
||||
$configuration['DYN_UID'] = $configuration['DYN_UID'];
|
||||
$configuration['ABE_TEMPLATE'] = $configuration['ABE_TEMPLATE'];
|
||||
$configuration['ABE_SUBJECT_FIELD'] = $configuration['ABE_SUBJECT_FIELD'];
|
||||
$configuration['ABE_EMAIL_FIELD'] = $configuration['ABE_EMAIL_FIELD'];
|
||||
$configuration['ABE_ACTION_FIELD'] = $configuration['ABE_ACTION_FIELD'];
|
||||
$configuration['ABE_CASE_NOTE_IN_RESPONSE'] = $configuration['ABE_CASE_NOTE_IN_RESPONSE'] ? '["1"]' : '[]';
|
||||
}
|
||||
$configuration['feature'] = 'ActionsByEmail';
|
||||
|
||||
@@ -3,6 +3,12 @@ namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
use \G;
|
||||
use \Smarty;
|
||||
use \Criteria;
|
||||
use \ResultSet;
|
||||
use \DynaformPeer;
|
||||
use \ContentPeer;
|
||||
|
||||
require_once 'classes/model/AbeConfiguration.php';
|
||||
require_once 'classes/model/AbeRequests.php';
|
||||
@@ -545,4 +551,27 @@ class ActionsByEmail extends Api
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @url GET /Dynaforms/:proUid
|
||||
*/
|
||||
public function getDynaforms($proUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(DynaformPeer::DYN_UID);
|
||||
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
$criteria->addJoin( DynaformPeer::DYN_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
|
||||
$criteria->add( DynaformPeer::PRO_UID, $proUid, Criteria::EQUAL );
|
||||
$criteria->add( DynaformPeer::DYN_TYPE, 'xmlform', Criteria::EQUAL );
|
||||
$criteria->add( ContentPeer::CON_CATEGORY, 'DYN_TITLE');
|
||||
$criteria->add( ContentPeer::CON_LANG, SYS_LANG);
|
||||
$dataset = DynaformPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dynaform = array();
|
||||
while ($dataset->next()) {
|
||||
$aRow = $dataset->getRow();
|
||||
$dynaform[] = array('DYN_UID' => $aRow['DYN_UID'], 'DYN_NAME' => $aRow['CON_VALUE']);
|
||||
}
|
||||
return $dynaform;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,12 +118,11 @@ class Activity extends Api
|
||||
}
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
$properties = $task->updateProperties($prj_uid, $act_uid, $request_data);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (\PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||
if (isset($request_data['properties']['_features']) && !empty($request_data['properties']['_features']['ActionsByEmail']['fields']['ABE_UID'])) {
|
||||
if (isset($request_data['properties']['_features'])) {
|
||||
$actionsByEmailService = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
||||
$actionsByEmailService->saveConfiguration($request_data['properties']['_features']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user