Merged in paulis/processmaker/PM-4474 (pull request #3415)

PM-4474
This commit is contained in:
Julio Cesar Laura Avendaño
2015-12-21 16:16:18 -04:00
2 changed files with 9 additions and 1 deletions

View File

@@ -4176,7 +4176,6 @@ class Cases
public function pauseCase($sApplicationUID, $iDelegation, $sUserUID, $sUnpauseDate = null)
{
$this->CloseCurrentDelegation($sApplicationUID, $iDelegation);
$oApplication = new Application();
$aFields = $oApplication->Load($sApplicationUID);
//get the appthread row id ( APP_THREAD_INDEX' )
@@ -4194,6 +4193,7 @@ class Cases
throw new Exception(G::LoadTranslation("ID_CASE_STOPPED_TRIGGER"));
}
$this->CloseCurrentDelegation($sApplicationUID, $iDelegation);
//now create a row in APP_DELAY with type PAUSE
$aData['PRO_UID'] = $aFields['PRO_UID'];
$aData['APP_UID'] = $sApplicationUID;

View File

@@ -3140,6 +3140,14 @@ class wsBase
return $result;
}
$oApplication = new Application();
$aFields = $oApplication->load($caseUid);
if($aFields['APP_STATUS'] == 'DRAFT'){
$result = new wsResponse( 100, G::LoadTranslation( "ID_CASE_IN_STATUS" ). " DRAFT" );
$g->sessionVarRestore();
return $result;
}
$case = new Cases();
$case->cancelCase( $caseUid, $delIndex, $userUid );