BUG 7338 User profile "Replaced by" doesn't work when PM derivate a case. SLOVED

- The user A will be on vacation, then I update A's profile and set "Replaced by" to user B, set "Status" as Inactive or On vacation.
- Adjustment to the user to derivate.
This commit is contained in:
Hector Cortez
2012-10-10 17:13:17 -04:00
parent fc1fd9bf3d
commit 5ff3c0002e
3 changed files with 18 additions and 2 deletions

View File

@@ -256,7 +256,7 @@ class Derivation
$cGrp->add( GroupUserPeer::GRP_UID, $row['USR_UID'] );
$cGrp->addJoin( GroupUserPeer::GRP_UID, GroupwfPeer::GRP_UID, Criteria::LEFT_JOIN );
$cGrp->addJoin( GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN );
$cGrp->add( UsersPeer::USR_STATUS, 'ACTIVE' );
$cGrp->add( UsersPeer::USR_STATUS, 'INACTIVE', Criteria::NOT_EQUAL );
$rsGrp = GroupUserPeer::DoSelectRs( $cGrp );
$rsGrp->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rsGrp->next();
@@ -298,7 +298,8 @@ class Derivation
$aUsersData = array ();
if (is_array( $aUsers )) {
foreach ($aUsers as $key => $val) {
$userFields = $oUser->load( $val );
// $userFields = $oUser->load( $val );
$userFields = $oUser->userVacation( $val );
$auxFields['USR_UID'] = $userFields['USR_UID'];
$auxFields['USR_USERNAME'] = $userFields['USR_USERNAME'];
$auxFields['USR_FIRSTNAME'] = $userFields['USR_FIRSTNAME'];

View File

@@ -398,6 +398,20 @@ public function userExists($UsrUid)
return $result;
}
public function userVacation($UsrUid = "")
{
$aFields = array();
do {
if ($UsrUid != ""){
$aFields = $this->load($UsrUid);
$UsrUid = $aFields['USR_REPLACED_BY'];
} else {
break;
}
} while ($aFields['USR_STATUS'] != 'ACTIVE');
return $aFields;
}
} // Users
?>

View File

@@ -1239,6 +1239,7 @@ function loadUserData()
comboReplacedBy.store.on("load", function (store) {
comboReplacedBy.setValue(data.user.USR_REPLACED_BY);
comboReplacedBy.setRawValue(data.user.REPLACED_NAME);
});
comboCalendar.store.on("load", function (store) {