HOR-2542
[MANTIS - 21928] Process Supervisor error when a user is not assigned to all groups in Supervisor List
This commit is contained in:
@@ -97,21 +97,21 @@ class ProcessUser extends BaseProcessUser
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$oCriteria = new Criteria();
|
$oCriteria = new Criteria();
|
||||||
$oCriteria->add( ProcessUserPeer::PRO_UID, $proUid );
|
$oCriteria->add(ProcessUserPeer::PRO_UID, $proUid);
|
||||||
$oCriteria->add( ProcessUserPeer::PU_TYPE, 'SUPERVISOR' );
|
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||||
$oCriteria->add( ProcessUserPeer::USR_UID, $usrUid );
|
$oCriteria->add(ProcessUserPeer::USR_UID, $usrUid);
|
||||||
$dataset = ProcessUserPeer::doSelectRS( $oCriteria );
|
$dataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
//If the user is in Assigned supervisors list
|
//If the user is in Assigned supervisors list
|
||||||
if($dataset->next()){
|
if ($dataset->next()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
//If the user is in a group in Assigned supervisors list
|
//If the user is in a group in Assigned supervisors list
|
||||||
$oCriteria = new Criteria();
|
$oCriteria = new Criteria();
|
||||||
$oCriteria->add( ProcessUserPeer::PRO_UID, $proUid );
|
$oCriteria->add(ProcessUserPeer::PRO_UID, $proUid);
|
||||||
$oCriteria->add( ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||||
$dataset = ProcessUserPeer::doSelectRS( $oCriteria );
|
$dataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$oGroups = new Groups();
|
$oGroups = new Groups();
|
||||||
$aGroups = $oGroups->getActiveGroupsForAnUser($usrUid);
|
$aGroups = $oGroups->getActiveGroupsForAnUser($usrUid);
|
||||||
while ($dataset->next()) {
|
while ($dataset->next()) {
|
||||||
@@ -119,8 +119,6 @@ class ProcessUser extends BaseProcessUser
|
|||||||
$groupUid = $row['USR_UID'];
|
$groupUid = $row['USR_UID'];
|
||||||
if (in_array($groupUid, $aGroups)) {
|
if (in_array($groupUid, $aGroups)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user