Merged in darojas/processmaker (pull request #149)

Se agregan validaciones en PROJECT USER. Se agrega el metodo PUT para PM USER
This commit is contained in:
erik ao
2014-02-05 17:41:27 -04:00
3 changed files with 244 additions and 133 deletions

View File

@@ -177,14 +177,18 @@ class ProjectUser
\G::LoadClass( 'case' );
$oCase = new \Cases();
$startTasks = $oCase->getStartCases($sUserUID);
foreach ($startTasks as $task) {
if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $sProcessUID)) {
$taskValue = explode( '(', $task['value'] );
$tasksLastIndex = count( $taskValue ) - 1;
$taskValue = explode( ')', $taskValue[$tasksLastIndex] );
$aUsers[] = array('act_uid' => $task['uid'],
'act_name' => $taskValue[0]);
if (sizeof($startTasks) > 1){
foreach ($startTasks as $task) {
if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $sProcessUID)) {
$taskValue = explode( '(', $task['value'] );
$tasksLastIndex = count( $taskValue ) - 1;
$taskValue = explode( ')', $taskValue[$tasksLastIndex] );
$aUsers[] = array('act_uid' => $task['uid'],
'act_name' => $taskValue[0]);
}
}
} else {
throw (new \Exception( 'This user `usr_uid`: '. $sUserUID .' has no initial activities assigned in this project.'));
}
return $aUsers;
} catch (Exception $e) {

File diff suppressed because it is too large Load Diff

View File

@@ -67,8 +67,11 @@ class User extends Api
*/
public function doPut($usr_uid, $request_data) {
try {
$userLoggedUid = $this->getUserId();
$user = new \BusinessModel\User();
$arrayData = $user->update($usr_uid, $request_data);
$arrayData = $user->update($usr_uid, $request_data, $userLoggedUid);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}