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
Reference in New Issue
Block a user