PMCORE-2537

This commit is contained in:
Andrea Adamczyk
2020-12-17 15:18:07 -04:00
parent df40b1c7c6
commit c740d135e0
3 changed files with 152 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process;
use ProcessMaker\Model\User;
use ProcessMaker\Model\Task;
use ProcessMaker\Services\Api;
use RBAC;
use stdClass;
@@ -662,4 +663,31 @@ class Home extends Api
return $result;
}
/**
* Get all tasks, paged optionally, can be sent a text to filter results by "TAS_TITLE"
*
* @url GET /tasks
*
* @param string $text
* @param string $proId
* @param int $offset
* @param int $limit
*
* @return array
*
* @throws Exception
*
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getTasks($text = null, $proId = null, $offset = null, $limit = null)
{
try {
$tasks = Task::getTasksForHome($text, $proId, $offset, $limit);
return $tasks;
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}