当前位置: 首页>>代码示例>>PHP>>正文


PHP CGroup::GetListEx方法代码示例

本文整理汇总了PHP中CGroup::GetListEx方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroup::GetListEx方法的具体用法?PHP CGroup::GetListEx怎么用?PHP CGroup::GetListEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGroup的用法示例。


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

示例1: GetAllowableUserGroups

 public function GetAllowableUserGroups($documentType)
 {
     $documentType = trim($documentType);
     if (strlen($documentType) <= 0) {
         return false;
     }
     $iblockId = intval(substr($documentType, strlen("iblock_")));
     $arResult = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
     $arRes = array(1);
     if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") {
         $obRights = new CIBlockRights($iblockId);
         foreach ($obRights->GetGroups() as $GROUP_CODE) {
             if (preg_match("/^G(\\d+)\$/", $GROUP_CODE, $match)) {
                 $arRes[] = $match[1];
             }
         }
     } else {
         foreach (CIBlock::GetGroupPermissions($iblockId) as $groupId => $perm) {
             if ($perm > "R") {
                 $arRes[] = $groupId;
             }
         }
     }
     $dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ID" => $arRes));
     while ($arGroup = $dbGroupsList->Fetch()) {
         $arResult[$arGroup["ID"]] = $arGroup["NAME"];
     }
     return $arResult;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:29,代码来源:iblockdocument.php

