當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CGroup::getList方法代碼示例

本文整理匯總了PHP中CGroup::getList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CGroup::getList方法的具體用法?PHP CGroup::getList怎麽用?PHP CGroup::getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CGroup的用法示例。


在下文中一共展示了CGroup::getList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAllowableUserGroups

 public static function getAllowableUserGroups($documentType)
 {
     $storageId = self::getStorageIdByType($documentType);
     if (!$storageId) {
         throw new CBPArgumentNullException('documentType');
     }
     /** @var Storage $storage */
     $storage = Storage::loadById($storageId, array('ROOT_OBJECT'));
     if (!$storage) {
         throw new CBPArgumentNullException('documentType');
     }
     if ($storage->getProxyType() instanceof ProxyType\Group) {
         if (Loader::includeModule("socialnetwork")) {
             $resultUserGroups = array();
             $resultUserGroups["author"] = Loc::getMessage("DISK_USER_GROUPS_AUTHOR");
             $resultUserGroups[SONET_ROLES_OWNER] = Loc::getMessage("DISK_USER_GROUPS_OWNER");
             $resultUserGroups[SONET_ROLES_MODERATOR] = Loc::getMessage("DISK_USER_GROUPS_MODS");
             $resultUserGroups[SONET_ROLES_USER] = Loc::getMessage("DISK_USER_GROUPS_MEMBERS");
             return $resultUserGroups;
         }
     } else {
         $resultUserGroups = array('Author' => Loc::getMessage("DISK_USER_GROUPS_AUTHOR"));
         $groupIds = array(1);
         foreach (Driver::getInstance()->getRightsManager()->getSpecificRights($storage->getRootObject()) as $right) {
             if (preg_match("/^G(\\d+)\$/", $right['ACCESS_CODE'], $match)) {
                 $groupIds[] = $match[1];
             }
         }
         unset($right);
         //Crutch for Bitrix24 context (user group management is not supported)
         if (ModuleManager::isModuleInstalled('bitrix24')) {
             $siteId = \CAllSite::getDefSite();
             $employeeGroup = \CGroup::getList($by = '', $order = '', array('STRING_ID' => 'EMPLOYEES_' . $siteId, 'STRING_ID_EXACT_MATCH' => 'Y'))->fetch();
             if ($employeeGroup) {
                 $employeeGroupId = (int) $employeeGroup['ID'];
                 if (!in_array($employeeGroupId, $groupIds, true)) {
                     $groupIds[] = $employeeGroupId;
                 }
             }
         }
         $dbGroupsList = \CGroup::getListEx(array('NAME' => 'ASC'), array('ID' => $groupIds));
         while ($group = $dbGroupsList->fetch()) {
             $resultUserGroups[$group['ID']] = $group['NAME'];
         }
         return $resultUserGroups;
     }
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:47,代碼來源:bizprocdocument.php

示例2: array

// sites
$slaSiteList = CTicketSLA::GetSiteArrayForAllSLA();

// groups
$slaGroupList = CTicketSLA::GetGroupArrayForAllSLA();

// groups info
$groupIds = array();
foreach ($slaGroupList as $slaId => $groups)
{
	$groupIds = array_merge($groupIds, $groups);
}
$groupIds = array_unique($groupIds);

$slaGroupNames = array();
$res = CGroup::getList($by=null, $order=null, array('ID' => join('|', $groupIds)));
while ($arRes = $res->Fetch())
{
	$slaGroupNames[$arRes['ID']] = $arRes['NAME'];
}

// users info
$slaResponsiblesInfo = array();
$slaResponsibles = array_unique($slaResponsibles);

if ($slaResponsibles)
{
	$res = CUser::getList($by=null, $order=null, array('ID' => join('|', $slaResponsibles)));
	while ($arRes = $res->Fetch())
	{
		$slaResponsiblesInfo[$arRes['ID']] = array(
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:31,代碼來源:ticket_sla_list.php


注:本文中的CGroup::getList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。