Merged master into dashboards2

This commit is contained in:
Dante Loayza
2015-03-31 13:19:03 -04:00
47 changed files with 344 additions and 170 deletions

View File

@@ -26,14 +26,34 @@ class Light extends Api
public function countersCases ()
{
try {
$oMobile = new \ProcessMaker\BusinessModel\Light();
$counterCase = $oMobile->getCounterCase($this->getUserId());
$userId = $this->getUserId();
$lists = new \ProcessMaker\BusinessModel\Lists();
$response = $lists->getCounters($userId);
$result = $this->parserCountersCases($response);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
return $counterCase;
return $result;
}
public function parserCountersCases ($data)
{
$structure = array(
"CASES_INBOX" => "toDo",
"CASES_DRAFT" => "draft",
"CASES_CANCELLED" => "cancelled",
"CASES_SENT" => "participated",
"CASES_PAUSED" => "paused",
"CASES_COMPLETED" => "completed",
"CASES_SELFSERVICE" => "unassigned",
);
$response = array();
foreach ($data as $counterList) {
$name = $structure[$counterList['item']];
$response[$name] = $counterList['count'];
}
return $response;
}
/**
* Get list process start
* @return array

View File

@@ -60,7 +60,7 @@ class Activity extends Api
}
}
/*----------------------------------********---------------------------------*/
/**
* @param string $pro_uid {@min 32} {@max 32}
* @param string $tas_uid {@min 32} {@max 32}
@@ -76,6 +76,7 @@ class Activity extends Api
{
try {
$configurations = array();
/*----------------------------------********---------------------------------*/
/*** starts retrieval of action by emails configuration ***/
if (\PMLicensedFeatures
::getSingleton()
@@ -90,12 +91,13 @@ class Activity extends Api
$configurations[] = $actionsByEmailService->loadConfiguration($params);
}
/*** end retrieval of action by emails configuration ***/
/*----------------------------------********---------------------------------*/
return $configurations;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/*----------------------------------********---------------------------------*/
/**
* @param string $prj_uid {@min 32} {@max 32}