HOR-124 "(Cases List Backend) En la version community..." SOLVED

Issue:
    (Cases List Backend) En la version community el end point no devuelven los casos para mobile
Cause:
    No se considero la version community para el end-point light
Solution:
    Se agrego codigo para la version community para el end-point light

Fixes
This commit is contained in:
Victor Saisa Lopez
2016-01-27 16:42:40 -04:00
parent a99e0a7aa0
commit a07e08fe42
3 changed files with 173 additions and 47 deletions

View File

@@ -75,6 +75,50 @@ class Cases
}
}
/**
* Get list counters
*
* @param string $userUid Unique id of User
* @param array $arrayType Type lists
*
* @return array Return the list counters
*/
public function getListCounters($userUid, array $arrayType)
{
try {
$solrEnabled = false;
$solrConf = \System::solrEnv();
if ($solrConf !== false) {
$ApplicationSolrIndex = new \AppSolr(
$solrConf['solr_enabled'],
$solrConf['solr_host'],
$solrConf['solr_instance']
);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
$solrEnabled = true;
}
}
$appCacheView = new \AppCacheView();
if ($solrEnabled) {
$arrayListCounter = array_merge(
$ApplicationSolrIndex->getCasesCount($userUid),
$appCacheView->getAllCounters(['completed', 'cancelled'], $userUid)
);
} else {
$arrayListCounter = $appCacheView->getAllCounters($arrayType, $userUid);
}
//Return
return $arrayListCounter;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get list for Cases
*