Merged in gproly/processmaker/HOR-1466 (pull request #4725)

HOR-1466
This commit is contained in:
Julio Cesar Laura Avendaño
2016-08-12 19:00:22 -04:00
3 changed files with 35 additions and 0 deletions

View File

@@ -2962,5 +2962,25 @@ class Cases
return G::json_encode($dataResponse);
}
/**
* if case already routed
*
* @param type $app_uid
* @param type $del_index
* @param type $usr_uid
* @throws type
*/
public function caseAlreadyRouted($app_uid, $del_index, $usr_uid = '')
{
$c = new \Criteria('workflow');
$c->add(\AppDelegationPeer::APP_UID, $app_uid);
$c->add(\AppDelegationPeer::DEL_INDEX, $del_index);
if (!empty($usr_uid)) {
$c->add(\AppDelegationPeer::USR_UID, $usr_uid);
}
$c->add(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL);
return !(boolean) \AppDelegationPeer::doCount($c);
}
}