BUG 5120 Change text to clarify the purpose of user for the Case Scheduler SOLVED

- Fix some issues in the logic of the validation
- Change some validations
This commit is contained in:
Julio Cesar Laura
2012-09-05 13:01:19 -04:00
parent eaa13e0514
commit 7d5144c3c6
5 changed files with 892 additions and 900 deletions

View File

@@ -83,7 +83,7 @@ class Cases
* @param string $sUIDUser
* @return boolean
*/
public function canStartCase($sUIDUser = '')
public function canStartCase($sUIDUser = '', $processUid = '')
{
$c = new Criteria();
$c->clearSelectColumns();
@@ -93,6 +93,9 @@ class Cases
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $sUIDUser);
if ($processUid != '') {
$c->add(TaskPeer::PRO_UID, $processUid);
}
$rs = TaskPeer::doSelectRS($c);
$rs->next();
@@ -115,6 +118,9 @@ class Cases
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
if ($processUid != '') {
$c->add(TaskPeer::PRO_UID, $processUid);
}
$rs = TaskPeer::doSelectRS($c);
$rs->next();

View File

@@ -103,6 +103,7 @@ class wsBase
$uid = $RBAC->VerifyLogin($userid , $password);
switch ($uid) {
case '':
case -1: //The user doesn't exist
$wsResponse = new wsResponse(3, G::loadTranslation('ID_USER_NOT_REGISTERED'));
break;
@@ -116,7 +117,7 @@ class wsBase
break;
}
if ($uid < 0 ) {
if ($uid < 0 || $uid == '') {
throw (new Exception(serialize($wsResponse)));
}