PMCORE-3395

This commit is contained in:
Paula Quispe
2021-10-04 17:22:39 -04:00
parent 2c6b35ecd1
commit b7155ab792

View File

@@ -46,7 +46,8 @@ class Metrics extends Api
*/ */
public function getProcessTotalCases($caseList, $category = null, $topTen = false, $processes = []) public function getProcessTotalCases($caseList, $category = null, $topTen = false, $processes = [])
{ {
$usrId = $this->getUserId(); $usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
try { try {
switch ($caseList) { switch ($caseList) {
case 'inbox': case 'inbox':
@@ -60,6 +61,7 @@ class Metrics extends Api
break; break;
case 'unassigned': case 'unassigned':
$list = new Unassigned(); $list = new Unassigned();
$list->setUserUid($usrUid);
break; break;
} }
$list->setUserId($usrId); $list->setUserId($usrId);
@@ -89,7 +91,8 @@ class Metrics extends Api
*/ */
public function getTotalCasesByRange($caseList, $processId = null, $dateFrom = null, $dateTo = null, $groupBy = 'day') public function getTotalCasesByRange($caseList, $processId = null, $dateFrom = null, $dateTo = null, $groupBy = 'day')
{ {
$usrId = $this->getUserId(); $usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
try { try {
switch ($caseList) { switch ($caseList) {
case 'inbox': case 'inbox':
@@ -103,6 +106,7 @@ class Metrics extends Api
break; break;
case 'unassigned': case 'unassigned':
$list = new Unassigned(); $list = new Unassigned();
$list->setUserUid($usrUid);
break; break;
} }
$list->setUserId($usrId); $list->setUserId($usrId);
@@ -179,7 +183,8 @@ class Metrics extends Api
public function getCasesRiskByProcess($caseList = 'inbox', $process, $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null) public function getCasesRiskByProcess($caseList = 'inbox', $process, $dateFrom = null, $dateTo = null, $riskStatus = 'ON_TIME', $topCases = null)
{ {
try { try {
$usrId = $this->getUserId(); $usrUid = $this->getUserId();
$usrId = !empty($usrUid) ? User::getId($usrUid) : 0;
switch ($caseList) { switch ($caseList) {
case 'inbox': case 'inbox':
$list = new Inbox(); $list = new Inbox();
@@ -192,6 +197,7 @@ class Metrics extends Api
break; break;
case 'unassigned': case 'unassigned':
$list = new Unassigned(); $list = new Unassigned();
$list->setUserUid($usrUid);
break; break;
} }
$list->setUserId($usrId); $list->setUserId($usrId);