From ca88226069719154d7bbb2e0ea1c5bfb58d22af9 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Fri, 12 Oct 2012 14:20:39 -0400 Subject: [PATCH] BUG 9562 If it is the top level of department/manager then "Report To" assignment raises an error SOLVED - When user don't have the "Reports to" value throws a error message - Now when the "Reports to" value is empty use the User UID --- workflow/engine/classes/class.derivation.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index b050c21d7..ed26dfa38 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -445,18 +445,16 @@ class Derivation * @param string $USR_UID * @return string $aRow['USR_REPORTS_TO'] */ - function getDenpendentUser ($USR_UID) - { - //require_once 'classes/model/Users.php'; - //here the uid to next Users + function getDenpendentUser($USR_UID) { + //Here the uid to next user $oC = new Criteria(); - $oC->addSelectColumn( UsersPeer::USR_REPORTS_TO ); - $oC->add( UsersPeer::USR_UID, $USR_UID ); - $oDataset = UsersPeer::doSelectRS( $oC ); - $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $oC->addSelectColumn(UsersPeer::USR_REPORTS_TO); + $oC->add(UsersPeer::USR_UID, $USR_UID); + $oDataset = UsersPeer::doSelectRS($oC); + $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aRow = $oDataset->getRow(); - return $aRow['USR_REPORTS_TO']; + return $aRow['USR_REPORTS_TO'] != '' ? $aRow['USR_REPORTS_TO'] : $USR_UID; } /* setTasLastAssigned