Merged in darojas/processmaker (pull request #23)
Merge assignees y triggers
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,249 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker\Project\Activity;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
/**
|
||||
* Project\Activity\Assignee Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Assignee extends Api
|
||||
{
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAssignees($prjUid, $actUid, $filter = '', $start = '1', $limit = '50')
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAssignees($prjUid, $actUid, $filter, $start, $limit);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/available-assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAvailableAssignee($prjUid, $actUid, $filter = '', $start = '1', $limit = '50')
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAvailableAssignee($prjUid, $actUid, $filter, $start, $limit);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/assignee/:aasUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $aasUid
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAssignee($prjUid, $actUid, $aasUid)
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:prjUid/activity/:actUid/assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $assUid
|
||||
* @param string $assType {@choice user,group}
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostActivityAssignee($prjUid, $actUid, $assUid, $assType)
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->addTaskAssignee($prjUid, $actUid, $assUid, $assType);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/activity/:actUid/assignee/:assUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $assUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteActivityAssignee($prjUid, $actUid, $assUid)
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->removeTaskAssignee($prjUid, $actUid, $assUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/adhoc-assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAdhocAssignees($prjUid, $actUid, $filter = '', $start = '1', $limit = '50')
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAdhocAssignees($prjUid, $actUid, $filter, $start, $limit);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/available-adhoc-assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAvailableAdhocAssignee($prjUid, $actUid, $filter = '', $start = '1', $limit = '50')
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAvailableAdhocAssignee($prjUid, $actUid, $filter, $start, $limit);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prjUid/activity/:actUid/adhoc-assignee/:aasUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $assUid
|
||||
*
|
||||
*/
|
||||
public function doGetActivityAdhocAssignee($prjUid, $actUid, $aasUid)
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:prjUid/activity/:actUid/adhoc-assignee
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $assUid
|
||||
* @param string $assType {@choice user,group}
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostActivityAdhocAssignee($prjUid, $actUid, $assUid, $assType)
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->addTaskAdhocAssignee($prjUid, $actUid, $assUid, $assType);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/activity/:actUid/adhoc-assignee/:assUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $actUid
|
||||
* @param string $assUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $assUid)
|
||||
{
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->removeTaskAdhocAssignee($prjUid, $actUid, $assUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,5 +15,6 @@ debug = 1
|
||||
[alias: project]
|
||||
activity = "Services\Api\ProcessMaker\Project\Activity"
|
||||
step = "Services\Api\ProcessMaker\Project\Activity\Step"
|
||||
assignee = "Services\Api\ProcessMaker\Project\Activity\Assignee"
|
||||
trigger = "Services\Api\ProcessMaker\Project\Activity\Step\Trigger"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user