PM-4134: Agregar validación cuando se cambian los markers y se tienen casos unassigned

.
This commit is contained in:
marcelo.cuiza
2015-11-20 18:59:10 -04:00
parent 9991f85ffc
commit 721fd6d84c
2 changed files with 38 additions and 0 deletions

View File

@@ -1927,5 +1927,23 @@ class Task
throw $e;
}
}
public function getValidateSelfService($data)
{
$data = array_change_key_case($data, CASE_LOWER);
$sTaskUID = $data['act_uid'];
$response = new stdclass();
$oCriteria = new Criteria();
$oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN");
$oCriteria->add(AppDelegationPeer::TAS_UID, $sTaskUID);
$oCriteria->add(AppDelegationPeer::USR_UID, "");
$oApplication = AppDelegationPeer::doSelectOne($oCriteria);
if(!empty($oApplication)) {
$response->result = false;
$response->message = G::LoadTranslation('ID_CURRENT_ASSING_TYPE_WITH_CASES');
}
$response->result = true;
return $response;
}
}

View File

@@ -202,6 +202,26 @@ class Activity extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url PUT /:prj_uid/activity/validate-active-cases
*
* @param string $prj_uid {@min 32}{@max 32}
*/
public function doGetActivityValidateSelfService($prj_uid, $request_data = array())
{
try {
$task = new \ProcessMaker\BusinessModel\Task();
$task->setFormatFieldNameInUppercase(false);
$task->setArrayParamException(array("taskUid" => "act_uid"));
$response = $task->getValidateSelfService($request_data);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}