function adhocAssignUsersk($params) { G::LoadClass('groups'); G::LoadClass('tasks'); $oTasks = new Tasks(); $aAux = $oTasks->getGroupsOfTask($_SESSION['TASK'], 2); $aAdhocUsers = array(); $oGroups = new Groups(); foreach ($aAux as $aGroup) { $aUsers = $oGroups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aUsers as $aUser) { if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) { $aAdhocUsers[] = $aUser['USR_UID']; } } } $aAux = $oTasks->getUsersOfTask($_SESSION['TASK'], 2); foreach ($aAux as $aUser) { if ($aUser['USR_UID'] != $_SESSION['USER_LOGGED']) { $aAdhocUsers[] = $aUser['USR_UID']; } } require_once 'classes/model/Users.php'; $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->add(UsersPeer::USR_UID, $aAdhocUsers, Criteria::IN); $oDataset = UsersPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $aData = array(); while ($oDataset->next()) { $aData[] = $oDataset->getRow(); } $this->data = $aData; }
/** * Return a list of adhoc assignees of an activity * * @param string $sProcessUID {@min 32} {@max 32} * @param string $sTaskUID {@min 32} {@max 32} * @param string $filter * @param int $start * @param int $limit * @param string $type * * return array * * @access public */ public function getTaskAdhocAssigneesAll($sProcessUID, $sTaskUID, $filter, $start, $limit, $type) { try { Validator::proUid($sProcessUID, '$prj_uid'); $this->validateActUid($sTaskUID); $aUsers = array(); $oTasks = new \Tasks(); $aAux = $oTasks->getGroupsOfTask($sTaskUID, 2); $aGroupUids = array(); foreach ($aAux as $aGroup) { $aGroupUids[] = $aGroup['GRP_UID']; } foreach ($aGroupUids as $results) { $oCriteria = new \Criteria('workflow'); $oCriteria->addSelectColumn('USR_UID'); $oCriteria->add(\GroupUserPeer::GRP_UID, $results); $oGroupDataset = \GroupUserPeer::doSelectRS($oCriteria); $oGroupDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); while ($oGroupDataset->next()) { $aGroupRow = $oGroupDataset->getRow(); $oGroupCriteria = new \Criteria('workflow'); $oGroupCriteria->addSelectColumn(\UsersPeer::USR_UID); $oGroupCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME); $oGroupCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME); $oGroupCriteria->addSelectColumn(\UsersPeer::USR_USERNAME); if ($filter != '') { $oGroupCriteria->add($oGroupCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%{$filter}%", \Criteria::LIKE)->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%{$filter}%", \Criteria::LIKE))->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%{$filter}%", \Criteria::LIKE))); } $oGroupCriteria->add(\UsersPeer::USR_UID, $aGroupRow["USR_UID"]); $oUserDataset = \UsersPeer::doSelectRS($oGroupCriteria); $oUserDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $oUserDataset->next(); while ($aUserRow = $oUserDataset->getRow()) { $aUsers[] = array('aas_uid' => $aUserRow['USR_UID'], 'aas_name' => $aUserRow['USR_FIRSTNAME'], 'aas_lastname' => $aUserRow['USR_LASTNAME'], 'aas_username' => $aUserRow['USR_USERNAME'], 'aas_type' => "user"); $oUserDataset->next(); } } } $oCriteria = new \Criteria('workflow'); $oCriteria->addSelectColumn(\UsersPeer::USR_UID); $oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME); $oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME); if ($filter != '') { $oCriteria->add($oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%{$filter}%", \Criteria::LIKE)->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%{$filter}%", \Criteria::LIKE))->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%{$filter}%", \Criteria::LIKE))); } $oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN); $oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID); $oCriteria->add(\TaskUserPeer::TU_TYPE, 2); $oCriteria->add(\TaskUserPeer::TU_RELATION, 1); $oDataset = \TaskUserPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($type == '' || $type == 'user') { $aUsers[] = array('aas_uid' => $aRow['USR_UID'], 'aas_name' => $aRow['USR_FIRSTNAME'], 'aas_lastname' => $aRow['USR_LASTNAME'], 'aas_username' => $aRow['USR_USERNAME'], 'aas_type' => "user"); } $oDataset->next(); } $aUsersGroups = array(); $exclude = array(""); for ($i = 0; $i <= count($aUsers) - 1; $i++) { if (!in_array(trim($aUsers[$i]["aas_uid"]), $exclude)) { $aUsersGroups[] = $aUsers[$i]; $exclude[] = trim($aUsers[$i]["aas_uid"]); } } if ($start) { if ($start < 0) { throw new \Exception(\G::LoadTranslation("ID_INVALID_START")); } } else { $start = 0; } if (isset($limit)) { if ($limit < 0) { throw new \Exception(\G::LoadTranslation("ID_INVALID_LIMIT")); } else { if ($limit == 0) { return array(); } } } else { $limit = count($aUsersGroups) + 1; } $aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit); return $aUsersGroups; } catch (\Exception $e) { throw $e; } }
/* @Author Erik Amaru Ortiz <*****@*****.**> */ case 'reassignByUserList': $APP_UIDS = explode(',', $_POST['APP_UIDS']); $sReassignFromUser = $_POST['FROM_USR_ID']; G::LoadClass('tasks'); G::LoadClass('groups'); G::LoadClass('case'); $oTasks = new Tasks(); $oGroups = new Groups(); $oUser = new Users(); $oCases = new Cases(); $aCasesList = array(); foreach ($APP_UIDS as $APP_UID) { $aCase = $oCases->loadCaseInCurrentDelegation($APP_UID, true); $aUsersInvolved = array(); $aCaseGroups = $oTasks->getGroupsOfTask($aCase['TAS_UID'], 1); foreach ($aCaseGroups as $aCaseGroup) { $aCaseUsers = $oGroups->getUsersOfGroup($aCaseGroup['GRP_UID']); foreach ($aCaseUsers as $aCaseUser) { if ($aCaseUser['USR_UID'] != $sReassignFromUser) { $aCaseUserRecord = $oUser->load($aCaseUser['USR_UID']); $aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']; // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')'; } } } $aCaseUsers = $oTasks->getUsersOfTask($aCase['TAS_UID'], 1); foreach ($aCaseUsers as $aCaseUser) { if ($aCaseUser['USR_UID'] != $sReassignFromUser) { $aCaseUserRecord = $oUser->load($aCaseUser['USR_UID']); $aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME'];
function getGrpUser ($aData) { G::LoadClass( 'groups' ); G::LoadClass( 'tasks' ); require_once 'classes/model/Content.php'; $oTasks = new Tasks(); $oGroups = new Groups(); $oContent = new Content(); $aGroup = array (); $aUsers = array (); $aGroup = $oTasks->getGroupsOfTask( $aData['ROU_NEXT_TASK'], 1 ); $aGrpUid = $aGroup[0]['GRP_UID']; $sGrpName = $oContent->load( 'GRP_TITLE', '', $aGrpUid, 'en' ); $aGrp['GRP_NAME'] = $sGrpName; $aGrp['GRP_UID'] = $aGrpUid; $aUsers = $oGroups->getUsersOfGroup( $aGroup[0]['GRP_UID'] ); foreach ($aUsers as $aKey => $userid) { $aData[$aKey] = $userid; } return $aGrp; }
public function getUsersToReassign($TAS_UID, $USR_UID, $PRO_UID=null) { G::LoadClass('groups'); G::LoadClass('tasks'); $oTasks = new Tasks(); $aAux = $oTasks->getGroupsOfTask($TAS_UID, 1); $row = array(); $groups = new Groups(); foreach ($aAux as $aGroup) { $aUsers = $groups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aUsers as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } } $aAux = $oTasks->getUsersOfTask($TAS_UID, 1); foreach ($aAux as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } // Group Ad Hoc $oTasks = new Tasks(); $aAux = $oTasks->getGroupsOfTask($TAS_UID, 2); $groups = new Groups(); foreach ($aAux as $aGroup) { $aUsers = $groups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aUsers as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } } // User Ad Hoc $aAux = $oTasks->getUsersOfTask($TAS_UID, 2); foreach ($aAux as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } global $RBAC; //Adding the actual user if this has the PM_SUPERVISOR permission assigned. if ($RBAC->userCanAccess('PM_SUPERVISOR') == 1) { if(!in_array($RBAC->aUserInfo['USER_INFO']['USR_UID'], $row)) { $row[] = $RBAC->aUserInfo['USER_INFO']['USR_UID']; } } $c = new Criteria('workflow'); $c->addSelectColumn(UsersPeer::USR_UID); $c->addSelectColumn(UsersPeer::USR_USERNAME); $c->addSelectColumn(UsersPeer::USR_FIRSTNAME); $c->addSelectColumn(UsersPeer::USR_LASTNAME); $c->add(UsersPeer::USR_UID, $row, Criteria::IN); $rs = UsersPeer::doSelectRs($c); $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rows = Array(); while ($rs->next()) { $rows[] = $rs->getRow(); } if ($PRO_UID != null) { //Add supervisor // Users $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(ProcessUserPeer::PU_UID); $oCriteria->addSelectColumn(ProcessUserPeer::USR_UID); $oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID); $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_USERNAME); $oCriteria->addSelectColumn(UsersPeer::USR_EMAIL); $oCriteria->addJoin(ProcessUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN); $oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR'); $oCriteria->add(ProcessUserPeer::PRO_UID, $PRO_UID); $oCriteria->add(ProcessUserPeer::USR_UID, $USR_UID); $oCriteria->addAscendingOrderByColumn(UsersPeer::USR_FIRSTNAME); $oDataset = ProcessUserPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $flagSupervisors = false; if ($oDataset->next()) { if (!in_array($USR_UID,$row)) { $rows[] = $oDataset->getRow(); } $flagSupervisors = true; } if (!$flagSupervisors) { // Groups $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(ProcessUserPeer::PU_UID); $oCriteria->addSelectColumn(ProcessUserPeer::USR_UID); $oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID); $oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_USERNAME); $oCriteria->addSelectColumn(UsersPeer::USR_EMAIL); $oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::GRP_UID, Criteria::LEFT_JOIN); $oCriteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN); $oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR'); $oCriteria->add(ProcessUserPeer::PRO_UID, $PRO_UID); $oCriteria->add(GroupUserPeer::USR_UID, $USR_UID); $oDataset = ProcessUserPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); if ($oDataset->next()) { if (!in_array($USR_UID,$row)) { $rows[] = $oDataset->getRow(); } } } } return $rows; }
/** * Send Message each user id * * @param array $request_data * @author Ronald Quenta <*****@*****.**> * */ public function routeCaseNotification($currentUserId, $processId, $currentTaskId, $appFields, $aTasks, $nextIndex) { try { $oUser = new \Users(); $aUser = $oUser->load( $currentUserId ); $response = array(); $task = new \Tasks(); $group = new \Groups(); foreach ($aTasks as $aTask) { $arrayTaskUser = array(); switch ($aTask["TAS_ASSIGN_TYPE"]) { case "SELF_SERVICE": if (isset($aTask["TAS_UID"]) && !empty($aTask["TAS_UID"])) { $arrayAux1 = $task->getGroupsOfTask($aTask["TAS_UID"], 1); foreach ($arrayAux1 as $arrayGroup) { $arrayAux2 = $group->getUsersOfGroup($arrayGroup["GRP_UID"]); foreach ($arrayAux2 as $arrayUser) { $arrayTaskUser[] = $arrayUser["USR_UID"]; } } $arrayAux1 = $task->getUsersOfTask($aTask["TAS_UID"], 1); foreach ($arrayAux1 as $arrayUser) { $arrayTaskUser[] = $arrayUser["USR_UID"]; } } break; default: if (isset($aTask["USR_UID"]) && !empty($aTask["USR_UID"])) { $arrayTaskUser = $aTask["USR_UID"]; } break; } // $oTask = new \Task(); // $currentTask = $oTask->load($aTask['TAS_UID']); $delIndex = null; foreach ($nextIndex as $nIndex) { if($aTask['TAS_UID'] == $nIndex['TAS_UID']){ $delIndex = $nIndex['DEL_INDEX']; break; } } $userIds = $arrayTaskUser; $message = '#'. $appFields['APP_NUMBER'] . ' : '.$appFields['APP_TITLE']; $data = array( 'processId' => $processId, 'taskId' => $aTask["TAS_UID"], 'caseId' => $appFields['APP_UID'], 'caseTitle' => $appFields['APP_TITLE'], 'delIndex' => $delIndex, 'typeList' => 'todo' ); if ($userIds) { $oNoti = new \NotificationDevice(); $devices = array(); if (is_array($userIds)){ foreach ($userIds as $id) { $deviceUser = $oNoti->loadByUsersId($id); $devices = array_merge($devices, $deviceUser); } } else { $devices = $oNoti->loadByUsersId($userIds); $lists = new \ProcessMaker\BusinessModel\Lists(); $counter = $lists->getCounters($userIds); $light = new \ProcessMaker\Services\Api\Light(); $result = $light->parserCountersCases($counter); $data['counters'] = $result; } $devicesAndroidIds = array(); $devicesAppleIds = array(); foreach ($devices as $dev) { switch ($dev['DEV_TYPE']) { case "apple": $devicesAppleIds[] = $dev['DEV_REG_ID']; break; case "android": $devicesAndroidIds[] = $dev['DEV_REG_ID']; break; } } if (count($devicesAppleIds) > 0) { $oNotification = new PushMessageIOS(); $oNotification->setSettingNotification(); $oNotification->setDevices($devicesAppleIds); $response['apple'] = $oNotification->send($message, $data); } if (count($devicesAndroidIds) > 0) { $oNotification = new PushMessageAndroid(); $oNotification->setSettingNotification(); $oNotification->setDevices($devicesAndroidIds); $response['android'] = $oNotification->send($message, $data); } } } } catch (\Exception $e) { throw new \Exception(\Api::STAT_APP_EXCEPTION, $e->getMessage()); } return $response; }
public function getExtusersadhoc($start, $limit, $sProcessUID = '', $sTaskUID = '') { try { $oProcess = new Process(); $aFields = $oProcess->load($sProcessUID); $oTask = new Task(); $aFields = $oTask->load($sTaskUID); $_SESSION['iType'] = 2; $aFields['TASK'] = $sTaskUID; $aFields['TYPE'] = $_SESSION['iType']; $aFields['OF_TO_ASSIGN'] = G::LoadTranslation('ID_DE_ASSIGN'); $aFields['CONFIRM'] = G::LoadTranslation('ID_MSG_CONFIRM_DEASIGN_USER_GROUP_MESSAGE'); $aFields['UIDS'] = "'0'"; $oTasks = new Tasks(); $oGroups = new Groups(); $aAux1 = $oTasks->getGroupsOfTask($sTaskUID, $_SESSION['iType']); foreach ($aAux1 as $aGroup) { $aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aAux2 as $aUser) { $aFields['UIDS'] .= ",'" . $aUser['USR_UID'] . "'"; } } global $G_PUBLISH; $G_PUBLISH = new Publisher(); $oTask = new Task(); $aTask = $oTask->load($sTaskUID); //$assignedUsers = getExtTaskUsersCriteria($sTaskUID, $_SESSION ['iType']); $this->getExtTaskUsersAdHocCriteria($start, $limit, $sTaskUID, $_SESSION['iType']); return $_SESSION['_DBArray']['taskUsers']; } catch (Exception $oError) { throw $oError; } }
public function getUsersToReassign($TAS_UID, $USR_UID) { G::LoadClass('groups'); G::LoadClass('tasks'); $oTasks = new Tasks(); $aAux = $oTasks->getGroupsOfTask($TAS_UID, 1); $row = array(); $groups = new Groups(); foreach ($aAux as $aGroup) { $aUsers = $groups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aUsers as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } } $aAux = $oTasks->getUsersOfTask($TAS_UID, 1); foreach ($aAux as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } $aAux = $oTasks->getUsersOfTask($TAS_UID, 2); foreach ($aAux as $aUser) { if ($aUser['USR_UID'] != $USR_UID) { $row[] = $aUser['USR_UID']; } } require_once 'classes/model/Users.php'; $c = new Criteria('workflow'); $c->addSelectColumn(UsersPeer::USR_UID); $c->addSelectColumn(UsersPeer::USR_USERNAME); $c->addSelectColumn(UsersPeer::USR_FIRSTNAME); $c->addSelectColumn(UsersPeer::USR_LASTNAME); $c->add(UsersPeer::USR_UID, $row, Criteria::IN); $rs = UsersPeer::doSelectRs($c); $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rows = array(); while ($rs->next()) { $rows[] = $rs->getRow(); } return $rows; }
list($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList('draft', $_GET['USR_UID']); if (ApplicationPeer::doCount($oCriteriaToDo) == 0 && ApplicationPeer::doCount($oCriteriaDraft) == 0) { } G::header('location: users_Delete?USR_UID=' . $USR_UID); $oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); while ($aRow = $oDataset->getRow()) { $c++; $oTemplatePower->newBlock('cases'); $aKeys = array_keys($aRow); foreach ($aKeys as $sKey) { $oTemplatePower->assign($sKey, $aRow[$sKey]); } $aUsers = array($_GET['USR_UID']); $aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1); foreach ($aAux1 as $aGroup) { $aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aAux2 as $aUser) { if (!in_array($aUser['USR_UID'], $aUsers)) { $aUsers[] = $aUser['USR_UID']; $aData = $oUser->load($aUser['USR_UID']); $oTemplatePower->newBlock('users'); $oTemplatePower->assign('USR_UID', $aUser['USR_UID']); $oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')'); } } } $aAux1 = $oTasks->getUsersOfTask($aRow['TAS_UID'], 1); foreach ($aAux1 as $aUser) { if (!in_array($aUser['USR_UID'], $aUsers)) {
// $APP_UIDS = explode(',', $_POST['APP_UID']); $appUid = isset($_POST['application']) ? $_POST['application'] : ''; // $processUid = isset($_POST['process']) ? $_POST['process'] : ''; $TaskUid = isset($_POST['task']) ? $_POST['task'] : ''; $sReassignFromUser = isset($_POST['currentUser']) ? $_POST['currentUser'] : ''; G::LoadClass('tasks'); G::LoadClass('groups'); G::LoadClass('case'); G::LoadClass('users'); $oTasks = new Tasks(); $oGroups = new Groups(); $oUser = new Users(); $oCases = new Cases(); $aCasesList = array(); $aUsersInvolved = array(); $aCaseGroups = $oTasks->getGroupsOfTask($TaskUid, 1); $oConf = new Configurations(); $ConfEnv = $oConf->getFormats(); foreach ($aCaseGroups as $aCaseGroup) { $aCaseUsers = $oGroups->getUsersOfGroup($aCaseGroup['GRP_UID']); foreach ($aCaseUsers as $aCaseUser) { if ($aCaseUser['USR_UID'] != $sReassignFromUser) { $aCaseUserRecord = $oUser->load($aCaseUser['USR_UID']); $sCaseUser = G::getFormatUserList($ConfEnv['format'], $aCaseUserRecord); // $aUsersInvolved[] = array ( 'userUid' => $aCaseUser['USR_UID'] , 'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')'; $aUsersInvolved[] = array('userUid' => $aCaseUser['USR_UID'], 'userFullname' => $sCaseUser); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')'; } } } $aCaseUsers = $oTasks->getUsersOfTask($TaskUid, 1);
public function getTaskUserSelfService($tas_uid, $appFields) { $oTask = new \Tasks(); $oGroup = new \Groups(); $taskNextDel = \TaskPeer::retrieveByPK($tas_uid); $arrayTaskUser = array(); if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") { // Self Service Value Based Assignment $nextTaskGroupVariable = trim($taskNextDel->getTasGroupVariable(), " @#"); if (isset($appFields["APP_DATA"][$nextTaskGroupVariable])) { $dataGroupVariable = $appFields["APP_DATA"][$nextTaskGroupVariable]; $dataGroupVariable = is_array($dataGroupVariable) ? $dataGroupVariable : trim($dataGroupVariable); if (!empty($dataGroupVariable) && is_array($dataGroupVariable)) { $arrayTaskUser[] = $dataGroupVariable; } elseif (!empty($dataGroupVariable)) { $arrayUsersOfGroup = $oGroup->getUsersOfGroup($dataGroupVariable); foreach ($arrayUsersOfGroup as $arrayUser) { $arrayTaskUser[] = $arrayUser["USR_UID"]; } } } } else { // Self Service $arrayGroupsOfTask = $oTask->getGroupsOfTask($tas_uid, 1); foreach ($arrayGroupsOfTask as $arrayGroup) { $arrayUsersOfGroup = $oGroup->getUsersOfGroup($arrayGroup["GRP_UID"]); foreach ($arrayUsersOfGroup as $arrayUser) { $arrayTaskUser[] = $arrayUser["USR_UID"]; } } $arrayUsersOfTask = $oTask->getUsersOfTask($tas_uid, 1); foreach ($arrayUsersOfTask as $arrayUser) { $arrayTaskUser[] = $arrayUser["USR_UID"]; } } return $arrayTaskUser; }