HOR-3174
update update update update update
This commit is contained in:
@@ -459,25 +459,7 @@ class Cases
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\G::LoadClass("wsBase");
|
\G::LoadClass("wsBase");
|
||||||
|
|
||||||
//Verify data
|
|
||||||
$this->throwExceptionIfNotExistsCase($applicationUid, 0, $this->getFieldNameByFormatFieldName("APP_UID"));
|
|
||||||
|
|
||||||
$criteria = new \Criteria("workflow");
|
|
||||||
|
|
||||||
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
|
|
||||||
$criteria->add(\AppDelegationPeer::APP_UID, $applicationUid);
|
|
||||||
$criteria->add(\AppDelegationPeer::USR_UID, $userUid);
|
|
||||||
|
|
||||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
|
||||||
|
|
||||||
if (!$rsCriteria->next()) {
|
|
||||||
throw new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED"));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get data
|
|
||||||
$ws = new \wsBase();
|
$ws = new \wsBase();
|
||||||
|
|
||||||
$fields = $ws->getCaseInfo($applicationUid, 0);
|
$fields = $ws->getCaseInfo($applicationUid, 0);
|
||||||
$array = json_decode(json_encode($fields), true);
|
$array = json_decode(json_encode($fields), true);
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,31 @@ class Cases extends Api
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
case "doGetCaseInfo" :
|
||||||
|
$appUid = $this->parameters[0];
|
||||||
|
$usrUid = $this->getUserId();
|
||||||
|
//Check if the user is supervisor process
|
||||||
|
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||||
|
$user = new \ProcessMaker\BusinessModel\User();
|
||||||
|
$arrayApplicationData = $case->getApplicationRecordByPk($appUid, [], false);
|
||||||
|
if (!empty($arrayApplicationData)) {
|
||||||
|
$criteria = new \Criteria("workflow");
|
||||||
|
$criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
|
||||||
|
$criteria->add(\AppDelegationPeer::APP_UID, $appUid);
|
||||||
|
$criteria->add(\AppDelegationPeer::USR_UID, $usrUid);
|
||||||
|
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||||
|
if ($rsCriteria->next()) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if ($user->checkPermission($usrUid, 'PM_SUPERVISOR')) {
|
||||||
|
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||||
|
$flagps = $supervisor->isUserProcessSupervisor($arrayApplicationData['PRO_UID'], $usrUid);
|
||||||
|
return $flagps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
@@ -670,6 +694,8 @@ class Cases extends Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @access protected
|
||||||
|
* @class AccessControl {@className \ProcessMaker\Services\Api\Cases}
|
||||||
* @url GET /:app_uid
|
* @url GET /:app_uid
|
||||||
*
|
*
|
||||||
* @param string $app_uid {@min 32}{@max 32}
|
* @param string $app_uid {@min 32}{@max 32}
|
||||||
|
|||||||
Reference in New Issue
Block a user