本文整理汇总了PHP中get_current_user_access_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_user_access_groups函数的具体用法?PHP get_current_user_access_groups怎么用?PHP get_current_user_access_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_current_user_access_groups函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vtws_getUserAccessibleGroups
function vtws_getUserAccessibleGroups($moduleId, $user)
{
global $adb;
require 'user_privileges/user_privileges_' . $user->id . '.php';
require 'user_privileges/sharing_privileges_' . $user->id . '.php';
$tabName = getTabname($moduleId);
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$moduleId] == 3 or $defaultOrgSharingPermission[$moduleId] == 0)) {
$result = get_current_user_access_groups($tabName);
} else {
$result = get_group_options();
}
$groups = array();
if ($result != null && $result != '' && is_object($result)) {
$rowCount = $adb->num_rows($result);
for ($i = 0; $i < $rowCount; $i++) {
$nameArray = $adb->query_result_rowdata($result, $i);
$groupId = $nameArray["groupid"];
$groupName = $nameArray["groupname"];
$groups[] = array('id' => $groupId, 'name' => $groupName);
}
}
return $groups;
}
示例2: getGroupslist
function getGroupslist()
{
global $log, $adb, $module, $current_user;
$log->debug("Entering getGroupslist() method ...");
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
//Commented to avoid security check for groups
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
$result = get_current_user_access_groups($module);
} else {
$result = get_group_options();
}
if ($result) {
$nameArray = $adb->fetch_array($result);
}
if (!empty($nameArray)) {
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $current_user->id, 'private'), $current_user->id);
} else {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $current_user->id), $current_user->id);
}
}
if (count($groups_combo) > 0) {
foreach ($groups_combo as $groupid => $value) {
foreach ($value as $groupname => $selected) {
$change_groups_owner .= "<option value={$groupid} {$selected} >" . $groupname . "</option>";
}
}
}
$log->debug("Exiting getGroupslist method ...");
return $change_groups_owner;
}
示例3: getAssignedTo
function getAssignedTo($tabid)
{
global $current_user, $noof_group_rows, $adb;
$assigned_user_id = $current_user->id;
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0)) {
$result = get_current_user_access_groups('Calendar');
} else {
$result = get_group_options();
}
if ($result) {
$nameArray = $adb->fetch_array($result);
}
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$tabid] == 3 or $defaultOrgSharingPermission[$tabid] == 0)) {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
if ($noof_group_rows != 0) {
do {
$groupname = $nameArray["groupname"];
$group_option[] = array($groupname => $selected);
} while ($nameArray = $adb->fetch_array($result));
}
$fieldvalue[] = $users_combo;
$fieldvalue[] = $group_option;
return $fieldvalue;
}
示例4: getOutputHtml
//.........这里部分代码省略.........
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $value;
} elseif ($uitype == 21 || $uitype == 24) {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $value;
} elseif ($uitype == 22) {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $value;
} elseif ($uitype == 52 || $uitype == 77) {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
global $current_user;
if ($value != '') {
$assigned_user_id = $value;
} else {
$assigned_user_id = $current_user->id;
}
if ($uitype == 52) {
$combo_lbl_name = 'assigned_user_id';
} elseif ($uitype == 77) {
$combo_lbl_name = 'assigned_user_id1';
}
//Control will come here only for Products - Handler and Quotes - Inventory Manager
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
$fieldvalue[] = $users_combo;
} elseif ($uitype == 53) {
global $noof_group_rows;
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
//Security Checks
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$result = get_current_user_access_groups($module_name);
} else {
$result = get_group_options();
}
if ($result) {
$nameArray = $adb->fetch_array($result);
}
$assigned_user_id = empty($value) ? $current_user->id : $value;
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
if ($noof_group_rows != 0) {
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
}
$fieldvalue[] = $users_combo;
$fieldvalue[] = $groups_combo;
} elseif ($uitype == 51 || $uitype == 50 || $uitype == 73) {
if (!isset($_REQUEST['convertmode']) || $_REQUEST['convertmode'] != 'update_quote_val' && $_REQUEST['convertmode'] != 'update_so_val') {
if (isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '') {
$value = vtlib_purify($_REQUEST['account_id']);
}
}
if ($value != '') {
$account_name = getAccountName($value);
}
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $account_name;
示例5: getDetailViewOutputHtml
//.........这里部分代码省略.........
}
if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module)] == 3 or $defaultOrgSharingPermission[getTabid($module)] == 0)) {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $user_id), $assigned_user_id);
}
$label_fld["options"] = $users_combo;
} elseif ($uitype == 11) {
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 53) {
global $noof_group_rows, $adb;
$owner_id = $col_fields[$fieldname];
$user = 'no';
$result = $adb->pquery("SELECT count(*) as count from vtiger_users where id = ?", array($owner_id));
if ($adb->query_result($result, 0, 'count') > 0) {
$user = 'yes';
}
$owner_name = getOwnerName($owner_id);
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $owner_name;
if (is_admin($current_user)) {
$label_fld["secid"][] = $owner_id;
if ($user == 'no') {
$label_fld["link"][] = "index.php?module=Settings&action=GroupDetailView&groupId=" . $owner_id;
} else {
$label_fld["link"][] = "index.php?module=Users&action=DetailView&record=" . $owner_id;
}
//$label_fld["secid"][] = $groupid;
//$label_fld["link"][] = "index.php?module=Settings&action=GroupDetailView&groupId=".$groupid;
}
//Security Checks
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$result = get_current_user_access_groups($module_name);
} else {
$result = get_group_options();
}
if ($result) {
$nameArray = $adb->fetch_array($result);
}
global $current_user;
//$value = $user_id;
if ($owner_id != '') {
if ($user == 'yes') {
$label_fld["options"][] = 'User';
$assigned_user_id = $owner_id;
$user_checked = "checked";
$team_checked = '';
$user_style = 'display:block';
$team_style = 'display:none';
} else {
//$record = $col_fields["record_id"];
//$module = $col_fields["record_module"];
$label_fld["options"][] = 'Group';
$assigned_group_id = $owner_id;
$user_checked = '';
$team_checked = 'checked';
$user_style = 'display:none';
$team_style = 'display:block';
}
} else {
$label_fld["options"][] = 'User';
$assigned_user_id = $current_user->id;
$user_checked = "checked";
$team_checked = '';
$user_style = 'display:block';