PMCORE-3184
This commit is contained in:
@@ -50,9 +50,10 @@ class Home extends Api
|
|||||||
* @param int $caseNumber
|
* @param int $caseNumber
|
||||||
* @param int $process
|
* @param int $process
|
||||||
* @param int $task
|
* @param int $task
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -66,9 +67,10 @@ class Home extends Api
|
|||||||
int $caseNumber = 0,
|
int $caseNumber = 0,
|
||||||
int $process = 0,
|
int $process = 0,
|
||||||
int $task = 0,
|
int $task = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -83,11 +85,10 @@ class Home extends Api
|
|||||||
// Get the user that access to the API
|
// Get the user that access to the API
|
||||||
$usrUid = $this->getUserId();
|
$usrUid = $this->getUserId();
|
||||||
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
||||||
// Set the pagination parameters
|
$properties['start'] = $offset;
|
||||||
$paged = explode(',', $paged);
|
$properties['limit'] = $limit;
|
||||||
|
// Set the sort parameters
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -108,11 +109,12 @@ class Home extends Api
|
|||||||
* @param int $caseNumber
|
* @param int $caseNumber
|
||||||
* @param int $process
|
* @param int $process
|
||||||
* @param int $task
|
* @param int $task
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $delegateFrom
|
* @param string $delegateFrom
|
||||||
* @param string $delegateTo
|
* @param string $delegateTo
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -126,11 +128,12 @@ class Home extends Api
|
|||||||
int $caseNumber = 0,
|
int $caseNumber = 0,
|
||||||
int $process = 0,
|
int $process = 0,
|
||||||
int $task = 0,
|
int $task = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $delegateFrom = '',
|
string $delegateFrom = '',
|
||||||
string $delegateTo = '',
|
string $delegateTo = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -147,11 +150,10 @@ class Home extends Api
|
|||||||
// Get the user that access to the API
|
// Get the user that access to the API
|
||||||
$usrUid = $this->getUserId();
|
$usrUid = $this->getUserId();
|
||||||
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
||||||
|
$properties['start'] = $offset;
|
||||||
|
$properties['limit'] = $limit;
|
||||||
// Set the pagination parameters
|
// Set the pagination parameters
|
||||||
$paged = explode(',', $paged);
|
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -172,11 +174,12 @@ class Home extends Api
|
|||||||
* @param int $caseNumber
|
* @param int $caseNumber
|
||||||
* @param int $process
|
* @param int $process
|
||||||
* @param int $task
|
* @param int $task
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $delegateFrom
|
* @param string $delegateFrom
|
||||||
* @param string $delegateTo
|
* @param string $delegateTo
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -190,11 +193,12 @@ class Home extends Api
|
|||||||
int $caseNumber = 0,
|
int $caseNumber = 0,
|
||||||
int $process = 0,
|
int $process = 0,
|
||||||
int $task = 0,
|
int $task = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $delegateFrom = '',
|
string $delegateFrom = '',
|
||||||
string $delegateTo = '',
|
string $delegateTo = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -211,11 +215,10 @@ class Home extends Api
|
|||||||
// Get the user that access to the API
|
// Get the user that access to the API
|
||||||
$usrUid = $this->getUserId();
|
$usrUid = $this->getUserId();
|
||||||
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
||||||
// Set the pagination parameters
|
$properties['start'] = $offset;
|
||||||
$paged = explode(',', $paged);
|
$properties['limit'] = $limit;
|
||||||
|
// Set the sort parameters
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
// todo: some queries related to the unassigned are using the USR_UID
|
// todo: some queries related to the unassigned are using the USR_UID
|
||||||
@@ -238,11 +241,12 @@ class Home extends Api
|
|||||||
* @param int $caseNumber
|
* @param int $caseNumber
|
||||||
* @param int $process
|
* @param int $process
|
||||||
* @param int $task
|
* @param int $task
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $delegateFrom
|
* @param string $delegateFrom
|
||||||
* @param string $delegateTo
|
* @param string $delegateTo
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -256,11 +260,12 @@ class Home extends Api
|
|||||||
int $caseNumber = 0,
|
int $caseNumber = 0,
|
||||||
int $process = 0,
|
int $process = 0,
|
||||||
int $task = 0,
|
int $task = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $delegateFrom = '',
|
string $delegateFrom = '',
|
||||||
string $delegateTo = '',
|
string $delegateTo = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -277,11 +282,10 @@ class Home extends Api
|
|||||||
// Get the user that access to the API
|
// Get the user that access to the API
|
||||||
$usrUid = $this->getUserId();
|
$usrUid = $this->getUserId();
|
||||||
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
$properties['user'] = !empty($usrUid) ? User::getId($usrUid) : 0;
|
||||||
// Set the pagination parameters
|
$properties['start'] = $offset;
|
||||||
$paged = explode(',', $paged);
|
$properties['limit'] = $limit;
|
||||||
|
// Set the sort parameters
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -302,6 +306,8 @@ class Home extends Api
|
|||||||
* @param int $caseNumber
|
* @param int $caseNumber
|
||||||
* @param int $process
|
* @param int $process
|
||||||
* @param int $task
|
* @param int $task
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
* @param string $filter
|
* @param string $filter
|
||||||
@@ -310,7 +316,6 @@ class Home extends Api
|
|||||||
* @param string $startCaseTo
|
* @param string $startCaseTo
|
||||||
* @param string $finishCaseFrom
|
* @param string $finishCaseFrom
|
||||||
* @param string $finishCaseTo
|
* @param string $finishCaseTo
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -324,6 +329,8 @@ class Home extends Api
|
|||||||
int $caseNumber = 0,
|
int $caseNumber = 0,
|
||||||
int $process = 0,
|
int $process = 0,
|
||||||
int $task = 0,
|
int $task = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
string $filter = 'IN_PROGRESS',
|
string $filter = 'IN_PROGRESS',
|
||||||
@@ -332,7 +339,6 @@ class Home extends Api
|
|||||||
string $startCaseTo = '',
|
string $startCaseTo = '',
|
||||||
string $finishCaseFrom = '',
|
string $finishCaseFrom = '',
|
||||||
string $finishCaseTo = '',
|
string $finishCaseTo = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
// Define the filters to apply
|
// Define the filters to apply
|
||||||
@@ -351,11 +357,10 @@ class Home extends Api
|
|||||||
$properties['startCaseTo'] = $startCaseTo;
|
$properties['startCaseTo'] = $startCaseTo;
|
||||||
$properties['finishCaseFrom'] = $finishCaseFrom;
|
$properties['finishCaseFrom'] = $finishCaseFrom;
|
||||||
$properties['finishCaseTo'] = $finishCaseTo;
|
$properties['finishCaseTo'] = $finishCaseTo;
|
||||||
// Set the pagination parameters
|
$properties['start'] = $offset;
|
||||||
$paged = explode(',', $paged);
|
$properties['limit'] = $limit;
|
||||||
|
// Set the sort parameters
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$result = [];
|
$result = [];
|
||||||
@@ -395,6 +400,7 @@ class Home extends Api
|
|||||||
* Get counters
|
* Get counters
|
||||||
*
|
*
|
||||||
* @url GET /counters
|
* @url GET /counters
|
||||||
|
* @url GET /mycases/counters
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
@@ -466,6 +472,8 @@ class Home extends Api
|
|||||||
* @param int $user
|
* @param int $user
|
||||||
* @param int $userCompleted
|
* @param int $userCompleted
|
||||||
* @param int $userStarted
|
* @param int $userStarted
|
||||||
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
* @param string $caseTitle
|
* @param string $caseTitle
|
||||||
* @param string $caseStatuses
|
* @param string $caseStatuses
|
||||||
* @param string $filterCases
|
* @param string $filterCases
|
||||||
@@ -473,7 +481,6 @@ class Home extends Api
|
|||||||
* @param string $startCaseTo
|
* @param string $startCaseTo
|
||||||
* @param string $finishCaseFrom
|
* @param string $finishCaseFrom
|
||||||
* @param string $finishCaseTo
|
* @param string $finishCaseTo
|
||||||
* @param string $paged
|
|
||||||
* @param string $sort
|
* @param string $sort
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@@ -491,6 +498,8 @@ class Home extends Api
|
|||||||
int $user = 0,
|
int $user = 0,
|
||||||
int $userCompleted = 0,
|
int $userCompleted = 0,
|
||||||
int $userStarted = 0,
|
int $userStarted = 0,
|
||||||
|
int $limit = 15,
|
||||||
|
int $offset = 0,
|
||||||
string $caseTitle = '',
|
string $caseTitle = '',
|
||||||
string $caseStatuses = '',
|
string $caseStatuses = '',
|
||||||
string $filterCases = '',
|
string $filterCases = '',
|
||||||
@@ -498,7 +507,6 @@ class Home extends Api
|
|||||||
string $startCaseTo = '',
|
string $startCaseTo = '',
|
||||||
string $finishCaseFrom = '',
|
string $finishCaseFrom = '',
|
||||||
string $finishCaseTo = '',
|
string $finishCaseTo = '',
|
||||||
string $paged = '0,15',
|
|
||||||
string $sort = 'APP_NUMBER,DESC'
|
string $sort = 'APP_NUMBER,DESC'
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@@ -519,11 +527,10 @@ class Home extends Api
|
|||||||
$properties['startCaseTo'] = $startCaseTo;
|
$properties['startCaseTo'] = $startCaseTo;
|
||||||
$properties['finishCaseFrom'] = $finishCaseFrom;
|
$properties['finishCaseFrom'] = $finishCaseFrom;
|
||||||
$properties['finishCaseTo'] = $finishCaseTo;
|
$properties['finishCaseTo'] = $finishCaseTo;
|
||||||
// Set the pagination parameters
|
$properties['start'] = $offset;
|
||||||
$paged = explode(',', $paged);
|
$properties['limit'] = $limit;
|
||||||
|
// Set the sort parameters
|
||||||
$sort = explode(',', $sort);
|
$sort = explode(',', $sort);
|
||||||
$properties['start'] = (int)$paged[0];
|
|
||||||
$properties['limit'] = (int)$paged[1];
|
|
||||||
$properties['sort'] = $sort[0];
|
$properties['sort'] = $sort[0];
|
||||||
$properties['dir'] = $sort[1];
|
$properties['dir'] = $sort[1];
|
||||||
$list->setProperties($properties);
|
$list->setProperties($properties);
|
||||||
@@ -625,9 +632,7 @@ class Home extends Api
|
|||||||
public function getPendingTasks(int $appNumber)
|
public function getPendingTasks(int $appNumber)
|
||||||
{
|
{
|
||||||
// Get the pending task
|
// Get the pending task
|
||||||
$result = Delegation::getPendingTask($appNumber);
|
return Delegation::getPendingTask($appNumber);
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -647,11 +652,10 @@ class Home extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function getProcesses($text = null, $category = null, $offset = null, $limit = null)
|
public function getProcesses($text = null, $category = null, int $offset = 0, int $limit = 15)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$processes = Process::getProcessesForHome($text, $category, $offset, $limit);
|
return Process::getProcessesForHome($text, $category, $offset, $limit);
|
||||||
return $processes;
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -673,11 +677,10 @@ class Home extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function getUsers($text = null, $offset = null, $limit = null)
|
public function getUsers($text = null, int $offset = 0, int $limit = 15)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$users = User::getUsersForHome($text, $offset, $limit);
|
return User::getUsersForHome($text, $offset, $limit);
|
||||||
return $users;
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -732,7 +735,9 @@ class Home extends Api
|
|||||||
* Get the tasks counters for todo, draft, paused and unassigned
|
* Get the tasks counters for todo, draft, paused and unassigned
|
||||||
*
|
*
|
||||||
* @url GET /tasks/counter
|
* @url GET /tasks/counter
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
@@ -782,11 +787,10 @@ class Home extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function getTasks($text = null, $proId = null, $offset = null, $limit = null)
|
public function getTasks(string $text = null, string $proId = null, int $offset = 0, int $limit = 15)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$tasks = Task::getTasksForHome($text, $proId, $offset, $limit);
|
return Task::getTasksForHome($text, $proId, $offset, $limit);
|
||||||
return $tasks;
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -806,7 +810,7 @@ class Home extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function getProcessDebugStatus($processUid)
|
public function getProcessDebugStatus(string $processUid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// Get the process requested
|
// Get the process requested
|
||||||
@@ -891,8 +895,8 @@ class Home extends Api
|
|||||||
* @url GET /categories
|
* @url GET /categories
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param int $start
|
|
||||||
* @param int $limit
|
* @param int $limit
|
||||||
|
* @param int $offset
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
@@ -901,11 +905,10 @@ class Home extends Api
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class AccessControl {@permission PM_CASES}
|
* @class AccessControl {@permission PM_CASES}
|
||||||
*/
|
*/
|
||||||
public function getCategories($name = null, $start = null, $limit = null)
|
public function getCategories($name = null, int $limit = 0, int $offset = 15)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$categories = ProcessCategory::getProcessCategories($name, $start, $limit);
|
return ProcessCategory::getProcessCategories($name, $offset, $limit);
|
||||||
return $categories;
|
|
||||||
} 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