CS observations

This commit is contained in:
Paula Quispe
2017-07-24 15:12:11 -04:00
parent 9c52d6c440
commit 4d4aa1d9c8

View File

@@ -417,7 +417,7 @@ class ListUnassigned extends BaseListUnassigned
*/ */
public function getCountList($userUid, $filters = array()) public function getCountList($userUid, $filters = array())
{ {
$criteria = $criteria = new Criteria('workflow'); $criteria = new Criteria('workflow');
$this->getCriteriaWhereSelfService($criteria, $userUid); $this->getCriteriaWhereSelfService($criteria, $userUid);
$total = ListUnassignedPeer::doCount($criteria); $total = ListUnassignedPeer::doCount($criteria);
return (int)$total; return (int)$total;
@@ -441,14 +441,42 @@ class ListUnassigned extends BaseListUnassigned
//Load Self Service Value Based Assignment //Load Self Service Value Based Assignment
$firstRow = current($aSelfServiceValueBased); $firstRow = current($aSelfServiceValueBased);
$criterionAux = sprintf("((LIST_UNASSIGNED.APP_UID='%s' AND LIST_UNASSIGNED.DEL_INDEX=%d AND LIST_UNASSIGNED.TAS_UID='%s') ", $firstRow["APP_UID"], $firstRow["DEL_INDEX"], $firstRow["TAS_UID"]); $criterionAux = sprintf(
"((
LIST_UNASSIGNED.APP_UID='%s' AND
LIST_UNASSIGNED.DEL_INDEX=%d AND
LIST_UNASSIGNED.TAS_UID='%s'
) ",
$firstRow["APP_UID"],
$firstRow["DEL_INDEX"],
$firstRow["TAS_UID"]
);
foreach (array_slice($aSelfServiceValueBased, 1) as $value) { foreach (array_slice($aSelfServiceValueBased, 1) as $value) {
$criterionAux .= sprintf(" OR (LIST_UNASSIGNED.APP_UID='%s' AND LIST_UNASSIGNED.DEL_INDEX=%d AND LIST_UNASSIGNED.TAS_UID='%s') ", $value["APP_UID"], $value["DEL_INDEX"], $value["TAS_UID"]); $criterionAux .= sprintf(
" OR (
LIST_UNASSIGNED.APP_UID='%s' AND
LIST_UNASSIGNED.DEL_INDEX=%d AND
LIST_UNASSIGNED.TAS_UID='%s'
) ",
$value["APP_UID"],
$value["DEL_INDEX"],
$value["TAS_UID"]
);
} }
$criterionAux .= ")"; $criterionAux .= ")";
//And Load SelfService //And Load SelfService
$criteria->add( $criteria->add(
$criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $tasks, Criteria::IN)->addOr($criteria->getNewCriterion(ListUnassignedPeer::TAS_UID, $criterionAux, Criteria::CUSTOM)) $criteria->getNewCriterion(
ListUnassignedPeer::TAS_UID,
$tasks,
Criteria::IN
)->addOr(
$criteria->getNewCriterion(
ListUnassignedPeer::TAS_UID,
$criterionAux,
Criteria::CUSTOM
)
)
); );
} else { } else {
//Self Service //Self Service