This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-02-13 15:53:21 -04:00
parent 469bb0dfff
commit da2ea4c865
8 changed files with 182 additions and 49 deletions

View File

@@ -48,6 +48,17 @@ class AbeConfiguration extends BaseAbeConfiguration
}
}
/**
* Create or update.
*
* @param array $data
* @throws Exception
*
* @see Processes->createActionsByEmail()
* @see ProcessMaker\BusinessModel\ActionsByEmail->saveConfiguration()
* @see ProcessMaker\BusinessModel\ActionsByEmail->saveConfiguration2()
* @link https://wiki.processmaker.com/3.3/Actions_by_Email#Configuration
*/
public function createOrUpdate($data)
{
foreach ($data as $field => $value) {
@@ -70,6 +81,11 @@ class AbeConfiguration extends BaseAbeConfiguration
} else {
$abeConfigurationInstance = AbeConfigurationPeer::retrieveByPK($data['ABE_UID']);
}
//Only the 'FIELD' and 'LINK' types have a DYN_UID,
//the DYN_UID field is empty when the type is 'CUSTOM'.
if ($data['ABE_TYPE'] === 'CUSTOM') {
$data['DYN_UID'] = '';
}
if (isset($data['ABE_CUSTOM_GRID'])) {
$data['ABE_CUSTOM_GRID'] = serialize($data['ABE_CUSTOM_GRID']);