add endpoint
This commit is contained in:
@@ -723,6 +723,7 @@ class Light
|
|||||||
*/
|
*/
|
||||||
public function documentUploadFiles($userUid, $app_uid, $app_doc_uid, $request_data)
|
public function documentUploadFiles($userUid, $app_uid, $app_doc_uid, $request_data)
|
||||||
{
|
{
|
||||||
|
$response = array("status" => "fail");
|
||||||
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||||
$arrayField = array ();
|
$arrayField = array ();
|
||||||
$arrayFileName = array ();
|
$arrayFileName = array ();
|
||||||
@@ -773,6 +774,7 @@ class Light
|
|||||||
$sPathName = PATH_DOCUMENT . $pathUID . PATH_SEP;
|
$sPathName = PATH_DOCUMENT . $pathUID . PATH_SEP;
|
||||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
|
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
|
||||||
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
|
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
|
||||||
|
$response = array("status" => "ok");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -780,4 +782,31 @@ class Light
|
|||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* claim case
|
||||||
|
*
|
||||||
|
* @param $userUid
|
||||||
|
* @param $Fields
|
||||||
|
* @param $type
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function claimCaseUser($userUid, $sAppUid)
|
||||||
|
{
|
||||||
|
$response = array("status" => "fail");
|
||||||
|
$oCase = new \Cases();
|
||||||
|
$iDelIndex = $oCase->getCurrentDelegation( $sAppUid, $userUid );
|
||||||
|
|
||||||
|
$oAppDelegation = new \AppDelegation();
|
||||||
|
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||||
|
|
||||||
|
//if there are no user in the delegation row, this case is still in selfservice
|
||||||
|
if ($aDelegation['USR_UID'] == "") {
|
||||||
|
$oCase->setCatchUser( $sAppUid,$iDelIndex, $userUid );
|
||||||
|
$response = array("status" => "ok");
|
||||||
|
} else {
|
||||||
|
//G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -794,10 +794,28 @@ class Light extends Api
|
|||||||
try {
|
try {
|
||||||
$userUid = $this->getUserId();
|
$userUid = $this->getUserId();
|
||||||
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||||
$filesUids = $oMobile->documentUploadFiles($userUid, $app_uid, $app_doc_uid, $request_data);
|
$response = $oMobile->documentUploadFiles($userUid, $app_uid, $app_doc_uid, $request_data);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
}
|
}
|
||||||
return $filesUids;
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @url POST /case/:app_uid/claim
|
||||||
|
*
|
||||||
|
* @param $app_uid
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function claimCaseUser($app_uid)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$userUid = $this->getUserId();
|
||||||
|
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||||
|
$response = $oMobile->claimCaseUser($userUid, $app_uid);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user