HOR-1447
Cambiar la lógica para obtener los contadores HOR-1447 Cambiar la lógica para obtener los contadores
This commit is contained in:
@@ -306,5 +306,18 @@ class ListCanceled extends BaseListCanceled {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListCanceledPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListCanceledPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
} // ListCanceled
|
||||
|
||||
|
||||
@@ -320,5 +320,18 @@ class ListCompleted extends BaseListCompleted
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListCompletedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListCompletedPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
} // ListCompleted
|
||||
|
||||
|
||||
@@ -598,5 +598,24 @@ class ListInbox extends BaseListInbox
|
||||
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @param string $appStatus
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $appStatus = 'DRAFT')
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if ($appStatus == 'TO_DO') {
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL);
|
||||
} else {
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'DRAFT', Criteria::EQUAL);
|
||||
}
|
||||
$total = ListInboxPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -405,5 +405,18 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListParticipatedLastPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -328,5 +328,18 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $usrUid
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListPausedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
$total = ListPausedPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
} // ListPaused
|
||||
|
||||
|
||||
@@ -460,5 +460,45 @@ class ListUnassigned extends BaseListUnassigned
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* @param $userUid
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($userUid)
|
||||
{
|
||||
$criteria = new Criteria('workflow');
|
||||
$tasks = $this->getSelfServiceTasks($userUid);
|
||||
$arrayAppAssignSelfServiceValueData = $this->getSelfServiceCasesByEvaluate($userUid);
|
||||
|
||||
if (!empty($arrayAppAssignSelfServiceValueData)) {
|
||||
//Self Service Value Based Assignment
|
||||
$criterionAux = null;
|
||||
|
||||
foreach ($arrayAppAssignSelfServiceValueData as $value) {
|
||||
if (is_null($criterionAux)) {
|
||||
$criterionAux = $criteria->getNewCriterion(ListUnassignedPeer::APP_UID, $value["APP_UID"], Criteria::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::DEL_INDEX, $value["DEL_INDEX"], Criteria::EQUAL))->addAnd(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $value["TAS_UID"], Criteria::EQUAL));
|
||||
} else {
|
||||
$criterionAux = $criteria->getNewCriterion(ListUnassignedPeer::APP_UID, $value["APP_UID"], Criteria::EQUAL)->addAnd(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::DEL_INDEX, $value["DEL_INDEX"], Criteria::EQUAL))->addAnd(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $value["TAS_UID"], Criteria::EQUAL))->addOr(
|
||||
$criterionAux
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$criteria->add(
|
||||
$criterionAux->addOr($criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $tasks, Criteria::IN))
|
||||
);
|
||||
} else {
|
||||
//Self Service
|
||||
$criteria->add(ListUnassignedPeer::TAS_UID, $tasks, Criteria::IN);
|
||||
}
|
||||
$total = ListUnassignedPeer::doCount($criteria);
|
||||
return (int)$total;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user