committed by
Enrique Ponce De Leon
commit
05ef7afbed
@@ -79,7 +79,9 @@ class Light
|
|||||||
$newForm[$c]['title'] = $form['obj_title'];
|
$newForm[$c]['title'] = $form['obj_title'];
|
||||||
$newForm[$c]['description'] = $form['obj_description'];
|
$newForm[$c]['description'] = $form['obj_description'];
|
||||||
$newForm[$c]['stepId'] = $form["step_uid"];
|
$newForm[$c]['stepId'] = $form["step_uid"];
|
||||||
|
$newForm[$c]['stepUidObj'] = $form["step_uid_obj"];
|
||||||
$newForm[$c]['stepMode'] = $form['step_mode'];
|
$newForm[$c]['stepMode'] = $form['step_mode'];
|
||||||
|
$newForm[$c]['stepPosition'] = $form['step_position'];
|
||||||
$trigger = $this->statusTriggers($step->doGetActivityStepTriggers($form["step_uid"], $tempTreeChild['taskId'], $tempTreeChild['processId']));
|
$trigger = $this->statusTriggers($step->doGetActivityStepTriggers($form["step_uid"], $tempTreeChild['taskId'], $tempTreeChild['processId']));
|
||||||
$newForm[$c]["triggers"] = $trigger;
|
$newForm[$c]["triggers"] = $trigger;
|
||||||
$c++;
|
$c++;
|
||||||
@@ -336,6 +338,48 @@ class Light
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute Trigger case
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function doExecuteTriggerCase($usr_uid, $prj_uid, $act_uid, $cas_uid, $step_uid, $type)
|
||||||
|
{
|
||||||
|
$userData = $this->getUserData($usr_uid);
|
||||||
|
$c = new \Criteria();
|
||||||
|
$c->clearSelectColumns();
|
||||||
|
$c->addSelectColumn(\StepPeer::STEP_UID);
|
||||||
|
$c->addSelectColumn(\StepPeer::STEP_UID_OBJ);
|
||||||
|
$c->add(\StepPeer::TAS_UID, $act_uid);
|
||||||
|
$c->add(\StepPeer::STEP_TYPE_OBJ, 'DYNAFORM');
|
||||||
|
$c->add(\StepPeer::STEP_UID, $step_uid);
|
||||||
|
$rs = \StepPeer::doSelectRS($c);
|
||||||
|
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$rs->next();
|
||||||
|
$row = $rs->getRow();
|
||||||
|
$step_uid_obj = $row['STEP_UID_OBJ'];
|
||||||
|
|
||||||
|
$oCase = new \Cases();
|
||||||
|
$Fields = $oCase->loadCase( $cas_uid );
|
||||||
|
$_SESSION["APPLICATION"] = $cas_uid;
|
||||||
|
$_SESSION["PROCESS"] = $prj_uid;
|
||||||
|
$_SESSION["TASK"] = $act_uid;
|
||||||
|
$_SESSION["USER_LOGGED"] = $usr_uid;
|
||||||
|
$_SESSION["USR_USERNAME"] = $userData['firstName'];
|
||||||
|
$_SESSION["INDEX"] = $Fields["DEL_INDEX"] = \AppDelegation::getCurrentIndex($cas_uid);
|
||||||
|
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||||
|
$triggers = $oCase->loadTriggers( $act_uid, 'DYNAFORM', $step_uid_obj, strtoupper($type) );
|
||||||
|
if($triggers){
|
||||||
|
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $act_uid, 'DYNAFORM', $step_uid_obj, strtoupper($type), $Fields['APP_DATA'] );
|
||||||
|
}
|
||||||
|
$Fields['TAS_UID'] = $act_uid;
|
||||||
|
$Fields['CURRENT_DYNAFORM'] = $step_uid_obj;
|
||||||
|
$Fields['USER_UID'] = $usr_uid;
|
||||||
|
$Fields['PRO_UID'] = $prj_uid;
|
||||||
|
$oCase->updateCase( $cas_uid, $Fields );
|
||||||
|
$response = array('status' => 'ok');
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Informaction User for derivate
|
* Return Informaction User for derivate
|
||||||
* assignment Users
|
* assignment Users
|
||||||
|
|||||||
@@ -614,6 +614,7 @@ class Light extends Api
|
|||||||
$pmDynaForm->jsonr($result['formContent']);
|
$pmDynaForm->jsonr($result['formContent']);
|
||||||
$result['index'] = $i;
|
$result['index'] = $i;
|
||||||
$result['stepId'] = $activitySteps[$i]["step_uid"];
|
$result['stepId'] = $activitySteps[$i]["step_uid"];
|
||||||
|
$result['stepUidObj'] = $activitySteps[$i]["step_uid_obj"];
|
||||||
$result['stepMode'] = $activitySteps[$i]['step_mode'];
|
$result['stepMode'] = $activitySteps[$i]['step_mode'];
|
||||||
$result['stepPosition'] = $activitySteps[$i]['step_position'];
|
$result['stepPosition'] = $activitySteps[$i]['step_position'];
|
||||||
$trigger = $oMobile->statusTriggers($step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid));
|
$trigger = $oMobile->statusTriggers($step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid));
|
||||||
@@ -644,24 +645,8 @@ class Light extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$userUid = $this->getUserId();
|
$userUid = $this->getUserId();
|
||||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
|
||||||
$triggers= $step->doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid);
|
|
||||||
|
|
||||||
$step = new \ProcessMaker\BusinessModel\Step();
|
|
||||||
$step->setFormatFieldNameInUppercase(false);
|
|
||||||
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
|
|
||||||
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||||
$response = $oMobile->getUserData($userUid);
|
$response = $oMobile->doExecuteTriggerCase($userUid, $prj_uid, $act_uid, $cas_uid, $step_uid, $type);
|
||||||
$_SESSION["PROCESS"] = $prj_uid;
|
|
||||||
$_SESSION["TASK"] = $act_uid;
|
|
||||||
$_SESSION["USR_USERNAME"] = $response['firstName'];
|
|
||||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
|
||||||
foreach($triggers as $trigger){
|
|
||||||
if (strtolower($trigger['st_type']) == $type) {
|
|
||||||
$cases->putExecuteTriggerCase($cas_uid, $trigger['tri_uid'], $userUid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$response = array('status' => 'ok');
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user