Merged in bugfix/HOR-4589 (pull request #6483)
HOR-4589 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use ProcessMaker\BusinessModel\Lists;
|
|||||||
use G;
|
use G;
|
||||||
use Criteria;
|
use Criteria;
|
||||||
use UsersPeer;
|
use UsersPeer;
|
||||||
|
use AppDelegation;
|
||||||
use AppDelegationPeer;
|
use AppDelegationPeer;
|
||||||
use AppDelayPeer;
|
use AppDelayPeer;
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
@@ -1076,28 +1077,30 @@ class Light
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* claim case
|
* Claim case
|
||||||
*
|
*
|
||||||
* @param $userUid
|
* @param string $userUid
|
||||||
* @param $Fields
|
* @param string $appUid
|
||||||
* @param $type
|
* @param integer $delIndex
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function claimCaseUser($userUid, $sAppUid)
|
public function claimCaseUser($userUid, $appUid, $delIndex = null)
|
||||||
{
|
{
|
||||||
$response = array("status" => "fail");
|
$response = ['status' => 'fail'];
|
||||||
$oCase = new Cases();
|
$case = new Cases();
|
||||||
$iDelIndex = $oCase->getCurrentDelegation($sAppUid, '', true);
|
$appDelegation = new AppDelegation();
|
||||||
|
if (empty($delIndex)) {
|
||||||
|
$delIndex = $case->getCurrentDelegation($appUid, '', true);
|
||||||
|
}
|
||||||
|
|
||||||
$oAppDelegation = new \AppDelegation();
|
$delegation = $appDelegation->Load($appUid, $delIndex);
|
||||||
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
|
|
||||||
|
|
||||||
//if there are no user in the delegation row, this case is still in selfservice
|
//if there are no user in the delegation row, this case is still in selfservice
|
||||||
if ($aDelegation['USR_UID'] == "") {
|
if (empty($delegation['USR_UID'])) {
|
||||||
$oCase->setCatchUser($sAppUid, $iDelIndex, $userUid);
|
$case->setCatchUser($appUid, $delIndex, $userUid);
|
||||||
$response = array("status" => "ok");
|
$response['status'] = 'ok';
|
||||||
} else {
|
|
||||||
//G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
|||||||
@@ -1490,12 +1490,12 @@ class Light extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function claimCaseUser($app_uid)
|
public function claimCaseUser($app_uid, $del_index = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$userUid = $this->getUserId();
|
$userUid = $this->getUserId();
|
||||||
$oMobile = new BusinessModelLight();
|
$mobile = new BusinessModelLight();
|
||||||
$response = $oMobile->claimCaseUser($userUid, $app_uid);
|
$response = $mobile->claimCaseUser($userUid, $app_uid, $del_index);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user