PM-2398 El contador de listados en home muestran datos incorrectos
This commit is contained in:
@@ -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);
|
||||
@@ -4168,9 +4169,10 @@ class Cases
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$data = array (
|
||||
'APP_UID' => $sApplicationUID,
|
||||
'DEL_INDEX' => $iIndex,
|
||||
'USR_UID' => $user_logged
|
||||
'APP_UID' => $sApplicationUID,
|
||||
'DEL_INDEX' => $iIndex,
|
||||
'USR_UID' => $user_logged,
|
||||
'APP_STATUS_CURRENT' => $appStatusCurrent
|
||||
);
|
||||
$data = array_merge($aFields, $data);
|
||||
$oListCanceled = new ListCanceled();
|
||||
|
||||
@@ -104,9 +104,21 @@ class ListCanceled extends BaseListCanceled {
|
||||
$oListInbox->removeAll($data['APP_UID']);
|
||||
|
||||
$users = new Users();
|
||||
$users->refreshTotal($data['USR_UID'], 'removed', 'inbox');
|
||||
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 );
|
||||
|
||||
Reference in New Issue
Block a user