• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getRoleUsers函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getRoleUsers函数的典型用法代码示例。如果您正苦于以下问题:PHP getRoleUsers函数的具体用法?PHP getRoleUsers怎么用?PHP getRoleUsers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getRoleUsers函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getStdOutput

/** gives the role info, role profile info and role user info details in an array  for the specified role id
 * @param $roleid -- role id:: Type integer
 * @returns $return_data -- array contains role info, role profile info and role user info. This array is used to construct the detail view for the specified role id :: Type varchar
 *
 */
function getStdOutput($roleid)
{
    //Retreiving the related vtiger_profiles
    $roleProfileArr = getRoleRelatedProfiles($roleid);
    //Retreving the related vtiger_users
    $roleUserArr = getRoleUsers($roleid);
    //Constructing the Profile list
    $profileinfo = array();
    foreach ($roleProfileArr as $profileId => $profileName) {
        $profileinfo[] = $profileId;
        $profileinfo[] = $profileName;
        $profileList .= '<a href="index.php?module=Settings&action=profilePrivileges&profileid=' . $profileId . '">' . $profileName . '</a>';
    }
    $profileinfo = array_chunk($profileinfo, 2);
    //Constructing the Users List
    $userinfo = array();
    foreach ($roleUserArr as $userId => $userName) {
        $userinfo[] = $userId;
        $userinfo[] = $userName;
        $userList .= '<a href="index.php?module=Settings&action=DetailView&record=' . $userId . '">' . $userName . '</a>';
    }
    $userinfo = array_chunk($userinfo, 2);
    //Check for Current User
    global $current_user;
    $current_role = fetchUserRole($current_user->id);
    $return_data = array('profileinfo' => $profileinfo, 'userinfo' => $userinfo);
    return $return_data;
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:33,代码来源:RoleDetailView.php


示例2: getRecipientEmails

	public function getRecipientEmails() {
		$recipientsInfo = $this->scheduledRecipients;

		$recipientsList = array();
		if(!empty($recipientsInfo)) {
			if(!empty($recipientsInfo['users'])) {
				$recipientsList = array_merge($recipientsList, $recipientsInfo['users']);
			}

			if(!empty($recipientsInfo['roles'])) {
				foreach($recipientsInfo['roles'] as $roleId) {
					$roleUsers = getRoleUsers($roleId);
					foreach($roleUsers as $userId => $userName) {
						array_push($recipientsList, $userId);
					}
				}
			}

			if(!empty($recipientsInfo['rs'])) {
				foreach($recipientsInfo['rs'] as $roleId) {
					$users = getRoleAndSubordinateUsers($roleId);
					foreach($users as $userId => $userName) {
						array_push($recipientsList, $userId);
					}
				}
			}


			if(!empty($recipientsInfo['groups'])) {
				require_once 'include/utils/GetGroupUsers.php';
				foreach($recipientsInfo['groups'] as $groupId) {
					$userGroups = new GetGroupUsers();
					$userGroups->getAllUsersInGroup($groupId);
					$recipientsList = array_merge($recipientsList, $userGroups->group_users);
				}
			}
		}
		$recipientsEmails = array();
		if(!empty($recipientsList) && count($recipientsList) > 0) {
			foreach($recipientsList as $userId) {
				$userName = getUserFullName($userId);
				$userEmail = getUserEmail($userId);
				if(!in_array($userEmail, $recipientsEmails)) {
					$recipientsEmails[$userName] = $userEmail;
				}
			}
		}
		return $recipientsEmails;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:49,代码来源:ScheduledReports.php


示例3: getRecipientEmails

 public function getRecipientEmails()
 {
     $recipientsInfo = $this->get('recipients');
     if (!empty($recipientsInfo)) {
         $recipients = array();
         $recipientsInfo = Zend_Json::decode($recipientsInfo);
         foreach ($recipientsInfo as $key => $recipient) {
             if (strpos($recipient, 'USER') !== false) {
                 $id = explode('::', $recipient);
                 $recipients['Users'][] = $id[1];
             } else {
                 if (strpos($recipient, 'GROUP') !== false) {
                     $id = explode('::', $recipient);
                     $recipients['Groups'][] = $id[1];
                 } else {
                     if (strpos($recipient, 'ROLE') !== false) {
                         $id = explode('::', $recipient);
                         $recipients['Roles'][] = $id[1];
                     }
                 }
             }
         }
     }
     $recipientsList = array();
     if (!empty($recipients)) {
         if (!empty($recipients['Users'])) {
             $recipientsList = array_merge($recipientsList, $recipients['Users']);
         }
         if (!empty($recipients['Roles'])) {
             foreach ($recipients['Roles'] as $roleId) {
                 $roleUsers = getRoleUsers($roleId);
                 foreach ($roleUsers as $userId => $userName) {
                     array_push($recipientsList, $userId);
                 }
             }
         }
         if (!empty($recipients['Groups'])) {
             require_once 'include/utils/GetGroupUsers.php';
             foreach ($recipients['Groups'] as $groupId) {
                 $userGroups = new GetGroupUsers();
                 $userGroups->getAllUsersInGroup($groupId);
                 $recipientsList = array_merge($recipientsList, $userGroups->group_users);
             }
         }
     }
     $recipientsList = array_unique($recipientsList);
     $recipientsEmails = array();
     if (!empty($recipientsList) && count($recipientsList) > 0) {
         foreach ($recipientsList as $userId) {
             if (!Vtiger_Util_Helper::isUserDeleted($userId)) {
                 $userName = getUserFullName($userId);
                 $userEmail = getUserEmail($userId);
                 if (!in_array($userEmail, $recipientsEmails)) {
                     $recipientsEmails[$userName] = $userEmail;
                 }
             }
         }
     }
     //Added for specific email address.
     $specificemails = explode(',', Zend_Json::decode($this->get('specificemails')));
     if (!empty($specificemails)) {
         $recipientsEmails = array_merge($recipientsEmails, $specificemails);
     }
     return $recipientsEmails;
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:65,代码来源:ScheduleReports.php


示例4: getSubordinateRoleAndUsers

/** To retreive the subordinate vtiger_roles and vtiger_users of the specified parent vtiger_role
 * @param $roleid -- The Role Id:: Type varchar
 * @returns  subordinate vtiger_role array in the following format:
 *     $subordinateRoleUserArray=(roleid1=>Array(userid1,userid2,userid3),
  vtiger_roleid2=>Array(userid1,userid2,userid3)
  |
  |
  vtiger_roleidn=>Array(userid1,userid2,userid3));
 */
function getSubordinateRoleAndUsers($roleId)
{
    $log = vglobal('log');
    $log->debug("Entering getSubordinateRoleAndUsers(" . $roleId . ") method ...");
    $adb = PearDatabase::getInstance();
    $subRoleAndUsers = array();
    $subordinateRoles = getRoleSubordinates($roleId);
    foreach ($subordinateRoles as $subRoleId) {
        $userArray = getRoleUsers($subRoleId);
        $subRoleAndUsers[$subRoleId] = $userArray;
    }
    $log->debug("Exiting getSubordinateRoleAndUsers method ...");
    return $subRoleAndUsers;
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:23,代码来源:UserInfoUtil.php


示例5: getSubordinateRoleAndUsers

/** To retreive the subordinate vtiger_roles and vtiger_users of the specified parent vtiger_role
  * @param $roleid -- The Role Id:: Type varchar
  * @returns  subordinate vtiger_role array in the following format:
  *     $subordinateRoleUserArray=(roleid1=>Array(userid1,userid2,userid3),
                               vtiger_roleid2=>Array(userid1,userid2,userid3)
				                |
						|
			       vtiger_roleidn=>Array(userid1,userid2,userid3));
 */
function getSubordinateRoleAndUsers($roleId, $users = true)
{
    global $log;
    $log->debug("Entering getSubordinateRoleAndUsers(" . $roleId . ") method ...");
    global $adb;
    $subRoleAndUsers = array();
    $subordinateRoles = getRoleSubordinates($roleId);
    $userArray = array();
    foreach ($subordinateRoles as $subRoleId) {
        if ($users) {
            $userArray = getRoleUsers($subRoleId);
        }
        $subRoleAndUsers[$subRoleId] = $userArray;
    }
    $log->debug("Exiting getSubordinateRoleAndUsers method ...");
    return $subRoleAndUsers;
}
开发者ID:jaimeaga84,项目名称:corebos,代码行数:26,代码来源:UserInfoUtil.php


示例6: getAllUsersInGroup

 /** to get all the vtiger_users and vtiger_groups of the specified group
  * @params $groupId --> Group Id :: Type Integer
  * @returns the vtiger_users present in the group in the variable $parent_groups of the class
  * @returns the sub vtiger_groups present in the group in the variable $group_subgroups of the class
  */
 function getAllUsersInGroup($groupid)
 {
     $adb = PearDatabase::getInstance();
     $log = vglobal('log');
     $log->debug("Entering getAllUsersInGroup(" . $groupid . ") method...");
     //Retreiving from the user2grouptable
     $query = "select * from vtiger_users2group where groupid=?";
     $result = $adb->pquery($query, array($groupid));
     $num_rows = $adb->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         $now_user_id = $adb->query_result($result, $i, 'userid');
         if (!in_array($now_user_id, $this->group_users)) {
             $this->group_users[] = $now_user_id;
         }
     }
     //Retreiving from the vtiger_group2role
     $query = "select * from vtiger_group2role where groupid=?";
     $result = $adb->pquery($query, array($groupid));
     $num_rows = $adb->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         $now_role_id = $adb->query_result($result, $i, 'roleid');
         $now_role_users = array();
         $now_role_users = getRoleUsers($now_role_id);
         foreach ($now_role_users as $now_role_userid => $now_role_username) {
             if (!in_array($now_role_userid, $this->group_users)) {
                 $this->group_users[] = $now_role_userid;
             }
         }
     }
     //Retreiving from the vtiger_group2rs
     $query = "select * from vtiger_group2rs where groupid=?";
     $result = $adb->pquery($query, array($groupid));
     $num_rows = $adb->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         $now_rs_id = $adb->query_result($result, $i, 'roleandsubid');
         $now_rs_users = getRoleAndSubordinateUsers($now_rs_id);
         foreach ($now_rs_users as $now_rs_userid => $now_rs_username) {
             if (!in_array($now_rs_userid, $this->group_users)) {
                 $this->group_users[] = $now_rs_userid;
             }
         }
     }
     //Retreving from group2group
     $query = "select * from vtiger_group2grouprel where groupid=?";
     $result = $adb->pquery($query, array($groupid));
     $num_rows = $adb->num_rows($result);
     for ($i = 0; $i < $num_rows; $i++) {
         $now_grp_id = $adb->query_result($result, $i, 'containsgroupid');
         $focus = new GetGroupUsers();
         $focus->getAllUsersInGroup($now_grp_id);
         $now_grp_users = $focus->group_users;
         $now_grp_grps = $focus->group_subgroups;
         if (!array_key_exists($now_grp_id, $this->group_subgroups)) {
             $this->group_subgroups[$now_grp_id] = $now_grp_users;
         }
         foreach ($focus->group_users as $temp_user_id) {
             if (!in_array($temp_user_id, $this->group_users)) {
                 $this->group_users[] = $temp_user_id;
             }
         }
         foreach ($focus->group_subgroups as $temp_grp_id => $users_array) {
             if (!array_key_exists($temp_grp_id, $this->group_subgroups)) {
                 $this->group_subgroups[$temp_grp_id] = $focus->group_users;
             }
         }
     }
     $log->debug("Exiting getAllUsersInGroup method...");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:73,代码来源:GetGroupUsers.php


示例7: handleTask

 /**
  * @param $context \Workflow\VTEntity
  */
 public function handleTask(&$context)
 {
     global $current_user, $adb;
     if ($this->isContinued()) {
         $sql = "SELECT id, result, result_user_id FROM vtiger_wf_confirmation WHERE execID = '" . $this->getExecId() . "' AND result != '' AND visible = 1";
         $result = $adb->query($sql);
         if ($adb->num_rows($result) == 0) {
             $timeout = $context->getEnvironment('_permissionTimeout');
             $timeoutValue = $context->getEnvironment('_permissionTimeoutValue');
             if ($timeout == true) {
                 if (time() > $timeoutValue) {
                     $this->addStat('Timeout action: ' . $this->get('timeout_output'));
                     return $this->get('timeout_output');
                 }
             }
             return array("delay" => time() + 60 * 10, "checkmode" => "static");
         }
         $data = $adb->fetchByAssoc($result);
         $sql = "SELECT user_name FROM vtiger_users WHERE id = " . $data["result_user_id"];
         $resultUser = $adb->query($sql);
         $resultUser = $adb->fetchByAssoc($resultUser);
         $this->addStat("Permission: " . $data["result"] . " by " . $resultUser["user_name"]);
         $sql = "UPDATE vtiger_wf_confirmation SET visible = 0 WHERE id = " . $data["id"];
         $adb->query($sql);
         return $data["result"];
     }
     $this->_compatible();
     $connected = $this->getConnectedObjects("assigned_to");
     $targets = array();
     if (!empty($connected)) {
         foreach ($connected as $user) {
             if (empty($user)) {
                 continue;
             }
             $targets['user'][] = intval($user->getId());
         }
     }
     $TMPtargets = $this->get('targets');
     if (is_array($TMPtargets)) {
         foreach ($TMPtargets as $value) {
             $parts = explode('##', $value);
             if ($parts[0] == 'USER' && !in_array(intval($parts[1]), $targets['user'])) {
                 $targets['user'][] = intval($parts[1]);
             }
             if ($parts[0] == 'GROUP') {
                 $focusGrpUsers = new GetGroupUsers();
                 $focusGrpUsers->getAllUsersInGroup($parts[1]);
                 $groupUser = $focusGrpUsers->group_users;
                 if (is_array($groupUser)) {
                     foreach ($groupUser as $userId) {
                         if (!in_array($userId, $targets['user'])) {
                             $targets['user'][] = $userId;
                         }
                     }
                 }
             }
             if ($parts[0] == 'ROLE') {
                 $focusGrpUsers = new GetGroupUsers();
                 $focusGrpUsers->getAllUsersInGroup($parts[0]);
                 $groupUser = array_keys(getRoleUsers($parts[1]));
                 if (is_array($groupUser)) {
                     foreach ($groupUser as $userId) {
                         if (!in_array($userId, $targets['user'])) {
                             $targets['user'][] = $userId;
                         }
                     }
                 }
             }
         }
     }
     $backgroundcolor = $this->get("backgroundcolor");
     $bgmode = $this->get("bgmode");
     if (!empty($bgmode) && $bgmode != -1) {
         if ($bgmode == "function") {
             $parser = new VTWfExpressionParser($backgroundcolorFKT, $context, false);
             # Last Parameter = DEBUG
             try {
                 $parser->run();
             } catch (ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $backgroundcolor = $parser->getReturn();
         } else {
             if (strpos($backgroundcolor, '$') !== false || strpos($backgroundcolor, '?') !== false) {
                 $objTemplate = new VTTemplate($context);
                 $backgroundcolor = $objTemplate->render($backgroundcolor);
             }
         }
     } else {
         $backgroundcolor = "#ffffff";
     }
     if (empty($backgroundcolor)) {
         $backgroundcolor = "#ffffff";
     }
     $infomessage = $this->get("infomessage");
     $infomessageFKT = $this->get("infomessageFKT");
     $infomode = $this->get("infomode");
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:cinrepo,代码行数:101,代码来源:WfTaskPermission.php


示例8: getRoleUsers

                                            </div>
                                            <div class="col-lg-3" style="padding-left: 40px;">
                                                <button class='btn btn-success btn-sm personOK inline'>
                                                    <span class='glyphicon glyphicon-ok' aria-hidden='true'></span>
                                                </button>
                                                <button class='btn btn-success btn-sm personADD inline'>
                                                    <span class='glyphicon glyphicon-plus' aria-hidden='true'></span>
                                                </button>
                                            </div>
                                        </li>
                                        <li class="list-group-item">
                                            <h5 class="list-group-item-heading">5. <i class="glyphicon glyphicon-user" aria-hidden="true"></i> General director</h5>
                                            <div class="col-lg-9">
                                                <select class="selectpicker" data-width="100%">
                                                    <?php 
echo getRoleUsers(1);
?>
                                                </select>
                                            </div>
                                            <div class="col-lg-3" style="padding-left: 40px;">
                                                <button class='btn btn-success btn-sm personOK inline'>
                                                    <span class='glyphicon glyphicon-ok' aria-hidden='true'></span>
                                                </button>
                                                <button class='btn btn-success btn-sm personADD inline'>
                                                    <span class='glyphicon glyphicon-plus' aria-hidden='true'></span>
                                                </button>
                                            </div>
                                        </li>
                                    </ul>
                                    <div class="col-lg-12">
                                        <button type="submit" id="createpurch" class="btn btn-success disabled" style="width:100%; margin-bottom: 15px;">Create application for purchase</button>
开发者ID:oopsmelodic,项目名称:Purchase,代码行数:31,代码来源:main_view.php



注:本文中的getRoleUsers函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getRoot函数代码示例发布时间:2022-05-15
下一篇:
PHP getRoleSubordinates函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap