styles corrections

This commit is contained in:
Dante
2015-04-20 10:52:16 -04:00
parent 9c81335aba
commit 1b247c89c3
8 changed files with 284 additions and 337 deletions

View File

@@ -18,7 +18,7 @@ class ReportingIndicators
*
* return decimal value
*/
public function getPeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
public function getPeiCompleteData($indicatorUid, $compareDate, $measureDate, $language)
{
G::loadClass('indicatorsCalculator');
$calculator = new \IndicatorsCalculator();
@@ -33,6 +33,7 @@ class ReportingIndicators
$retval = array(
"id" => $indicatorUid,
"efficiencyIndex" => $peiValue,
"efficiencyIndexCompare" => $peiCompare,
"efficiencyVariation" => ($peiValue-$peiCompare),
"inefficiencyCost" => $peiCost,
"data"=>$processes);
@@ -49,29 +50,17 @@ class ReportingIndicators
*
* return decimal value
*/
public function getUeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
public function getUeiCompleteData($indicatorUid, $compareDate, $measureDate,$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;
$ueiCost = current(reset($calculator->ueiCostHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
$ueiCompare = current(reset($calculator->ueiHistoric(null, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
$retval = array(

View File

@@ -71,223 +71,6 @@ class ReportingIndicators extends Api
}
}
// /**
// * 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
*
@@ -299,7 +82,7 @@ class ReportingIndicators extends Api
*
* @url GET /process-efficiency-data
*/
public function doGetProcessEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
public function doGetProcessEficciencyData($indicator_uid, $compare_date, $measure_date, $language)
{
try {
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
@@ -324,7 +107,7 @@ class ReportingIndicators extends Api
*
* @url GET /employee-efficiency-data
*/
public function doGetEmployeeEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
public function doGetEmployeeEficciencyData($indicator_uid, $compare_date, $measure_date, $language)
{
try {
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();