PM-2398 El contador de listados en home muestran datos incorrectos

This commit is contained in:
Brayan Pereyra
2015-04-23 12:06:04 -04:00
parent b30275a36d
commit 52f0930b31
2 changed files with 18 additions and 4 deletions

View File

@@ -4100,6 +4100,7 @@ class Cases
$oApplication = new Application();
$aFields = $oApplication->load($sApplicationUID);
$appStatusCurrent = $aFields['APP_STATUS'];
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
@@ -4170,7 +4171,8 @@ class Cases
$data = array (
'APP_UID' => $sApplicationUID,
'DEL_INDEX' => $iIndex,
'USR_UID' => $user_logged
'USR_UID' => $user_logged,
'APP_STATUS_CURRENT' => $appStatusCurrent
);
$data = array_merge($aFields, $data);
$oListCanceled = new ListCanceled();

View File

@@ -104,9 +104,21 @@ class ListCanceled extends BaseListCanceled {
$oListInbox->removeAll($data['APP_UID']);
$users = new Users();
if (!empty($data['APP_STATUS_CURRENT']) && $data['APP_STATUS_CURRENT'] == 'DRAFT') {
$users->refreshTotal($data['USR_UID'], 'removed', 'draft');
} else {
$users->refreshTotal($data['USR_UID'], 'removed', 'inbox');
}
$users->refreshTotal($data['USR_UID'], 'add', 'canceled');
//Update - WHERE
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(ListParticipatedLastPeer::APP_UID, $data["APP_UID"], Criteria::EQUAL);
//Update - SET
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(ListParticipatedLastPeer::APP_STATUS, 'CANCELLED');
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
$con = Propel::getConnection( ListCanceledPeer::DATABASE_NAME );
try {
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );