本文整理汇总了PHP中UsersPeer::doSelectRS方法的典型用法代码示例。如果您正苦于以下问题:PHP UsersPeer::doSelectRS方法的具体用法?PHP UsersPeer::doSelectRS怎么用?PHP UsersPeer::doSelectRS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsersPeer
的用法示例。
在下文中一共展示了UsersPeer::doSelectRS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmailEventAccounts
/**
* Get the email accounts of the current workspace
*
* return array
*/
public function getEmailEventAccounts()
{
try {
$criteria = new \Criteria("workflow");
$criteria->clearSelectColumns();
$criteria->addSelectColumn(\UsersPeer::USR_UID);
$criteria->addSelectColumn(\UsersPeer::USR_EMAIL);
$criteria->addAsColumn('UID', 'USR_UID');
$criteria->addAsColumn('EMAIL', 'USR_EMAIL');
$criteria->add(\UsersPeer::USR_STATUS, "ACTIVE");
$result = \UsersPeer::doSelectRS($criteria);
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$result->next();
$accountsArray = array();
while ($aRow = $result->getRow()) {
if (($aRow['USR_EMAIL'] != null) || ($aRow['USR_EMAIL'] != "")) {
$accountsArray[] = array_change_key_case($aRow, CASE_LOWER);
}
$result->next();
}
return $accountsArray;
} catch (\Exception $e) {
throw $e;
}
}
示例2: adhocAssignUsersk
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;
}
示例3: executeCron
//.........这里部分代码省略.........
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Manager
$plugin->clearManager($this->managersToClear);
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
// Delete manager assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete department assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::DEP_UID, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$this->dMoved += UsersPeer::doCount($criteriaWhere);
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
$rbac =& RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
// Delete manager assignments
$groupsInstance = new Groups();
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$users = array();
while ($row = $dataset->getRow()) {
$users[] = $row["USR_UID"];
$dataset->next();
}
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete group assignments
$criteria = new Criteria("workflow");
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
$this->gMoved += GroupUserPeer::doCount($criteria);
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"]);
$rbac =& RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
// Delete the managers that not exists in PM
$criteria = new Criteria("rbac");
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_USER_DN);
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, "", Criteria::NOT_EQUAL);
$dataset = RbacUsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$existingUsers = array();
示例4: getTaskAdhocAssigneesAll
/**
* 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);
//.........这里部分代码省略.........
示例5: newRow
public function newRow ($data, $delPreviusUsrUid, $isInitSubprocess = false, $dataPreviusApplication = array(), $isSelfService = false)
{
$removeList = true;
if (isset($data['REMOVED_LIST'])) {
$removeList = $data['REMOVED_LIST'];
unset($data['REMOVED_LIST']);
}
$data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
if (isset($data['DEL_TASK_DUE_DATE'])) {
$data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
}
$criteria = new Criteria();
$criteria->addSelectColumn( ApplicationPeer::APP_NUMBER );
$criteria->addSelectColumn( ApplicationPeer::APP_UPDATE_DATE );
$criteria->add( ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
$dataset = ApplicationPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data = array_merge($data, $aRow);
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];
$data['APP_PREVIOUS_USER'] = '';
if ($data['DEL_PREVIOUS_USR_UID'] != '') {
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
}
$users = new Users();
$criteria = new Criteria();
$criteria->addSelectColumn(SubApplicationPeer::DEL_INDEX_PARENT);
$criteria->add( SubApplicationPeer::APP_PARENT, $data['APP_UID'], Criteria::EQUAL );
$dataset = SubApplicationPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($dataset->next()) {
$aSub = $dataset->getRow();
if ($aSub['DEL_INDEX_PARENT'] == $data['DEL_PREVIOUS'] && !$isSelfService) {
$users->refreshTotal($data['USR_UID'], 'add', 'inbox');
self::create($data, $isSelfService);
return 1;
}
}
if (!$isInitSubprocess) {
if ($data['APP_STATUS'] == 'DRAFT') {
$users->refreshTotal($data['USR_UID'], 'add', 'draft');
} else {
$oRow = ApplicationPeer::retrieveByPK($data['APP_UID']);
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
if ($removeList) {
if ($data['DEL_INDEX'] == 2 || $aFields['APP_STATUS'] == 'DRAFT') {
$criteria = new Criteria();
$criteria->addSelectColumn(SubApplicationPeer::APP_UID);
//.........这里部分代码省略.........
示例6: create
/**
* Create List Paused Table
*
* @param type $data
* @return type
*
*/
public function create($data)
{
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
$criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_INDEX'], Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['USR_UID'] = isset($data['USR_UID']) ? $data['USR_UID'] : $aRow['USR_UID'];
$data['TAS_UID'] = $aRow['TAS_UID'];
$data['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE'];
$data['DEL_DUE_DATE'] = $aRow['DEL_TASK_DUE_DATE'];
$data['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE'];
$delPrevious = $aRow['DEL_PREVIOUS'];
$criteria = new Criteria();
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
$criteria->add( AppDelegationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( AppDelegationPeer::DEL_INDEX, $delPrevious, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_PREVIOUS_USR_UID'] = $aRow['USR_UID'];
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
$data['APP_PAUSED_DATE'] = Date("Y-m-d H:i:s");
//.........这里部分代码省略.........
示例7: create
/**
* Create List Completed Table
*
* @param type $data
* @return type
*
*/
public function create($data)
{
$criteria = new Criteria();
$criteria->addSelectColumn(ListCompletedPeer::APP_UID);
$criteria->add( ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
$dataset = ListCompletedPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($dataset->next()) {
return 1;
}
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add( ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL );
$criteria->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL );
$criteria->add( ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL );
$dataset = ContentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME'];
$data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
$data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
$data['DEL_PREVIOUS'] = isset($data['DEL_PREVIOUS']) ? $data['DEL_PREVIOUS'] : "";
if ($data['DEL_PREVIOUS'] != 0) {
$criteria = new Criteria();
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
$criteria->add( AppDelegationPeer::DEL_INDEX, $data['DEL_PREVIOUS'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
$data['DEL_PREVIOUS_USR_UID'] = $aRow['USR_UID'];
}
//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, 'COMPLETED');
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
$users = new Users();
$users->refreshTotal($data['USR_UID'], 'add', 'completed');
if ($data['DEL_PREVIOUS'] != 0) {
$criteria = new Criteria();
$criteria->addSelectColumn(TaskPeer::TAS_TYPE);
$criteria->add( TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL );
$dataset = TaskPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
if ($aRow['TAS_TYPE'] != 'SUBPROCESS') {
$users->refreshTotal($data['USR_UID'], 'remove', 'inbox');
}
//.........这里部分代码省略.........
示例8: getDenpendentUser
function getDenpendentUser($USR_UID)
{
//require_once 'classes/model/Users.php';
//here the uid to next Users
$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);
$oDataset->next();
$aRow = $oDataset->getRow();
return $aRow['USR_REPORTS_TO'];
}
示例9: refresh
/**
* Refresh List Participated Last
*
* @param type $seqName
* @return type
* @throws type
*
*/
public function refresh ($data, $isSelfService = false)
{
$data['APP_STATUS'] = (empty($data['APP_STATUS'])) ? 'TO_DO' : $data['APP_STATUS'];
if (!$isSelfService) {
if ($data["USR_UID"] == "") {
return;
}
$criteria = new Criteria();
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->add( UsersPeer::USR_UID, $data['USR_UID'], Criteria::EQUAL );
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
//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::DEL_CURRENT_USR_USERNAME, $aRow['USR_USERNAME']);
$criteriaSet->add(ListParticipatedLastPeer::DEL_CURRENT_USR_FIRSTNAME, $aRow['USR_FIRSTNAME']);
$criteriaSet->add(ListParticipatedLastPeer::DEL_CURRENT_USR_LASTNAME, $aRow['USR_LASTNAME']);
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
}
$this->update($data);
}
示例10: getUsers
/**
* Get all Users of a Group
*
* @param string $option Option (USERS, AVAILABLE-USERS)
* @param string $groupUid Unique id of Group
* @param array $arrayFilterData Data of the filters
* @param string $sortField Field name to sort
* @param string $sortDir Direction of sorting (ASC, DESC)
* @param int $start Start
* @param int $limit Limit
*
* return array Return an array with all Users of a Group
*/
public function getUsers($option, $groupUid, $arrayFilterData = null, $sortField = null, $sortDir = null, $start = null, $limit = null)
{
try {
$arrayUser = array();
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
//Get data
if (!is_null($limit) && $limit . "" == "0") {
return $arrayUser;
}
//SQL
switch ($option) {
case "SUPERVISOR":
$flagPermission = true;
//Criteria for Supervisor
$criteria = $this->getUserCriteria($groupUid, $arrayFilterData);
break;
case "USERS":
//Criteria
$criteria = $this->getUserCriteria($groupUid, $arrayFilterData);
break;
case "AVAILABLE-USERS":
//Get Uids
$arrayUid = array();
$criteria = $this->getUserCriteria($groupUid);
$rsCriteria = \UsersPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUid[] = $row["USR_UID"];
}
//Criteria
$criteria = $this->getUserCriteria("", $arrayFilterData, $arrayUid);
break;
}
//SQL
if (!is_null($sortField) && trim($sortField) != "") {
$sortField = strtoupper($sortField);
if (in_array($sortField, array("USR_UID", "USR_USERNAME", "USR_FIRSTNAME", "USR_LASTNAME", "USR_EMAIL", "USR_STATUS"))) {
$sortField = \UsersPeer::TABLE_NAME . "." . $sortField;
} else {
$sortField = \UsersPeer::USR_USERNAME;
}
} else {
$sortField = \UsersPeer::USR_USERNAME;
}
if (!is_null($sortDir) && trim($sortDir) != "" && strtoupper($sortDir) == "DESC") {
$criteria->addDescendingOrderByColumn($sortField);
} else {
$criteria->addAscendingOrderByColumn($sortField);
}
if (!is_null($start)) {
$criteria->setOffset((int) $start);
}
if (!is_null($limit)) {
$criteria->setLimit((int) $limit);
}
$rsCriteria = \UsersPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if (isset($flagPermission) && $flagPermission) {
\G::LoadSystem('rbac');
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$aPermissions = $this->loadUserRolePermission("PROCESSMAKER", $row['USR_UID']);
$bInclude = false;
foreach ($aPermissions as $aPermission) {
if ($aPermission['PER_CODE'] == 'PM_SUPERVISOR') {
$bInclude = true;
}
}
if ($bInclude) {
$arrayUser[] = $this->getUserDataFromRecord($row);
}
}
} else {
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayUser[] = $this->getUserDataFromRecord($row);
}
}
//Return
return $arrayUser;
} catch (\Exception $e) {
throw $e;
}
//.........这里部分代码省略.........
示例11: buildData
function buildData()
{
require_once "classes/model/Users.php";
G::LoadClass("serverConfiguration");
G::LoadClass("system");
$oServerConf =& serverConf::getSingleton();
$os = '';
if (file_exists('/etc/redhat-release')) {
$fnewsize = filesize('/etc/redhat-release');
$fp = fopen('/etc/redhat-release', 'r');
$os = trim(fread($fp, $fnewsize));
fclose($fp);
}
$os .= " (" . PHP_OS . ")";
$params = array();
$params['ip'] = getenv('SERVER_ADDR');
$oServerConf->setHeartbeatProperty('HB_BEAT_INDEX', intval($oServerConf->getHeartbeatProperty('HB_BEAT_INDEX', 'HEART_BEAT_CONF')) + 1, 'HEART_BEAT_CONF');
$params['index'] = $oServerConf->getHeartbeatProperty('HB_BEAT_INDEX', 'HEART_BEAT_CONF');
//$this->index;
$params['beatType'] = is_null($oServerConf->getHeartbeatProperty('HB_BEAT_TYPE', 'HEART_BEAT_CONF')) ? "starting" : $oServerConf->getHeartbeatProperty('HB_BEAT_TYPE', 'HEART_BEAT_CONF');
//1;//$this->beatType;
$params['date'] = date('Y-m-d H:i:s');
$params['host'] = getenv('SERVER_NAME');
$params['os'] = $os;
$params['webserver'] = getenv('SERVER_SOFTWARE');
$params['php'] = phpversion();
$params['pmVersion'] = System::getVersion();
if (class_exists('pmLicenseManager')) {
$params['pmProduct'] = 'PMEE';
} else {
$params['pmProduct'] = 'PMCE';
}
$params['logins'] = $oServerConf->logins;
$params['workspaces'] = serialize($oServerConf->getWSList());
$params['plugins'] = serialize($oServerConf->getPluginsList());
$params['dbVersion'] = $oServerConf->getDBVersion();
//$params ['errors'] = serialize( $oServerConf->errors );
if ($licInfo = $oServerConf->getProperty('LICENSE_INFO')) {
$params['license'] = serialize($licInfo);
}
///////
$criteria = new Criteria("workflow");
$criteria->addSelectColumn("COUNT(USERS.USR_UID) AS USERS_NUMBER");
$criteria->add(UsersPeer::USR_UID, null, Criteria::ISNOTNULL);
$rs = UsersPeer::doSelectRS($criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$params["users"] = $row["USERS_NUMBER"];
///////
$ee = null;
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION")) {
$ee = trim(file_get_contents(PATH_PLUGINS . "enterprise" . PATH_SEP . "VERSION"));
} else {
$pluginRegistry =& PMPluginRegistry::getSingleton();
$details = $pluginRegistry->getPluginDetails("enterprise.php");
$ee = !($details == null) ? $details->iVersion : null;
}
$params["ee"] = $ee;
///////
$addonNumber = 0;
$addonEnabledNumber = 0;
$pluginRegistry =& PMPluginRegistry::getSingleton();
$arrayAddon = array();
if (file_exists(PATH_DATA_SITE . "ee")) {
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
$arrayAddon["enterprise"] = array("sFilename" => "enterprise-1.tar");
}
foreach ($arrayAddon as $addon) {
$sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-"));
if (file_exists(PATH_PLUGINS . $sFileName . ".php")) {
$addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php");
$enabled = 0;
if ($addonDetails) {
$enabled = $addonDetails->enabled ? 1 : 0;
}
if ($enabled == 1) {
$addonEnabledNumber = $addonEnabledNumber + 1;
}
$addonNumber = $addonNumber + 1;
}
}
$params["addonNumber"] = $addonNumber;
$params["addonEnabledNumber"] = $addonEnabledNumber;
///////
$licenseID = null;
$licenseType = null;
$licenseDomainWorkspace = null;
$licenseNumber = 0;
if (file_exists(PATH_PLUGINS . "enterprise" . PATH_SEP . "class.pmLicenseManager.php")) {
$licenseManager =& pmLicenseManager::getSingleton();
preg_match("/^license_(.*).dat\$/", $licenseManager->file, $matches);
$licenseID = $matches[1];
$licenseType = $licenseManager->type;
$licenseDomainWorkspace = $licenseManager->info["DOMAIN_WORKSPACE"];
///////
$criteria = new Criteria("workflow");
$criteria->addSelectColumn("COUNT(LICENSE_MANAGER.LICENSE_UID) AS LICENSE_NUMBER");
$criteria->add(LicenseManagerPeer::LICENSE_UID, null, Criteria::ISNOTNULL);
$rs = LicenseManagerPeer::doSelectRS($criteria);
//.........这里部分代码省略.........
示例12: getUsers
//.........这里部分代码省略.........
$criteria->add(
$criteria->getNewCriterion(\UsersPeer::USR_USERNAME, $search, \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, $search, \Criteria::LIKE))->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_LASTNAME, $search, \Criteria::LIKE))
);
}
$criteria->add(\UsersPeer::USR_STATUS, "ACTIVE", \Criteria::EQUAL);
//Number records total
$criteriaCount = clone $criteria;
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn("COUNT(" . \UsersPeer::USR_UID . ") AS NUM_REC");
$rsCriteriaCount = \UsersPeer::doSelectRS($criteriaCount);
$rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$result = $rsCriteriaCount->next();
$row = $rsCriteriaCount->getRow();
$numRecTotal = (int)($row["NUM_REC"]);
//Query
if (!is_null($sortField) && trim($sortField) != "") {
$sortField = strtoupper($sortField);
if (in_array(\UsersPeer::TABLE_NAME . "." . $sortField, $criteria->getSelectColumns())) {
$sortField = \UsersPeer::TABLE_NAME . "." . $sortField;
} else {
$sortField = \UsersPeer::USR_FIRSTNAME;
}
示例13: enterpriseSystemUpdate
public function enterpriseSystemUpdate($data)
{
if (count(glob(PATH_DATA_SITE . 'license/*.dat')) == 0) {
return;
}
require_once "classes/model/Users.php";
$user = $data;
$criteria = new Criteria("workflow");
//SELECT
$criteria->addSelectColumn(UsersPeer::USR_UID);
//FROM
//WHERE
$criteria->add(UsersPeer::USR_USERNAME, $user->lName);
//$user->lPassword
$criteria->add(UsersPeer::USR_ROLE, "PROCESSMAKER_ADMIN");
//query
$rsSQLUSR = UsersPeer::doSelectRS($criteria);
$rsSQLUSR->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$sw = 0;
if (UsersPeer::doCount($criteria) > 0) {
//if ($rsSQLUSR->getRecordCount() > 0) {
$sw = 1;
}
/*
$cnn = Propel::getConnection("workflow");
$stmt = $cnn->createStatement();
$sql = "SELECT USR.USR_UID
FROM USERS AS USR
WHERE USR.USR_USERNAME = '" . $user->lName . "' AND USR.USR_ROLE = 'PROCESSMAKER_ADMIN'";
$rsSQLUSR = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$sw = 0;
if ($rsSQLUSR->getRecordCount() > 0) {
$sw = 1;
}
*/
if ($sw == 1) {
//Upgrade available
$swUpgrade = 0;
$addonList = AddonsStore::addonList();
$addon = $addonList["addons"];
if (count($addon) > 0) {
$status = array("ready", "upgrade", "available");
$pmVersion = EnterpriseUtils::pmVersion(PM_VERSION);
foreach ($addon as $index => $value) {
if ($addon[$index]["id"] == "processmaker") {
if (version_compare($pmVersion . "", EnterpriseUtils::pmVersion($addon[$index]["version"]) . "", "<")) {
$swUpgrade = 1;
break;
}
} else {
if (in_array($addon[$index]["status"], $status)) {
$swUpgrade = 1;
break;
}
}
}
}
if ($swUpgrade == 1) {
$_SESSION["__ENTERPRISE_SYSTEM_UPDATE__"] = 1;
}
}
}
示例14: getUsers
/**
* Get all Users
*
* @param string $filter
* @param int $start
* @param int $limit
*
* return array Return an array with all Users
*/
public function getUsers($filter, $start, $limit)
{
try {
$aUserInfo = array();
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
$oCriteria = $this->getUserCriteria();
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 ) ) );
}
if ($start) {
if ($start < 0) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_START"));
} else {
$oCriteria->setOffset($start);
}
}
if ($limit != '') {
if ($limit < 0) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_LIMIT"));
} else {
if ($limit == 0) {
return $aUserInfo;
} else {
$oCriteria->setLimit($limit);
}
}
}
$oCriteria->add(\UsersPeer::USR_STATUS, "ACTIVE", \Criteria::EQUAL);
$oDataset = \UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$aRow1 = array_change_key_case($aRow1, CASE_LOWER);
$aUserInfo[] = $aRow1;
}
//Return
return $aUserInfo;
} catch (\Exception $e) {
throw $e;
//.........这里部分代码省略.........
示例15: getAvailableProcessSupervisors
/**
* Return available supervisors
* @param string $obj_type
* @param string $sProcessUID
*
* @return array
*
* @access public
*/
public function getAvailableProcessSupervisors($obj_type, $sProcessUID = '')
{
try {
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Roles.php");
$aRespLi = array();
$aRespLiGroups = array();
$userRole = new \ProcessMaker\BusinessModel\User();
// Groups
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\ProcessUserPeer::USR_UID);
$oCriteria->addSelectColumn(\ProcessUserPeer::PU_TYPE);
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
$oCriteria->add(\ProcessUserPeer::PU_TYPE, '%SUPERVISOR%', \Criteria::LIKE);
$oDataset = \ProcessUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aUIDS = array();
$aGRUS = array();
while ($aRow = $oDataset->getRow()) {
if ($aRow['PU_TYPE'] == 'SUPERVISOR') {
$aUIDS [] = $aRow ['USR_UID'];
} else {
$aGRUS [] = $aRow ['USR_UID'];
}
$oDataset->next();
}
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\GroupwfPeer::GRP_UID);
$oCriteria->addAsColumn('GRP_TITLE', \ContentPeer::CON_VALUE);
$aConditions [] = array(\GroupwfPeer::GRP_UID, \ContentPeer::CON_ID);
$aConditions [] = array(\ContentPeer::CON_CATEGORY, \DBAdapter::getStringDelimiter() . 'GRP_TITLE' . \DBAdapter::getStringDelimiter());
$aConditions [] = array(\ContentPeer::CON_LANG, \DBAdapter::getStringDelimiter() . SYS_LANG . \DBAdapter::getStringDelimiter());
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\GroupwfPeer::GRP_UID, $aGRUS, \Criteria::NOT_IN);
$oCriteria->addAscendingOrderByColumn(\ContentPeer::CON_VALUE);
$oDataset = \GroupwfPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
if ($obj_type == 'group' || $obj_type == '') {
while ($aRow = $oDataset->getRow()) {
$group = new \ProcessMaker\BusinessModel\Group();
$userGroup = $group->getUsers('USERS', $aRow['GRP_UID']);
foreach ($userGroup as $value) {
$permission = $userRole->loadUserRolePermission('PROCESSMAKER', $value["USR_UID"]);
foreach ($permission as $values) {
if ($values["PER_CODE"] == 'PM_SUPERVISOR') {
$aRespLiGroups[] = array('grp_uid' => $aRow['GRP_UID'],
'grp_name' => $aRow['GRP_TITLE'],
'obj_type' => "group");
}
}
}
$oDataset->next();
}
}
$exclude = array("");
for ($i = 0; $i<=count($aRespLiGroups)-1; $i++) {
if (!in_array(trim($aRespLiGroups[$i]["grp_uid"]) ,$exclude)) {
$aRespLi[] = $aRespLiGroups[$i];
$exclude[] = trim($aRespLiGroups[$i]["grp_uid"]);
}
}
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
$oCriteria->addSelectColumn(\UsersPeer::USR_ROLE);
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS, \Criteria::NOT_IN);
$oDataset = \UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aUIDS = array();
while ($aRow = $oDataset->getRow()) {
$permission = $userRole->loadUserRolePermission('PROCESSMAKER', $aRow['USR_UID']);
foreach ($permission as $key => $value) {
if ($value["PER_CODE"] == 'PM_SUPERVISOR') {
$aUIDS [] = $aRow ['USR_UID'];
}
}
$oDataset->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);
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS, \Criteria::IN);
$oCriteria->addAscendingOrderByColumn(\UsersPeer::USR_FIRSTNAME);
$oCriteria->add(\UsersPeer::USR_STATUS, 'ACTIVE');
$oDataset = \UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
//.........这里部分代码省略.........