2014-03-14 15:33:35 -04:00
|
|
|
<?php
|
2014-04-02 17:02:02 -04:00
|
|
|
namespace ProcessMaker\Services\Api;
|
2014-03-14 15:33:35 -04:00
|
|
|
|
|
|
|
|
use \ProcessMaker\Services\Api;
|
|
|
|
|
use \Luracast\Restler\RestException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Cases Api Controller
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @protected
|
|
|
|
|
*/
|
|
|
|
|
class Cases extends Api
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases To Do
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET
|
|
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListToDo(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'todo';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases To Do with paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListToDoPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'todo';
|
|
|
|
|
$dataList['paged'] = true;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Draft
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /draft
|
|
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListDraft(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'draft';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Draft with paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /draft/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListDraftPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'draft';
|
|
|
|
|
$dataList['paged'] = true;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Participated
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-14 15:38:03 -04:00
|
|
|
* @url GET /participated
|
2014-03-14 15:33:35 -04:00
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListParticipated(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'sent';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Participated with paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /participated/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListParticipatedPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'sent';
|
|
|
|
|
$dataList['paged'] = true;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Unassigned
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-14 15:38:03 -04:00
|
|
|
* @url GET /unassigned
|
2014-03-14 15:33:35 -04:00
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListUnassigned(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'unassigned';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Unassigned with paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /unassigned/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListUnassignedPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'unassigned';
|
|
|
|
|
$dataList['paged'] = true;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Paused
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-14 15:38:03 -04:00
|
|
|
* @url GET /paused
|
2014-03-14 15:33:35 -04:00
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListPaused(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'paused';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Paused with paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /paused/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListPausedPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'paused';
|
2014-10-07 14:47:25 -04:00
|
|
|
$dataList["paged"] = true;
|
2014-03-24 10:39:05 -04:00
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Advanced Search
|
|
|
|
|
*
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
|
|
|
|
* @param string $app_status {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $user {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $date_from {@from path}
|
|
|
|
|
* @param string $date_to {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
2014-03-14 15:33:35 -04:00
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-14 15:38:03 -04:00
|
|
|
* @url GET /advanced-search
|
2014-03-14 15:33:35 -04:00
|
|
|
*/
|
2014-03-24 10:39:05 -04:00
|
|
|
public function doGetCasesListAdvancedSearch(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
|
|
|
|
$app_status = '',
|
2014-04-24 08:36:24 -04:00
|
|
|
$usr_uid = '',
|
2014-03-28 11:40:59 -04:00
|
|
|
$date_from = '',
|
|
|
|
|
$date_to = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-24 10:39:05 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'search';
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
|
|
|
|
$dataList['status'] = $app_status;
|
2014-04-24 08:36:24 -04:00
|
|
|
$dataList['user'] = $usr_uid;
|
2014-03-28 11:40:59 -04:00
|
|
|
$dataList['dateFrom'] = $date_from;
|
|
|
|
|
$dataList['dateTo'] = $date_to;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get list Cases Advanced Search with Paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $sort {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $dir {@from path}
|
2014-03-24 16:45:26 -04:00
|
|
|
* @param string $cat_uid {@from path}
|
|
|
|
|
* @param string $pro_uid {@from path}
|
|
|
|
|
* @param string $app_status {@from path}
|
|
|
|
|
* @param string $usr_uid {@from path}
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $date_from {@from path}
|
|
|
|
|
* @param string $date_to {@from path}
|
2014-03-24 10:39:05 -04:00
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /advanced-search/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCasesListAdvancedSearchPaged(
|
|
|
|
|
$start = 0,
|
2014-04-02 12:17:18 -04:00
|
|
|
$limit = 0,
|
2014-03-24 10:39:05 -04:00
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
2014-03-24 16:45:26 -04:00
|
|
|
$cat_uid = '',
|
|
|
|
|
$pro_uid = '',
|
|
|
|
|
$app_status = '',
|
|
|
|
|
$usr_uid = '',
|
|
|
|
|
$date_from = '',
|
|
|
|
|
$date_to = '',
|
2014-03-24 10:39:05 -04:00
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-14 15:33:35 -04:00
|
|
|
try {
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['userId'] = $this->getUserId();
|
|
|
|
|
$dataList['action'] = 'search';
|
|
|
|
|
$dataList['paged'] = true;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
2014-03-24 16:45:26 -04:00
|
|
|
$dataList['category'] = $cat_uid;
|
|
|
|
|
$dataList['process'] = $pro_uid;
|
|
|
|
|
$dataList['status'] = $app_status;
|
|
|
|
|
$dataList['user'] = $usr_uid;
|
|
|
|
|
$dataList['dateFrom'] = $date_from;
|
|
|
|
|
$dataList['dateTo'] = $date_to;
|
2014-03-24 10:39:05 -04:00
|
|
|
$dataList['search'] = $search;
|
2014-04-02 17:02:02 -04:00
|
|
|
$oCases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-24 10:39:05 -04:00
|
|
|
$response = $oCases->getList($dataList);
|
2014-03-14 15:33:35 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-17 09:09:29 -04:00
|
|
|
|
|
|
|
|
/**
|
2014-03-20 17:05:04 -04:00
|
|
|
* @url GET /:app_uid
|
2014-03-17 09:09:29 -04:00
|
|
|
*
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $app_uid {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
*/
|
2014-03-20 17:05:04 -04:00
|
|
|
public function doGetCaseInfo($app_uid)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$oData = $cases->getCaseInfo($app_uid, $userUid);
|
2014-03-18 11:59:28 -04:00
|
|
|
return $oData;
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-20 17:05:04 -04:00
|
|
|
* @url GET /:app_uid/current-task
|
2014-03-17 09:09:29 -04:00
|
|
|
*
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $app_uid {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
*/
|
2014-06-06 12:04:30 -04:00
|
|
|
public function doGetTaskCase($app_uid)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
2014-03-20 17:05:04 -04:00
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$oData = $cases->getTaskCase($app_uid, $userUid);
|
2014-03-18 11:59:28 -04:00
|
|
|
return $oData;
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @url POST
|
|
|
|
|
*
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $pro_uid {@from body} {@min 32}{@max 32}
|
|
|
|
|
* @param string $tas_uid {@from body} {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
* @param array $variables {@from body}
|
|
|
|
|
*
|
|
|
|
|
*/
|
2014-06-06 12:04:30 -04:00
|
|
|
public function doPostCase($pro_uid, $tas_uid, $variables = null)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$oData = $cases->addCase($pro_uid, $tas_uid, $userUid, $variables);
|
|
|
|
|
return $oData;
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @url POST /impersonate
|
|
|
|
|
*
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $pro_uid {@from body} {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
* @param string $usr_uid {@from body} {@min 32}{@max 32}
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $tas_uid {@from body} {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
* @param array $variables {@from body}
|
2014-03-24 11:03:23 -04:00
|
|
|
*
|
2014-03-17 09:09:29 -04:00
|
|
|
*/
|
2014-06-06 12:04:30 -04:00
|
|
|
public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables = null)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$oData = $cases->addCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables);
|
|
|
|
|
return $oData;
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-20 17:05:04 -04:00
|
|
|
* @url PUT /:app_uid/reassign-case
|
2014-03-17 09:09:29 -04:00
|
|
|
*
|
2014-03-20 17:05:04 -04:00
|
|
|
* @param string $app_uid {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
* @param string $usr_uid_source {@from body} {@min 32}{@max 32}
|
|
|
|
|
* @param string $usr_uid_target {@from body} {@min 32}{@max 32}
|
2014-03-18 17:05:30 -04:00
|
|
|
* @param string $del_index {@from body}
|
2014-03-17 09:09:29 -04:00
|
|
|
*/
|
2014-03-20 17:05:04 -04:00
|
|
|
public function doPutReassignCase($app_uid, $usr_uid_source, $usr_uid_target, $del_index = null)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$cases->updateReassignCase($app_uid, $userUid, $del_index, $usr_uid_source, $usr_uid_target);
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-04-16 16:13:54 -04:00
|
|
|
* Route Case
|
2014-03-20 17:05:04 -04:00
|
|
|
* @url PUT /:app_uid/route-case
|
2014-03-17 09:09:29 -04:00
|
|
|
*
|
2014-04-16 16:11:20 -04:00
|
|
|
* @param string $app_uid {@min 32}{@max 32}
|
2014-03-17 09:09:29 -04:00
|
|
|
* @param string $del_index {@from body}
|
|
|
|
|
*/
|
2014-03-20 17:05:04 -04:00
|
|
|
public function doPutRouteCase($app_uid, $del_index = null)
|
2014-03-17 09:09:29 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-20 17:05:04 -04:00
|
|
|
$cases->updateRouteCase($app_uid, $userUid, $del_index);
|
2014-03-17 09:09:29 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-18 14:37:47 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Cancel Case
|
|
|
|
|
*
|
|
|
|
|
* @param string $cas_uid {@min 1}{@max 32}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-26 09:50:06 -04:00
|
|
|
* @url PUT /:cas_uid/cancel
|
2014-03-18 14:37:47 -04:00
|
|
|
*/
|
|
|
|
|
public function doPutCancelCase($cas_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-18 14:37:47 -04:00
|
|
|
$cases->putCancelCase($cas_uid, $userUid);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Pause Case
|
|
|
|
|
*
|
|
|
|
|
* @param string $cas_uid {@min 1}{@max 32}
|
|
|
|
|
* @param string $unpaused_date {@from body}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-26 09:50:06 -04:00
|
|
|
* @url PUT /:cas_uid/pause
|
2014-03-18 14:37:47 -04:00
|
|
|
*/
|
|
|
|
|
public function doPutPauseCase($cas_uid, $unpaused_date = null)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-18 14:37:47 -04:00
|
|
|
if ($unpaused_date == null) {
|
|
|
|
|
$cases->putPauseCase($cas_uid, $userUid);
|
|
|
|
|
} else {
|
|
|
|
|
$cases->putPauseCase($cas_uid, $userUid, false, $unpaused_date);
|
|
|
|
|
}
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Unpause Case
|
|
|
|
|
*
|
|
|
|
|
* @param string $cas_uid {@min 1}{@max 32}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-26 09:50:06 -04:00
|
|
|
* @url PUT /:cas_uid/unpause
|
2014-03-18 14:37:47 -04:00
|
|
|
*/
|
|
|
|
|
public function doPutUnpauseCase($cas_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-18 14:37:47 -04:00
|
|
|
$cases->putUnpauseCase($cas_uid, $userUid);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Unpause Case
|
|
|
|
|
*
|
|
|
|
|
* @param string $cas_uid {@min 1}{@max 32}
|
|
|
|
|
* @param string $tri_uid {@min 1}{@max 32}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url PUT /:cas_uid/execute-trigger/:tri_uid
|
|
|
|
|
*/
|
|
|
|
|
public function doPutExecuteTriggerCase($cas_uid, $tri_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$userUid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-18 14:37:47 -04:00
|
|
|
$cases->putExecuteTriggerCase($cas_uid, $tri_uid, $userUid);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete Case
|
|
|
|
|
*
|
|
|
|
|
* @param string $cas_uid {@min 1}{@max 32}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url DELETE /:cas_uid
|
|
|
|
|
*/
|
|
|
|
|
public function doDeleteCase($cas_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-18 14:37:47 -04:00
|
|
|
$cases->deleteCase($cas_uid);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-26 09:50:06 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Case Variables
|
|
|
|
|
*
|
|
|
|
|
* @param string $app_uid {@min 1}{@max 32}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /:app_uid/variables
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCaseVariables($app_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-26 09:50:06 -04:00
|
|
|
$response = $cases->getCaseVariables($app_uid);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Put Case Variables
|
|
|
|
|
*
|
|
|
|
|
* @param string $app_uid {@min 1}{@max 32}
|
|
|
|
|
* @param array $request_data
|
2015-01-08 11:54:19 -04:00
|
|
|
* @param string $dyn_uid {@from path}
|
2014-03-26 09:50:06 -04:00
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
2014-03-26 17:16:33 -04:00
|
|
|
* @url PUT /:app_uid/variable
|
2014-03-26 09:50:06 -04:00
|
|
|
*/
|
2015-01-08 11:54:19 -04:00
|
|
|
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '')
|
2014-03-26 09:50:06 -04:00
|
|
|
{
|
|
|
|
|
try {
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2015-01-08 11:54:19 -04:00
|
|
|
$cases->setCaseVariables($app_uid, $request_data, $dyn_uid);
|
2014-03-26 12:20:20 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Case Notes
|
|
|
|
|
*
|
2014-03-28 11:40:59 -04:00
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
|
|
|
|
* @param string $sort {@from path}
|
|
|
|
|
* @param string $dir {@from path}
|
|
|
|
|
* @param string $usr_uid {@from path}
|
|
|
|
|
* @param string $date_from {@from path}
|
|
|
|
|
* @param string $date_to {@from path}
|
|
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
2014-03-26 12:20:20 -04:00
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /:app_uid/notes
|
|
|
|
|
*/
|
2014-03-28 11:40:59 -04:00
|
|
|
public function doGetCaseNotes(
|
|
|
|
|
$app_uid,
|
|
|
|
|
$start = 0,
|
|
|
|
|
$limit = 25,
|
|
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
|
|
|
|
$usr_uid = '',
|
|
|
|
|
$date_from = '',
|
|
|
|
|
$date_to = '',
|
|
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-28 11:40:59 -04:00
|
|
|
try {
|
|
|
|
|
$dataList['paged'] = false;
|
|
|
|
|
|
|
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
|
|
|
|
$dataList['user'] = $usr_uid;
|
|
|
|
|
$dataList['dateFrom'] = $date_from;
|
|
|
|
|
$dataList['dateTo'] = $date_to;
|
|
|
|
|
$dataList['search'] = $search;
|
|
|
|
|
|
|
|
|
|
$usr_uid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-28 11:40:59 -04:00
|
|
|
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList);
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Case Notes with Paged
|
|
|
|
|
*
|
|
|
|
|
* @param string $start {@from path}
|
|
|
|
|
* @param string $limit {@from path}
|
|
|
|
|
* @param string $sort {@from path}
|
|
|
|
|
* @param string $dir {@from path}
|
|
|
|
|
* @param string $usr_uid {@from path}
|
|
|
|
|
* @param string $date_from {@from path}
|
|
|
|
|
* @param string $date_to {@from path}
|
|
|
|
|
* @param string $search {@from path}
|
|
|
|
|
* @return array
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url GET /:app_uid/notes/paged
|
|
|
|
|
*/
|
|
|
|
|
public function doGetCaseNotesPaged(
|
|
|
|
|
$app_uid,
|
|
|
|
|
$start = 0,
|
|
|
|
|
$limit = 25,
|
|
|
|
|
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
|
|
|
|
$dir = 'DESC',
|
|
|
|
|
$usr_uid = '',
|
|
|
|
|
$date_from = '',
|
|
|
|
|
$date_to = '',
|
|
|
|
|
$search = ''
|
2014-06-06 12:04:30 -04:00
|
|
|
) {
|
2014-03-26 12:20:20 -04:00
|
|
|
try {
|
2014-03-28 11:40:59 -04:00
|
|
|
$dataList['start'] = $start;
|
|
|
|
|
$dataList['limit'] = $limit;
|
|
|
|
|
$dataList['sort'] = $sort;
|
|
|
|
|
$dataList['dir'] = $dir;
|
|
|
|
|
$dataList['user'] = $usr_uid;
|
|
|
|
|
$dataList['dateFrom'] = $date_from;
|
|
|
|
|
$dataList['dateTo'] = $date_to;
|
|
|
|
|
$dataList['search'] = $search;
|
|
|
|
|
|
2014-03-26 12:20:20 -04:00
|
|
|
$usr_uid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-28 11:40:59 -04:00
|
|
|
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList);
|
2014-03-26 12:20:20 -04:00
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Put Case Variables
|
|
|
|
|
*
|
|
|
|
|
* @param string $app_uid {@min 1}{@max 32}
|
|
|
|
|
* @param string $note_content {@min 1}{@max 500}
|
|
|
|
|
* @param int $send_mail {@choice 1,0}
|
|
|
|
|
*
|
|
|
|
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url POST /:app_uid/note
|
|
|
|
|
*/
|
|
|
|
|
public function doPostCaseNote($app_uid, $note_content, $send_mail = 0)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$usr_uid = $this->getUserId();
|
2014-04-02 17:02:02 -04:00
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2014-03-26 12:20:20 -04:00
|
|
|
$send_mail = ($send_mail == 0) ? false : true;
|
|
|
|
|
$cases->saveCaseNote($app_uid, $usr_uid, $note_content, $send_mail);
|
2014-03-26 09:50:06 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-05-13 16:13:18 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @url GET /:app_uid/tasks
|
|
|
|
|
*
|
|
|
|
|
* @param string $app_uid {@min 32}{@max 32}
|
|
|
|
|
*/
|
|
|
|
|
public function doGetTasks($app_uid)
|
|
|
|
|
{
|
|
|
|
|
try {
|
2014-06-06 12:04:30 -04:00
|
|
|
$case = new \ProcessMaker\BusinessModel\Cases();
|
|
|
|
|
$case->setFormatFieldNameInUppercase(false);
|
|
|
|
|
|
|
|
|
|
$response = $case->getTasks($app_uid);
|
|
|
|
|
|
|
|
|
|
return $response;
|
2014-05-13 16:13:18 -04:00
|
|
|
} catch (\Exception $e) {
|
2014-06-06 12:04:30 -04:00
|
|
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
2014-05-13 16:13:18 -04:00
|
|
|
}
|
|
|
|
|
}
|
2015-01-08 15:46:13 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Execute triggers
|
|
|
|
|
*
|
|
|
|
|
* @param string $app_uid {@min 1}{@max 32}
|
|
|
|
|
* @param string $del_index {@from body}
|
2015-01-09 11:48:36 -04:00
|
|
|
* @param string $obj_type {@from body}
|
|
|
|
|
* @param string $obj_uid {@from body}
|
2015-01-08 15:46:13 -04:00
|
|
|
*
|
|
|
|
|
* @copyright Colosa - Bolivia
|
|
|
|
|
*
|
|
|
|
|
* @url PUT /:app_uid/execute-triggers
|
|
|
|
|
*/
|
2015-01-09 11:48:36 -04:00
|
|
|
public function doPutExecuteTriggers($app_uid, $del_index = false, $obj_type, $obj_uid)
|
2015-01-08 15:46:13 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$cases = new \ProcessMaker\BusinessModel\Cases();
|
2015-01-09 11:48:36 -04:00
|
|
|
$cases->putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid);
|
2015-01-08 15:46:13 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-14 15:33:35 -04:00
|
|
|
}
|
|
|
|
|
|