Non conflict files
This commit is contained in:
80
workflow/engine/src/ProcessMaker/BusinessModel/Catalog.php
Normal file
80
workflow/engine/src/ProcessMaker/BusinessModel/Catalog.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
/**
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Catalog
|
||||
{
|
||||
|
||||
/**
|
||||
* Get CatalogUid by UserUid
|
||||
*
|
||||
* @param string $cat_type type of catalog
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
**/
|
||||
public function getCatalogByType($cat_type)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->loadByType($cat_type);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Catalog
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function create($arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->create($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Catalog
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group update
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function update($cat_uid, $cat_type, $arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->update($cat_uid, $cat_type, $arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Catalog
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function delete($cat_uid, $cat_type)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->delete($cat_uid, $cat_type);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
461
workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php
Normal file
461
workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php
Normal file
@@ -0,0 +1,461 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
/**
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Dashboard {
|
||||
|
||||
/**
|
||||
* Get DashboardUid by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboardsUidByUser($usr_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
|
||||
$oDashboardDasInd = new \DashboardDasInd();
|
||||
|
||||
$response = $oDashboardDasInd->loadByOwner($usr_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Dashboard Data by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboardDataByUser($usr_uid)
|
||||
{
|
||||
$resp = array();
|
||||
$dashboards = $this->getDashboardsUidByUser($usr_uid);
|
||||
$existFavorite = false;
|
||||
foreach($dashboards as $i=>$x) {
|
||||
$resp[$i] = $this->getDashboard($x['DAS_UID']);
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$dashConfig = $Dashboard->getConfig($usr_uid);
|
||||
$resp[$i]['DAS_FAVORITE'] = 0;
|
||||
foreach ($dashConfig as $dashId=>$dashData) {
|
||||
if($dashId == $x['DAS_UID'] ) {
|
||||
$resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite'];
|
||||
if ($dashData['dashFavorite']==1) {
|
||||
$existFavorite = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if no favorite is set, the default vavorite is the first one
|
||||
if ($existFavorite == false && $dashboards != null && sizeof($dashboards)>0) {
|
||||
$resp[0]['DAS_FAVORITE'] = 1;
|
||||
}
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Users of a dashboard
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getUsersOfDashboard($das_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
|
||||
$oDashboardDasInd = new \DashboardDasInd();
|
||||
|
||||
$response = $oDashboardDasInd->loadByDashboards($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboard data
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboard($das_uid)
|
||||
{
|
||||
$oDashboard = new \Dashboard();
|
||||
$response = $oDashboard->load($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboard indicators
|
||||
*
|
||||
* @param string $dasInd_uid Unique id of the Dashboard indicator
|
||||
*
|
||||
* return id
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getIndicator($dasInd_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardIndicator.php");
|
||||
$oDashboardIndicator = new \DashboardIndicator();
|
||||
|
||||
$response = $oDashboardIndicator->load($dasInd_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get dashboard indicators by das_uid
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
* @param string $dateIni
|
||||
* @param string $dateFin
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getIndicatorsByDasUid($das_uid, $dateIni, $dateFin, $usrUid)
|
||||
{
|
||||
$oDashboardIndicator = new \DashboardIndicator();
|
||||
|
||||
$response = $oDashboardIndicator->loadbyDasUid($das_uid, $dateIni, $dateFin, $usrUid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list All dashboards
|
||||
*
|
||||
* @access public
|
||||
* @param array $options, Data for list
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function getListDashboards($options = array())
|
||||
{
|
||||
Validator::isArray($options, '$options');
|
||||
|
||||
G::LoadClass("dashboards");
|
||||
$dir = isset( $options["dir"] ) ? $options["dir"] : "DESC";
|
||||
$sort = isset( $options["sort"] ) ? $options["sort"] : "DASHBOARD.DAS_TITLE";
|
||||
$start = isset( $options["start"] ) ? $options["start"] : "0";
|
||||
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
|
||||
$search = isset( $options["search"] ) ? $options["search"] : "";
|
||||
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
|
||||
$type = "extjs";
|
||||
|
||||
$start = (int)$start;
|
||||
$start = abs($start);
|
||||
if ($start != 0) {
|
||||
$start--;
|
||||
}
|
||||
$limit = (int)$limit;
|
||||
$limit = abs($limit);
|
||||
if ($limit == 0) {
|
||||
G::LoadClass("configuration");
|
||||
$conf = new \Configurations();
|
||||
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($configList['casesListRowNumber'])) {
|
||||
$limit = (int)$configList['casesListRowNumber'];
|
||||
} else {
|
||||
$limit = 25;
|
||||
}
|
||||
} else {
|
||||
$limit = (int)$limit;
|
||||
}
|
||||
|
||||
if ($sort != 'DASHBOARD.DAS_TITLE') {
|
||||
$sort = G::toUpper($sort);
|
||||
$columnsAppCacheView = DashboardPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
|
||||
if (!(in_array($sort, $columnsAppCacheView))) {
|
||||
$sort = 'APP_CACHE_VIEW.APP_NUMBER';
|
||||
}
|
||||
}
|
||||
$dir = G::toUpper($dir);
|
||||
if (!($dir == 'DESC' || $dir == 'ASC')) {
|
||||
$dir = 'DESC';
|
||||
}
|
||||
|
||||
$dashboards = new \Dashboards();
|
||||
$result = $dashboards->getListDashboards($start, $limit, $sort, $dir, $search);
|
||||
|
||||
if ($paged == false) {
|
||||
$response = $result['data'];
|
||||
} else {
|
||||
$response['total'] = $result['totalCount'];
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['sort'] = G::toLower($sort);
|
||||
$response['dir'] = G::toLower($dir);
|
||||
$response['search'] = $search;
|
||||
|
||||
$response['data'] = $result['data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list All owners of dashboards
|
||||
*
|
||||
* @access public
|
||||
* @param array $options, Data for list
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function getOwnerByDasUid($options = array())
|
||||
{
|
||||
Validator::isArray($options, '$options');
|
||||
|
||||
G::LoadClass("dashboards");
|
||||
$das_uid = isset( $options["das_uid"] ) ? $options["das_uid"] : "";
|
||||
$start = isset( $options["start"] ) ? $options["start"] : "0";
|
||||
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
|
||||
$search = isset( $options["search"] ) ? $options["search"] : "";
|
||||
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
|
||||
$type = "extjs";
|
||||
|
||||
$start = (int)$start;
|
||||
$start = abs($start);
|
||||
if ($start != 0) {
|
||||
$start--;
|
||||
}
|
||||
$limit = (int)$limit;
|
||||
$limit = abs($limit);
|
||||
if ($limit == 0) {
|
||||
G::LoadClass("configuration");
|
||||
$conf = new \Configurations();
|
||||
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($configList['casesListRowNumber'])) {
|
||||
$limit = (int)$configList['casesListRowNumber'];
|
||||
} else {
|
||||
$limit = 25;
|
||||
}
|
||||
} else {
|
||||
$limit = (int)$limit;
|
||||
}
|
||||
|
||||
$dashboards = new \Dashboards();
|
||||
$result = $dashboards->getOwnerByDasUid($das_uid, $start, $limit, $search);
|
||||
|
||||
|
||||
if ($paged == false) {
|
||||
$response = $result['data'];
|
||||
} else {
|
||||
$response['totalCount'] = $result['totalCount'];
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['search'] = $search;
|
||||
|
||||
$response['owner'] = $result['data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Dashboard created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createDashboard($arrayData)
|
||||
{
|
||||
$dashboard = new \Dashboard();
|
||||
$response = $dashboard->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Dashboard
|
||||
*
|
||||
* @param string $das_uid Unique id
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function deletedashboard($das_uid)
|
||||
{
|
||||
$dashboard = new \Dashboard();
|
||||
$response = $dashboard->remove($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard Owner
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Owner created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createOwner($arrayData)
|
||||
{
|
||||
$dashboard = new \DashboardDasInd();
|
||||
$response = $dashboard->create($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Dashboard owner
|
||||
*
|
||||
* @param string $das_uid
|
||||
* @param string $owner_uid
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function deleteDashboardOwner($das_uid, $owner_uid)
|
||||
{
|
||||
$dashboard = new \DashboardDasInd();
|
||||
$response = $dashboard->remove($das_uid, $owner_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard Indicator
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Indicator created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createIndicator($arrayData)
|
||||
{
|
||||
$dashboard = new \DashboardIndicator();
|
||||
$response = $dashboard->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Indicator
|
||||
*
|
||||
* @param string $das_ind_uid Unique id
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function delete($das_ind_uid)
|
||||
{
|
||||
$dashboard = new \DashboardIndicator();
|
||||
$response = $dashboard->remove($das_ind_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Dashboards User Configuration
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return array Return data of the user configuration
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function postConfigByUsr($arrayData, $usrUid)
|
||||
{
|
||||
$cnfgData[$arrayData['dashId']] = $arrayData;
|
||||
|
||||
$data['CFG_UID'] = 'DASHBOARDS_SETTINGS';
|
||||
$data['OBJ_UID'] = '';
|
||||
$data['CFG_VALUE'] = serialize($cnfgData);
|
||||
$data['USR_UID'] = $usrUid;
|
||||
$data['PRO_UID'] = "";
|
||||
$data['APP_UID'] = "";
|
||||
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = $oConfig->create($data);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Dashboard configuration by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getConfig($usr_uid)
|
||||
{
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = array();
|
||||
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usr_uid, '') == true){
|
||||
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usr_uid, '');
|
||||
$response = unserialize($data['CFG_VALUE']);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put Dashboard configuration by UserUid
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function putConfigByUsr($arrayData, $usrUid)
|
||||
{
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$cnfgData = array();
|
||||
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usrUid, '') == true){
|
||||
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usrUid, '');
|
||||
$cnfgData = unserialize($data['CFG_VALUE']);
|
||||
}
|
||||
|
||||
if($arrayData['dashData']==""){
|
||||
foreach($cnfgData as $dashId=>$dashData) {
|
||||
$cnfgData[$dashData['dashId']]['dashFavorite'] = 0;
|
||||
}
|
||||
$cnfgData[$arrayData['dashId']]['dashId'] = $arrayData['dashId'];
|
||||
$cnfgData[$arrayData['dashId']]['dashFavorite'] = $arrayData['dashFavorite'];
|
||||
$cnfgData[$arrayData['dashId']]['dashData'] = $arrayData['dashData'];
|
||||
} else{
|
||||
$cnfgData[$arrayData['dashId']] = $arrayData;
|
||||
}
|
||||
|
||||
$data['CFG_UID'] = 'DASHBOARDS_SETTINGS';
|
||||
$data['OBJ_UID'] = '';
|
||||
$data['CFG_VALUE'] = serialize($cnfgData);
|
||||
$data['USR_UID'] = $usrUid;
|
||||
$data['PRO_UID'] = "";
|
||||
$data['APP_UID'] = "";
|
||||
|
||||
$response = $oConfig->update($data);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
|
||||
class ReportingIndicators
|
||||
{
|
||||
// /**et
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $processList array with the list of processes to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getPeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$processes = $calculator->peiProcesses($indicatorUid, $measureDate, $measureDate, $language);
|
||||
$arr = $calculator->indicatorData($indicatorUid);
|
||||
$indicator = $arr[0];
|
||||
$processesId = $indicator['DAS_UID_PROCESS'];
|
||||
$peiValue = current(reset($calculator-> peiHistoric($processesId, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$peiCost = current(reset($calculator->peiCostHistoric($processesId, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$peiCompare = current(reset($calculator->peiHistoric($processesId, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
|
||||
$retval = array("efficiencyIndex" => $peiValue,
|
||||
"efficiencyVariation" => ($peiValue-$peiCompare),
|
||||
"inefficiencyCost" => $peiCost,
|
||||
"data"=>$processes);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $employeeList array with the list of employeees to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getUeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$groups = $calculator->ueiUserGroups($indicatorUid, $measureDate, $measureDate, $language);
|
||||
|
||||
$groupIds = array();
|
||||
foreach($groups as $p) {
|
||||
array_push($groupIds, $p['uid']);
|
||||
}
|
||||
|
||||
if (sizeof($groupIds) == 0) {
|
||||
$groupIds = null;
|
||||
}
|
||||
|
||||
//TODO think what if each indicators has a group or user subset assigned. Now are all
|
||||
$ueiValue = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$arrCost = $calculator->ueiUserGroups($indicatorUid, $measureDate, $measureDate, $language);
|
||||
|
||||
$ueiCost = (sizeof($arrCost) > 0)
|
||||
? $arrCost[0]['inefficiencyCost']
|
||||
: null;
|
||||
|
||||
$ueiCompare = current(reset($calculator->ueiHistoric(null, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
|
||||
$retval = array("efficiencyIndex" => $ueiValue,
|
||||
"efficiencyVariation" => ($ueiValue-$ueiCompare),
|
||||
"inefficiencyCost" => $ueiCost,
|
||||
"data"=>$groups);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $employeeList array with the list of employeees to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getUeiGroupsStatistics($groupId, $initDate, $endDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$retval = $calculator->groupEmployeesData($groupId, $initDate, $endDate, $language);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $processList array with the list of processes to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getPeiTasksStatistics($processList, $initDate, $endDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$retval = $calculator->peiTasks($processList, $initDate, $endDate, $language);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
// *
|
||||
// * @param array $employeeList array with the list of employeees to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getEmployeeTasksInfoList($employeeList, $initDate, $endDate, $language)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->employeeTasksInfoList($employeeList, $initDate, $endDate, $language);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentOverdueCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->percentOverdueCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue by period (month, semester, etc.)
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentOverdueCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->percentOverdueCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the number of new Cases
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentNewCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalNewCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of new Cases historically
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentNewCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalNewCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * Returns the number of completed Cases
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentCompletedCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalCompletedCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of completed Cases historically
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentCompletedCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalCompletedCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// *
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getProcessEfficiencyIndexData($processId, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $indexValue = $calculator->processEfficiencyIndex ($processId, $initDate, $endDate);
|
||||
// $costValue = $calculator->processEfficiencyCost ($processId, $initDate, $endDate);
|
||||
// $retval = $calculator->totalCompletedCasesByProcessList($processId, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param $indicatorId
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
* @return array
|
||||
*/
|
||||
public function getGeneralIndicatorStatistics($indicatorId, $initDate, $endDate, $periodicity)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$arr = $calculator->generalIndicatorData($indicatorId, $initDate, $endDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = $arr[0]['value'];
|
||||
$dataList1 = $calculator->
|
||||
generalIndicatorData($indicatorId,
|
||||
$initDate, $endDate,
|
||||
\ReportingPeriodicityEnum::fromValue($arr[0]['frequency1Type']));
|
||||
|
||||
$dataList2 = $calculator->
|
||||
generalIndicatorData($indicatorId,
|
||||
$initDate, $endDate,
|
||||
\ReportingPeriodicityEnum::fromValue($arr[0]['frequency2Type']));
|
||||
|
||||
$returnValue = array("index" => $value,
|
||||
"graph1XLabel"=>$arr[0]['graph1XLabel'],
|
||||
"graph1YLabel"=>$arr[0]['graph1YLabel'],
|
||||
"graph2XLabel"=>$arr[0]['graph2XLabel'],
|
||||
"graph2YLabel"=>$arr[0]['graph2YLabel'],
|
||||
"graph1Type"=>$arr[0]['graph1Type'],
|
||||
"graph2Type"=>$arr[0]['graph2Type'],
|
||||
"frequency1Type"=>$arr[0]['frequency1Type'],
|
||||
"frequency2Type"=>$arr[0]['frequency2Type'],
|
||||
"graph1Data"=>$dataList1,
|
||||
"graph2Data"=>$dataList2
|
||||
);
|
||||
return $returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
105
workflow/engine/src/ProcessMaker/Services/Api/Catalog.php
Normal file
105
workflow/engine/src/ProcessMaker/Services/Api/Catalog.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Catalog Api Controller
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Catalog extends Api
|
||||
{
|
||||
/**
|
||||
* Get Catalog by cat_type
|
||||
*
|
||||
* @param string $cat_type {@from path}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:cat_type
|
||||
*
|
||||
*/
|
||||
public function doGetCatalogByType($cat_type)
|
||||
{
|
||||
try {
|
||||
$Catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
$response = $Catalog->getCatalogByType($cat_type);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPost($request_data)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
$arrayData = $catalog->create($request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url PUT /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doPut($cat_uid, $cat_type, $request_data)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
|
||||
$arrayData = $catalog->update($cat_uid, $cat_type, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDelete($cat_uid, $cat_type)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
|
||||
$arrayData = $catalog->delete($cat_uid, $cat_type);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
463
workflow/engine/src/ProcessMaker/Services/Api/Dashboard.php
Normal file
463
workflow/engine/src/ProcessMaker/Services/Api/Dashboard.php
Normal file
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Dashboard Api Controller
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Dashboard extends Api
|
||||
{
|
||||
/**
|
||||
* Get dashboards UID by user_uid
|
||||
*
|
||||
* @param string $usr_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /owner/:usr_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardsUidByUser($usr_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboardsUidByUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards data by user_uid
|
||||
*
|
||||
* @param string $usr_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /ownerData/:usr_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardsDataByUser($usr_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboardDataByUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get users by dashboards uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /users/:das_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardUsers($das_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getUsersOfDashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards data by uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardData($das_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards indicator by dasInd_uid
|
||||
*
|
||||
* @param string $dasInd_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /indicator/:dasInd_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardIndicator($dasInd_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getIndicator($dasInd_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards indicators by dashboardUid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
* @param string $dateIni {@from path}
|
||||
* @param string $dateFin {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid/indicator
|
||||
*
|
||||
*/
|
||||
public function doGetIndicatorsbyDasUid($das_uid, $dateIni="", $dateFin="")
|
||||
{
|
||||
try {
|
||||
$dateIni = ($dateIni=="") ? date("Y/m/d") : $dateIni;
|
||||
$dateFin = ($dateFin=="") ? date("Y/m/d") : $dateFin;
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getIndicatorsByDasUid($das_uid, $dateIni, $dateFin, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list Dashboards
|
||||
*
|
||||
* @param string $start {@from path}
|
||||
* @param string $limit {@from path}
|
||||
* @param string $sort {@from path}
|
||||
* @param string $dir {@from path}
|
||||
* @param string $search {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET
|
||||
*/
|
||||
public function doGetListDashboards(
|
||||
$start = 0,
|
||||
$limit = 0,
|
||||
$sort = 'DASHBOARD.DAS_TITLE',
|
||||
$dir = 'DESC',
|
||||
$search = ''
|
||||
) {
|
||||
try {
|
||||
$options['start'] = $start;
|
||||
$options['limit'] = $limit;
|
||||
$options['sort'] = $sort;
|
||||
$options['dir'] = $dir;
|
||||
$options['search'] = $search;
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->getListDashboards($options);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Owners by das_uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
* @param string $start {@from path}
|
||||
* @param string $limit {@from path}
|
||||
* @param string $search {@from path}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid/owners
|
||||
*
|
||||
*/
|
||||
public function doGetOwnersByDasUid(
|
||||
$das_uid,
|
||||
$start = 0,
|
||||
$limit = 0,
|
||||
$search = '')
|
||||
{
|
||||
try {
|
||||
$options['das_uid'] = $das_uid;
|
||||
$options['start'] = $start;
|
||||
$options['limit'] = $limit;
|
||||
$options['search'] = $search;
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->getOwnerByDasUid($options);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostDashboard($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createDashboard($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put dashboards configuration
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT
|
||||
*
|
||||
*/
|
||||
public function doPutDashboard($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createDashboard($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteDashboard($das_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->deletedashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /owner
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostOwner($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createOwner($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid/owner/:owner_uid
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
* @param string $owner_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteDashboardOwner($das_uid, $owner_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->deleteDashboardOwner($das_uid, $owner_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /indicator
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostIndicator($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createIndicator($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put Indicator
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /indicator
|
||||
*
|
||||
*/
|
||||
public function doPutIndicator($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createIndicator($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /indicator/:ind_uid
|
||||
*
|
||||
* @param string $ind_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteIndicator($ind_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->delete($ind_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post dashboards configuration by userUid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /config/
|
||||
*
|
||||
*/
|
||||
public function doPostDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$ConfigDashboards = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $ConfigDashboards->postConfigByUsr($request_data, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards configuration by usr_uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /config/
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardConfigActualUsr()
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getConfig($usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put dashboards configuration by usr_uid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /config
|
||||
*
|
||||
*/
|
||||
public function doPutDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$ConfigDashboards = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $ConfigDashboards->putConfigByUsr($request_data, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Calendar Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class ReportingIndicators extends Api
|
||||
{
|
||||
// /**
|
||||
// * Returns the aggregate Efficiency of a process or set of precesses
|
||||
// *
|
||||
// * @param string $process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /process-efficiency-index
|
||||
// */
|
||||
//
|
||||
// public function doGetProcessEfficiencyIndex($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
//
|
||||
// $response = $indicatorsObj->getProcessEfficiencyIndex($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
//
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param string $process_list {@from path}
|
||||
* @param string $init_date {@from path}
|
||||
* @param string $end_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /process-tasks
|
||||
*/
|
||||
public function doGetProcessTasksInfo($process_list, $init_date, $end_date, $language)
|
||||
{
|
||||
|
||||
if ($process_list == null || strlen($process_list) <= 1)
|
||||
throw new InvalidArgumentException ('process_list must have at least a value', 0);
|
||||
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$listArray = $listArray = explode(',', $process_list);
|
||||
$response = $indicatorsObj->getPeiTasksStatistics($listArray,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Returns the aggregate Efficiency of a employee or set of employees
|
||||
// *
|
||||
// * @param string $employee_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /employee-efficiency-index
|
||||
// */
|
||||
// public function doGetEmployeeEfficiencyIndex($employee_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($employee_list) > 1)
|
||||
// ? $listArray = explode(',', $employee_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getEmployeeEfficiencyIndex($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
// *
|
||||
// * @param string $employee_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $language {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /employee-tasks
|
||||
// */
|
||||
// public function doGetEmployeeTasksInfo($employee_list, $init_date, $end_date, $language)
|
||||
// {
|
||||
// if ($employee_list == null || strlen($employee_list) <= 1)
|
||||
// throw new InvalidArgumentException ('employee_list must have at least a value', 0);
|
||||
//
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = $listArray = explode(',', $employee_list);
|
||||
// $response = $indicatorsObj->getEmployeeTasksInfoList($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $language);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /percent-overdue-cases
|
||||
// */
|
||||
// public function doGetPercentOverdueByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentOverdueCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /percent-overdue-cases-history
|
||||
// */
|
||||
// public function doGetPercentOverdueByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentOverdueCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with New time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-new-cases
|
||||
// */
|
||||
// public function doGetTotalNewByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentNewCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with New time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-new-cases-history
|
||||
// */
|
||||
// public function doGetTotalNewByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentNewCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with Completed time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-completed-cases
|
||||
// */
|
||||
// public function doGetTotalCompletedByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentCompletedCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with Completed time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-completed-cases-history
|
||||
// */
|
||||
// public function doGetTotalCompletedByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentCompletedCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /process-efficiency-data
|
||||
*/
|
||||
public function doGetProcessEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getPeiCompleteData
|
||||
($indicator_uid,
|
||||
new \DateTime($measure_date),
|
||||
new \DateTime($compare_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /employee-efficiency-data
|
||||
*/
|
||||
public function doGetEmployeeEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getUeiCompleteData
|
||||
($indicator_uid,
|
||||
new \DateTime($measure_date),
|
||||
new \DateTime($compare_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /group-employee-data
|
||||
*/
|
||||
public function doGetGroupEmployeesData($group_uid, $init_date, $end_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getUeiGroupsStatistics
|
||||
($group_uid,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /general-indicator-data
|
||||
*/
|
||||
public function doGetGeneralIndicatorData ($indicator_uid, $init_date, $end_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getGeneralIndicatorStatistics
|
||||
($indicator_uid,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user