This commit is contained in:
Paula V. Quispe
2016-08-11 10:42:29 -04:00
parent e34eab9fcb
commit 28015a9df7
2 changed files with 17 additions and 0 deletions

View File

@@ -3133,6 +3133,13 @@ class wsBase
$g->sessionVarRestore();
return $result;
}
$oAppThread = new AppThread();
$cant = $oAppThread->countStatus($caseUid, 'OPEN');
if($cant > 1){
$result = new wsResponse( 100, G::LoadTranslation( "ID_CASE_CANCELLED_PARALLEL" ) );
$g->sessionVarRestore();
return $result;
}
$case = new Cases();
$case->cancelCase( $caseUid, $delIndex, $userUid );

View File

@@ -114,5 +114,15 @@ class AppThread extends BaseAppThread
throw($oError);
}
}
public function countStatus($appUid, $status='OPEN'){
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
$c->add(AppThreadPeer::APP_UID, $appUid );
$c->add(AppThreadPeer::APP_THREAD_STATUS , $status );
$cant = AppThreadPeer::doCount($c);
return $cant;
}
}