Merged in bugfix/HOR-3174 (pull request #5731)
HOR-3174 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
849c9686ab
@@ -532,25 +532,7 @@ class Cases
|
||||
}
|
||||
} else {
|
||||
\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();
|
||||
|
||||
$fields = $ws->getCaseInfo($applicationUid, 0);
|
||||
$array = json_decode(json_encode($fields), true);
|
||||
|
||||
|
||||
@@ -85,7 +85,30 @@ class Cases extends Api
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "doGetCaseInfo" :
|
||||
$appUid = $this->parameters[$arrayArgs['app_uid']];
|
||||
$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);
|
||||
$criteria->setLimit(1);
|
||||
$rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
|
||||
if ($rsCriteria->next()) {
|
||||
return true;
|
||||
} else {
|
||||
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||
$flagps = $supervisor->isUserProcessSupervisor($arrayApplicationData['PRO_UID'], $usrUid);
|
||||
return $flagps;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -670,6 +693,8 @@ class Cases extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
* @class AccessControl {@className \ProcessMaker\Services\Api\Cases}
|
||||
* @url GET /:app_uid
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
|
||||
Reference in New Issue
Block a user