fix in execute triggers assigment

This commit is contained in:
Ronald Quenta
2015-08-03 20:54:10 -04:00
parent 266cc113fc
commit 934cee8e7c
2 changed files with 14 additions and 4 deletions

View File

@@ -334,9 +334,18 @@ class Light
*
* return array Return an array with Task Case
*/
public function GetPrepareInformation($usr_uid, $app_uid, $del_index = null)
public function GetPrepareInformation($usr_uid, $tas_uid, $app_uid, $del_index = null)
{
try {
$oCase = new \Cases();
$triggers = $oCase->loadTriggers( $tas_uid, 'ASSIGN_TASK', '-1', 'BEFORE');
if (isset($triggers)){
$appFields = $oCase->loadCase( $app_uid );
$Fields = $oCase->ExecuteTriggers( $tas_uid, 'ASSIGN_TASK', '-1', 'BEFORE', $appFields );
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], $Fields );
$oCase->updateCase( $app_uid, $appFields );
}
$oDerivation = new \Derivation();
$aData = array();
$aData['APP_UID'] = $app_uid;

View File

@@ -732,17 +732,18 @@ class Light extends Api
* Return Informaction User for derivate
* assignment Users
*
* @url GET /case/:app_uid/:del_index/assignment
* @url GET /task/:tas_uid/case/:app_uid/:del_index/assignment
*
* @param string $tas_uid {@min 32}{@max 32}
* @param string $app_uid {@min 32}{@max 32}
* @param string $del_index
*/
public function doGetPrepareInformation($app_uid, $del_index = null)
public function doGetPrepareInformation($tas_uid, $app_uid, $del_index = null)
{
try {
$usr_uid = $this->getUserId();
$oMobile = new \ProcessMaker\BusinessModel\Light();
$response = $oMobile->getPrepareInformation($usr_uid, $app_uid, $del_index);
$response = $oMobile->getPrepareInformation($usr_uid, $tas_uid, $app_uid, $del_index);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}