Ejemplo n.º 1
0
 /**
  * @url GET /:rol_uid
  *
  * @param string $rol_uid {@min 32}{@max 32}
  */
 public function doGet($rol_uid)
 {
     try {
         $response = $this->role->getRole($rol_uid);
         return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 2
0
 /**
  * @url GET /:prj_uid/dynaform/:dyn_uid
  *
  * @param string $dyn_uid {@min 32}{@max 32}
  * @param string $prj_uid {@min 32}{@max 32}
  */
 public function doGetDynaForm($dyn_uid, $prj_uid)
 {
     try {
         $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
         $dynaForm->setFormatFieldNameInUppercase(false);
         $response = $dynaForm->getDynaForm($dyn_uid);
         return DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 3
0
 /**
  * @url GET /:usr_uid
  *
  * @param string $usr_uid {@min 32}{@max 32}
  */
 public function doGetUser($usr_uid)
 {
     try {
         $user = new \ProcessMaker\BusinessModel\User();
         $user->setFormatFieldNameInUppercase(false);
         $response = $user->getUser($usr_uid);
         return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 4
0
 /**
  * @url POST /:prj_uid/web-entry
  *
  * @param string $prj_uid      {@min 32}{@max 32}
  * @param array  $request_data
  *
  * @status 201
  */
 public function doPostWebEntry($prj_uid, array $request_data)
 {
     try {
         Validator::throwExceptionIfDataNotMetIso8601Format($request_data, $this->arrayFieldIso8601);
         $arrayData = $this->webEntry->create($prj_uid, $this->getUserId(), DateTime::convertDataToUtc($request_data, $this->arrayFieldIso8601));
         $response = $arrayData;
         return DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 5
0
 /**
  * @url POST /:prj_uid/timer-event
  *
  * @param string $prj_uid      {@min 32}{@max 32}
  * @param array  $request_data
  *
  * @status 201
  */
 public function doPostTimerEvent($prj_uid, array $request_data)
 {
     try {
         \ProcessMaker\BusinessModel\Validator::throwExceptionIfDataNotMetIso8601Format($request_data, $this->arrayFieldIso8601);
         $arrayData = $this->timerEvent->create($prj_uid, \ProcessMaker\Util\DateTime::convertDataToUtc($request_data, $this->arrayFieldIso8601));
         $response = $arrayData;
         return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 6
0
 /**
  * Get Case Notes
  *
  * @param string $app_uid {@min 1}{@max 32}
  * @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
  *
  * @copyright Colosa - Bolivia
  *
  * @url GET /case/:app_uid/notes
  */
 public function doGetCaseNotes($app_uid, $start = 0, $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $usr_uid = '', $date_from = '', $date_to = '', $search = '')
 {
     try {
         $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;
         $appNotes = new \AppNotes();
         $response = $appNotes->getNotesList($app_uid, '', $start, $limit);
         $response = $this->parserDataNotes($response['array']['notes']);
         return DateTime::convertUtcToIso8601($response, array('date'));
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }
Ejemplo n.º 7
0
 /**
  * Get list Unassigned
  *
  * @param string $count {@from path}
  * @param string $paged {@from path}
  * @param string $start {@from path}
  * @param string $limit {@from path}
  * @param string $sort {@from path}
  * @param string $dir {@from path}
  * @param string $category {@from path}
  * @param string $process {@from path}
  * @param string $search {@from path}
  * @param string $filter {@from path}
  * @param string $date_from {@from path}
  * @param string $date_to {@from path}
  * @return array
  *
  * @author Brayan Pereyra (Cochalo) <*****@*****.**>
  * @copyright Colosa - Bolivia
  *
  * @url GET /unassigned
  */
 public function doGetListUnassigned($count = true, $paged = true, $start = 0, $limit = 0, $sort = 'APP_UPDATE_DATE', $dir = 'DESC', $category = '', $process = '', $search = '', $filter = '', $date_from = '', $date_to = '', $usr_uid = '')
 {
     try {
         $dataList['userId'] = empty($usr_uid) ? $this->getUserId() : $usr_uid;
         $dataList['paged'] = $paged;
         $dataList['count'] = $count;
         $dataList['start'] = $start;
         $dataList['limit'] = $limit;
         $dataList['sort'] = $sort;
         $dataList['dir'] = $dir;
         $dataList['category'] = $category;
         $dataList['process'] = $process;
         $dataList['search'] = $search;
         $dataList['filter'] = $filter;
         $dataList['dateFrom'] = $date_from;
         $dataList['dateTo'] = $date_to;
         $lists = new \ProcessMaker\BusinessModel\Lists();
         $response = $lists->getList('unassigned', $dataList);
         return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response, $this->arrayFieldIso8601);
     } catch (\Exception $e) {
         throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
     }
 }