示例2: GetAllowableUserGroups

 public function GetAllowableUserGroups($documentType)
 {
     $documentType = trim($documentType);
     if (strlen($documentType) <= 0) {
         return false;
     }
     $iblockId = intval(substr($documentType, strlen("type_")));
     $arResult = array("Author" => GetMessage("BPVDX_DOCUMENT_AUTHOR"));
     //		$arRes = array(1);
     //		$arGroups = CIBlock::GetGroupPermissions($iblockId);
     //		foreach ($arGroups as $groupId => $perm)
     //		{
     //			if ($perm > "R")
     //				$arRes[] = $groupId;
     //		}
     $dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ACTIVE" => "Y"));
     //array("ID" => $arRes)
     while ($arGroup = $dbGroupsList->Fetch()) {
         $arResult[$arGroup["ID"]] = $arGroup["NAME"];
     }
     return $arResult;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:22,代码来源:virtualdocument.php

示例3: GetAllowableUserGroups

 public static function GetAllowableUserGroups($documentType)
 {
     $documentType = trim($documentType);
     if (strlen($documentType) <= 0) {
         return false;
     }
     $arDocumentID = self::GetDocumentInfo($documentType);
     if ($arDocumentID !== false) {
         $documentType = $arDocumentID['TYPE'];
     }
     $arResult = array('author' => GetMessage('CRM_DOCUMENT_AUTHOR'));
     $arGroupsID = array(1);
     $arUsersID = array();
     $arRelations = CCrmPerms::GetEntityRelations($documentType, BX_CRM_PERM_SELF);
     foreach ($arRelations as $relation) {
         $preffix = substr($relation, 0, 1);
         if ($preffix === 'G') {
             $arGroupsID[] = intval(substr($relation, 1));
         } elseif ($preffix === 'U') {
             $arUsersID[] = substr($relation, 1);
         }
     }
     //Crutch for Bitrix24 context (user group management is not suppotted)
     if (IsModuleInstalled('bitrix24')) {
         $siteID = CAllSite::GetDefSite();
         $dbResult = CGroup::GetList($by = '', $order = '', array('STRING_ID' => 'EMPLOYEES_' . $siteID, 'STRING_ID_EXACT_MATCH' => 'Y'));
         if ($arEmloyeeGroup = $dbResult->Fetch()) {
             $employeeGroupID = intval($arEmloyeeGroup['ID']);
             if (!in_array($employeeGroupID, $arGroupsID, true)) {
                 $arGroupsID[] = $employeeGroupID;
             }
         }
     }
     if (!empty($arGroupsID)) {
         $dbGroupList = CGroup::GetListEx(array('NAME' => 'ASC'), array('ID' => $arGroupsID));
         while ($arGroup = $dbGroupList->Fetch()) {
             $arResult[$arGroup['ID']] = $arGroup['NAME'];
         }
     }
     if (isset(self::$UNGROUPED_USERS[$documentType])) {
         unset(self::$UNGROUPED_USERS[$documentType]);
     }
     self::$UNGROUPED_USERS[$documentType] = $arUsersID;
     if (!empty($arUsersID)) {
         //Group with empty name will be hidden in group list
         $arResult['ungrouped'] = '';
         //$arResult['ungrouped'] = GetMessage('CRM_DOCUMENT_UNGROUPED_USERS');
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:50,代码来源:crm_document.php

示例4: GetAllowableUserGroups

 /**
  * @param $documentType
  * @param bool $withExtended
  * @return array|bool
  */
 public function GetAllowableUserGroups($documentType, $withExtended = false)
 {
     $documentType = trim($documentType);
     if (strlen($documentType) <= 0) {
         return false;
     }
     $iblockId = intval(substr($documentType, strlen("iblock_")));
     $result = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
     $groupsId = array(1);
     $extendedGroupsCode = array();
     if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") {
         $rights = new CIBlockRights($iblockId);
         foreach ($rights->GetGroups() as $iblockGroupCode) {
             if (preg_match("/^G(\\d+)\$/", $iblockGroupCode, $match)) {
                 $groupsId[] = $match[1];
             } else {
                 $extendedGroupsCode[] = $iblockGroupCode;
             }
         }
     } else {
         foreach (CIBlock::GetGroupPermissions($iblockId) as $groupId => $perm) {
             if ($perm > "R") {
                 $groupsId[] = $groupId;
             }
         }
     }
     $groupsIterator = CGroup::GetListEx(array("NAME" => "ASC"), array("ID" => $groupsId));
     while ($group = $groupsIterator->Fetch()) {
         $result[$group["ID"]] = $group["NAME"];
     }
     if ($withExtended && $extendedGroupsCode) {
         foreach ($extendedGroupsCode as $groupCode) {
             $result['group_' . $groupCode] = CBPHelper::getExtendedGroupName($groupCode);
         }
     }
     return $result;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:42,代码来源:bizprocdocument.php

示例5: GetAllowableUserGroups

 public function GetAllowableUserGroups($documentType)
 {
     if ($storage = self::needProxyToDiskByDocType($documentType)) {
         return self::proxyToDisk(__FUNCTION__, array(\Bitrix\Disk\BizProcDocumentCompatible::generateDocumentType($storage->getId())));
     }
     $iblockId = intval(substr($documentType, strlen("iblock_")));
     if ($iblockId <= 0) {
         throw new CBPArgumentOutOfRangeException("documentType", $documentType);
     }
     $documentType = trim($documentType);
     if (strlen($documentType) <= 0) {
         return false;
     }
     $iblockId = intval(substr($documentType, strlen("iblock_")));
     $arResult = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
     $arRes = array(1);
     if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") {
         $obRights = new CIBlockRights($iblockId);
         foreach ($obRights->GetGroups("element_bizproc_start") as $GROUP_CODE) {
             if (preg_match("/^G(\\d+)\$/", $GROUP_CODE, $match)) {
                 $arRes[] = $match[1];
             }
         }
     } else {
         $arGroups = CIBlock::GetGroupPermissions($iblockId);
         foreach ($arGroups as $groupId => $perm) {
             if ($perm >= "R") {
                 $arRes[] = $groupId;
             }
         }
     }
     //Crutch for Bitrix24 context (user group management is not suppotted)
     if (IsModuleInstalled('bitrix24')) {
         $siteID = CAllSite::GetDefSite();
         $dbResult = CGroup::GetList($by = '', $order = '', array('STRING_ID' => 'EMPLOYEES_' . $siteID, 'STRING_ID_EXACT_MATCH' => 'Y'));
         if ($arEmployeeGroup = $dbResult->Fetch()) {
             $employeeGroupID = intval($arEmployeeGroup['ID']);
             if (!in_array($employeeGroupID, $arRes, true)) {
                 $arRes[] = $employeeGroupID;
             }
         }
     }
     $dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ID" => $arRes));
     while ($arGroup = $dbGroupsList->Fetch()) {
         $arResult[$arGroup["ID"]] = $arGroup["NAME"];
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:48,代码来源:iblockbizproc.php

示例6: array

    $arLangIDs[] = $arLang["LID"];
    $arLangList[$arLang["LID"]] = $arLang["NAME"];
}
$arStatusGroups = array();
$arStatusGroupIDs = array();
$arSaleManagerGroups = array();
$rsSaleManagerGroups = $APPLICATION->GetGroupRightList(array("MODULE_ID" => "sale", "G_ACCESS" => "U"));
while ($arSaleManagerGroup = $rsSaleManagerGroups->Fetch()) {
    $arSaleManagerGroup["GROUP_ID"] = intval($arSaleManagerGroup["GROUP_ID"]);
    if (2 >= $arSaleManagerGroup["GROUP_ID"]) {
        continue;
    }
    $arSaleManagerGroups[] = $arSaleManagerGroup["GROUP_ID"];
}
if (!empty($arSaleManagerGroups)) {
    $rsGroups = CGroup::GetListEx(array('SORT' => 'ASC', 'ID' => 'ASC'), array('ID' => $arSaleManagerGroups), false, false, array('ID', 'NAME'));
    while ($arGroup = $rsGroups->Fetch()) {
        $arGroup['ID'] = intval($arGroup['ID']);
        $arStatusGroups[$arGroup['ID']] = $arGroup['NAME'];
        $arStatusGroupIDs[] = $arGroup['ID'];
    }
}
$arErrors = array();
$bVarsFromForm = false;
$arFields = array();
$arPerms = array();
$arLangName = array();
$arPermFields = array("GROUP_ID" => 0, "PERM_VIEW" => 'N', "PERM_CANCEL" => 'N', "PERM_MARK" => 'N', "PERM_DELIVERY" => 'N', "PERM_DEDUCTION" => 'N', "PERM_PAYMENT" => 'N', "PERM_STATUS" => 'N', "PERM_STATUS_FROM" => 'N', "PERM_UPDATE" => 'N', "PERM_DELETE" => 'N');
$arPermFieldKeys = array_keys($arPermFields);
$arPermFieldKeysCut = $arPermFieldKeys;
unset($arPermFieldKeysCut[0]);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:status_edit.php


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