本文整理汇总了PHP中CGroup::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroup::GetList方法的具体用法?PHP CGroup::GetList怎么用?PHP CGroup::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroup
的用法示例。
在下文中一共展示了CGroup::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Delete
/**
* Delete
* @param $CODE
* @return array
* @throws \Exception
*/
public static function Delete($CODE)
{
$group = new \CGroup();
$user = new \CUser();
if (!empty($CODE)) {
$by = "ID";
$order = "asc";
$dbGroup = $group->GetList($by, $order, array('STRING_ID' => $CODE));
if ($arGroup = $dbGroup->Fetch()) {
$arReturn = $arGroup;
}
} else {
throw new BimException('Empty group code');
}
if (intval($arReturn['ID']) > 0) {
$arUsers = $group->GetGroupUser($arReturn['ID']);
foreach ($arUsers as $UserID) {
$arGroup = $user->GetUserGroup($UserID);
$arGroup[] = "3";
$user->SetUserGroup($UserID, $arGroup);
}
$res = $group->Delete($arReturn['ID']);
if (is_object($res)) {
return $arReturn['ID'];
} else {
throw new BimException($group->LAST_ERROR);
}
} else {
throw new BimException('Group not found');
}
}
示例2: getUserGroups
/**
* Получение массива групп пользователей
*
* @return array массив групп пользователей
*/
public static function getUserGroups()
{
$group = new \CGroup();
$groupOrder = array('sort' => 'asc');
$groupTmp = 'sort';
$groupQuery = $group->GetList($groupOrder, $groupTmp);
$groups = array();
for ($i = 0; $item = $groupQuery->Fetch(); $i++) {
$groups[$i] = $item;
}
return $groups;
}
示例3: getGroupsByFilter
public function getGroupsByFilter($filter = array())
{
$by = 'c_sort';
$order = 'asc';
$res = array();
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$dbRes = \CGroup::GetList($by, $order, $filter);
while ($aItem = $dbRes->Fetch()) {
$res[] = $aItem;
}
return $res;
}
示例4: BeforeUserAdd
function BeforeUserAdd(&$arFields)
{
if (strstr($_SERVER['HTTP_REFERER'], "webim")) {
$filter = array("STRING_ID" => "webim");
$by = 'c_sort';
$order = 'DESC';
$rsGroups = CGroup::GetList($by, $order, $filter);
$is_filtered = $rsGroups->is_filtered;
if ($row = $rsGroups->GetNext()) {
$arFields["GROUP_ID"][] = array("GROUP_ID" => $row["ID"]);
}
}
}
示例5: BeforeUserAdd
public function BeforeUserAdd(&$arFields)
{
if (strstr($_SERVER['HTTP_REFERER'], 'webim')) {
$filter = array('STRING_ID' => 'webim');
$by = 'c_sort';
$order = 'DESC';
$rsGroups = CGroup::GetList($by, $order, $filter);
$is_filtered = $rsGroups->is_filtered;
if ($row = $rsGroups->GetNext()) {
$arFields['GROUP_ID'][] = array('GROUP_ID' => $row['ID']);
}
}
}
示例6: getUserGroups
/**
* @return array
*/
public function getUserGroups()
{
if ($this->groups) {
return $this->groups;
}
$ids = $this->user->GetUserGroupArray();
$res = array();
$dbRes = \CGroup::GetList($by = null, $order = null, array('ID' => implode('|', $ids)));
while ($item = $dbRes->Fetch()) {
$res[] = $item['STRING_ID'];
}
$this->groups = array_filter($res);
return $this->groups;
}
示例7: checkParams
/**
* Абстрактный метод проверки передаваемых параметров
*
* checkParams
* @param array $groupId
* @return mixed|void
* @throws \Exception
* @internal param array $params
*/
public function checkParams($groupId)
{
$group = new \CGroup();
if (!isset($groupId) || empty($groupId)) {
throw new BimException('empty groupId param');
}
$this->ownerItemDbData = array();
$groupDbRes = $group->GetList($by = 'id', $order = 'desc', array('ID' => $groupId));
if ($groupDbRes === false || !$groupDbRes->SelectedRowsCount()) {
throw new BimException('Group with id = ' . $groupId . ' not exists');
}
$groupData = $groupDbRes->Fetch();
if (!strlen($groupData['STRING_ID'])) {
throw new BimException('Group with id = ' . $groupId . ' have empty STRING_ID!');
}
$this->ownerItemDbData = $groupData;
}
示例8: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("iblock")) {
return;
}
$arIBlockType = array();
$rsIBlockType = CIBlockType::GetList(array("sort" => "asc"), array("ACTIVE" => "Y"));
while ($arr = $rsIBlockType->Fetch()) {
if ($ar = CIBlockType::GetByIDLang($arr["ID"], LANGUAGE_ID)) {
$arIBlockType[$arr["ID"]] = "[" . $arr["ID"] . "] " . $ar["NAME"];
}
}
$arIBlock = array();
$rsIBlock = CIBlock::GetList(array("sort" => "asc"), array("TYPE" => $arCurrentValues["IBLOCK_TYPE"], "ACTIVE" => "Y"));
while ($arr = $rsIBlock->Fetch()) {
$arIBlock[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"];
}
$arUserGroups = array();
$dbGroups = CGroup::GetList($b = "NAME", $o = "ASC", array("ACTIVE" => "Y"));
while ($arGroup = $dbGroups->GetNext()) {
$arUserGroups[$arGroup["ID"]] = "[" . $arGroup["ID"] . "] " . $arGroup["NAME"];
}
$arComponentParameters = array("GROUPS" => array("VARIABLE_ALIASES" => array("NAME" => GetMessage("INTL_VARIABLE_ALIASES"))), "PARAMETERS" => array("IBLOCK_TYPE" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_IBLOCK_TYPE"), "TYPE" => "LIST", "VALUES" => $arIBlockType, "REFRESH" => "Y"), "IBLOCK_ID" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_IBLOCK"), "TYPE" => "LIST", "VALUES" => $arIBlock, "REFRESH" => "Y"), "PAGE_VAR" => array("NAME" => GetMessage("INTL_PAGE_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "MEETING_VAR" => array("NAME" => GetMessage("INTL_MEETING_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "MEETING_ID" => array("NAME" => GetMessage("INTL_MEETING_ID"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "BASE"), "ITEM_VAR" => array("NAME" => GetMessage("INTL_ITEM_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "ITEM_ID" => array("NAME" => GetMessage("INTL_ITEM_ID"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "BASE"), "PATH_TO_MEETING" => array("NAME" => GetMessage("INTL_PATH_TO_MEETING"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_MEETING_LIST" => array("NAME" => GetMessage("INTL_PATH_TO_MEETING_LIST"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "SET_NAVCHAIN" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("INTL_SET_NAVCHAIN"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "SET_TITLE" => array(), "USERGROUPS_RESERVE" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_USERGROUPS_RESERVE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arUserGroups)));
示例9: date
}
print "</pre>";
}
}
if ($_GET["date_from"] || $_GET["date_to"]) {
$date_from = $_GET["date_from"];
$date_to = $_GET["date_to"];
} else {
$date_from = date('d.m.Y', time() - 3600 * 24 * 10);
$date_to = date('d.m.Y', time());
}
$APPLICATION->ShowHead();
CJSCore::Init("jquery");
$APPLICATION->ShowPanel();
$APPLICATION->SetTitle("Статистика приглашений детально");
$groupObj = CGroup::GetList();
$groups = array();
while ($group = $groupObj->Fetch()) {
if ($group["ID"] == 8 || $group["ID"] == 9) {
//Усилители / Сотрудники
$groups[$group["ID"]] = $group["NAME"];
}
}
$arFilter = array("DATE_REGISTER_1" => $date_from, "DATE_REGISTER_2" => $date_to);
$usersObj = CUser::GetList($sort = "id", $direct = "asc", $arFilter, array("SELECT" => array("UF_*"), "FIELDS" => array("*")));
$counter = array();
while ($user = $usersObj->Fetch()) {
if ($user["UF_USER_PARENT"]) {
$counter[$user["UF_USER_PARENT"]][] = $user;
}
}
示例10: array
?>
</table>
</td></tr>
<?
if ($USER->IsAdmin())
{
if (CBXFeatures::IsFeatureEnabled('SaleRecurring'))
{
$tabControl->BeginNextTab();
$arVal = array();
$strVal = (string)Option::get('catalog', 'avail_content_groups');
if ($strVal != '')
$arVal = explode(',', $strVal);
$dbUserGroups = CGroup::GetList(($b="c_sort"), ($o="asc"), array("ANONYMOUS" => "N"));
while ($arUserGroups = $dbUserGroups->Fetch())
{
$arUserGroups["ID"] = (int)$arUserGroups["ID"];
if ($arUserGroups["ID"] == 2)
continue;
?>
<tr>
<td width="40%"><label for="user_group_<?php
echo $arUserGroups["ID"];
?>
"><?php
echo htmlspecialcharsEx($arUserGroups["NAME"]);
?>
</label> [<a href="group_edit.php?ID=<?php
echo $arUserGroups["ID"];
示例11: array
?>
<sup>1)</sup></td>
</tr>
<?php
$arCurProductGroups = array();
$dbProductGroups = CCatalogProductGroups::GetList(array(), array("PRODUCT_ID" => $ID), false, false, array("ID", "GROUP_ID", "ACCESS_LENGTH", "ACCESS_LENGTH_TYPE"));
while ($arProductGroup = $dbProductGroups->Fetch()) {
$arCurProductGroups[intval($arProductGroup["GROUP_ID"])] = array(intval($arProductGroup["ACCESS_LENGTH"]), $arProductGroup["ACCESS_LENGTH_TYPE"]);
}
$arAvailContentGroups = array();
$availContentGroups = COption::GetOptionString("catalog", "avail_content_groups");
if (strlen($availContentGroups) > 0) {
$arAvailContentGroups = explode(",", $availContentGroups);
}
$bNoAvailGroups = true;
$dbGroups = CGroup::GetList($b = "c_sort", $o = "asc", array("ANONYMOUS" => "N"));
while ($arGroup = $dbGroups->Fetch()) {
$arGroup["ID"] = intval($arGroup["ID"]);
if ($arGroup["ID"] == 2 || !in_array($arGroup["ID"], $arAvailContentGroups)) {
continue;
}
if ($bVarsFromForm) {
if (isset(${"CAT_USER_GROUP_ID_" . $arGroup["ID"]}) && ${"CAT_USER_GROUP_ID_" . $arGroup["ID"]} == "Y") {
$arCurProductGroups[$arGroup["ID"]] = array(intval(${"CAT_ACCESS_LENGTH_" . $arGroup["ID"]}), ${"CAT_ACCESS_LENGTH_TYPE_" . $arGroup["ID"]});
} elseif (array_key_exists($arGroup["ID"], $arCurProductGroups)) {
unset($arCurProductGroups[$arGroup["ID"]]);
}
}
$bNoAvailGroups = false;
?>
<tr>
示例12: array
//Registered users group
$dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "REGISTERED_USERS"));
if ($dbResult->Fetch()) {
return;
}
$group = new CGroup();
$arFields = array("ACTIVE" => "Y", "C_SORT" => 3, "NAME" => GetMessage("REGISTERED_GROUP_NAME"), "STRING_ID" => "REGISTERED_USERS");
$groupID = $group->Add($arFields);
if ($groupID > 0) {
COption::SetOptionString("main", "new_user_registration_def_group", $groupID);
if ($editProfileTask) {
CGroup::SetTasks($groupID, array($editProfileTask), true);
}
}
//Control panel users
$dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "CONTROL_PANEL_USERS"));
$arGroup = $dbResult->Fetch();
if (!$arGroup) {
$group = new CGroup();
$arFields = array("ACTIVE" => "Y", "C_SORT" => 4, "NAME" => GetMessage("CONTROL_PANEL_GROUP_NAME"), "STRING_ID" => "CONTROL_PANEL_USERS");
$groupID = $group->Add($arFields);
if ($groupID > 0) {
DemoSiteUtil::SetFilePermission(array("s1", "/bitrix/admin"), array($groupID => "R"));
if ($editProfileTask) {
CGroup::SetTasks($groupID, array($editProfileTask), true);
}
}
} else {
$groupID = $arGroup["ID"];
}
if ($groupID > 0 && !strlen(COption::GetOptionString("main", "show_panel_for_users", ""))) {
示例13: Copy
function Copy($ID, $CHECK_RIGHTS = "Y")
{
global $DB, $APPLICATION, $strError;
$err_mess = CAllForm::err_mess() . "<br>Function: Copy<br>Line: ";
$ID = intval($ID);
if ($CHECK_RIGHTS != "Y" || CForm::IsAdmin()) {
$rsForm = CForm::GetByID($ID);
$arForm = $rsForm->Fetch();
if (!is_set($arForm, "FORM_TEMPLATE")) {
$arForm["FORM_TEMPLATE"] = CForm::GetFormTemplateByID($ID);
}
// символьный код формы
while (true) {
$SID = $arForm["SID"];
if (strlen($SID) > 25) {
$SID = substr($SID, 0, 25);
}
$SID .= "_" . RandString(5);
$strSql = "SELECT 'x' FROM b_form WHERE SID='" . $DB->ForSql($SID, 50) . "'";
$z = $DB->Query($strSql, false, $err_mess . __LINE__);
if (!($zr = $z->Fetch())) {
break;
}
}
$arFields = array("NAME" => $arForm["NAME"], "SID" => $SID, "C_SORT" => $arForm["C_SORT"], "FIRST_SITE_ID" => $arForm["FIRST_SITE_ID"], "BUTTON" => $arForm["BUTTON"], "USE_CAPTCHA" => $arForm["USE_CAPTCHA"], "DESCRIPTION" => $arForm["DESCRIPTION"], "DESCRIPTION_TYPE" => $arForm["DESCRIPTION_TYPE"], "SHOW_TEMPLATE" => $arForm["SHOW_TEMPLATE"], "FORM_TEMPLATE" => $arForm["FORM_TEMPLATE"], "USE_DEFAULT_TEMPLATE" => $arForm["USE_DEFAULT_TEMPLATE"], "SHOW_RESULT_TEMPLATE" => $arForm["SHOW_RESULT_TEMPLATE"], "PRINT_RESULT_TEMPLATE" => $arForm["PRINT_RESULT_TEMPLATE"], "EDIT_RESULT_TEMPLATE" => $arForm["EDIT_RESULT_TEMPLATE"], "FILTER_RESULT_TEMPLATE" => $arForm["FILTER_RESULT_TEMPLATE"], "TABLE_RESULT_TEMPLATE" => $arForm["TABLE_RESULT_TEMPLATE"], "STAT_EVENT1" => $arForm["STAT_EVENT1"], "STAT_EVENT2" => $SID, "STAT_EVENT3" => $arForm["STAT_EVENT3"], "arSITE" => CForm::GetSiteArray($ID));
// пункты меню
$z = CForm::GetMenuList(array("FORM_ID" => $ID), "N");
while ($zr = $z->Fetch()) {
$arFields["arMENU"][$zr["LID"]] = $zr["MENU"];
}
// права групп
$w = CGroup::GetList($v1 = "dropdown", $v2 = "asc", array("ADMIN" => "N"), $v3);
$arGroups = array();
while ($wr = $w->Fetch()) {
$arGroups[] = $wr["ID"];
}
if (is_array($arGroups)) {
foreach ($arGroups as $gid) {
$arFields["arGROUP"][$gid] = CForm::GetPermission($ID, array($gid), "Y");
}
}
// картинка
if (intval($arForm["IMAGE_ID"]) > 0) {
$arIMAGE = CFile::MakeFileArray(CFile::CopyFile($arForm["IMAGE_ID"]));
$arIMAGE["MODULE_ID"] = "form";
$arFields["arIMAGE"] = $arIMAGE;
}
$NEW_ID = CForm::Set($arFields, 0);
if (intval($NEW_ID) > 0) {
// статусы
$rsStatus = CFormStatus::GetList($ID, $by, $order, array(), $is_filtered);
while ($arStatus = $rsStatus->Fetch()) {
CFormStatus::Copy($arStatus["ID"], "N", $NEW_ID);
}
// вопросы/пол¤
$rsField = CFormField::GetList($ID, "ALL", $by, $order, array(), $is_filtered);
while ($arField = $rsField->Fetch()) {
CFormField::Copy($arField["ID"], "N", $NEW_ID);
}
}
return $NEW_ID;
} else {
$strError .= GetMessage("FORM_ERROR_ACCESS_DENIED") . "<br>";
}
return false;
}
示例14: array
"GROUPS_ID" => $find_group_id
);
}
if(!$USER->CanDoOperation('view_all_users'))
{
$arUserSubordinateGroups = array();
$arUserGroups = CUser::GetUserGroup($USER->GetID());
foreach($arUserGroups as $grp)
$arUserSubordinateGroups = array_merge($arUserSubordinateGroups, CGroup::GetSubordinateGroups($grp));
$arFilter["CHECK_SUBORDINATE"] = array_unique($arUserSubordinateGroups);
}
// инициализация списка - выборка данных
$rsData = CGroup::GetList($by, $order, $arFilter, "Y");
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// установке параметров списка
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
// заголовок списка
$lAdmin->AddHeaders(array(
array("id"=>"ID", "content"=>"ID", "sort"=>"id", "default"=>true, "align"=>"right"),
array("id"=>"TIMESTAMP_X", "content"=>GetMessage('TIMESTAMP'), "sort"=>"timestamp_x", "default"=>true),
array("id"=>"ACTIVE", "content"=>GetMessage('ACTIVE'), "sort"=>"active", "default"=>true),
array("id"=>"C_SORT", "content"=>GetMessage("MAIN_C_SORT"), "sort"=>"c_sort", "default"=>true, "align"=>"right"),
array("id"=>"NAME", "content"=>GetMessage("NAME"), "sort"=>"name", "default"=>true),
array("id"=>"DESCRIPTION", "content"=>GetMessage("MAIN_DESCRIPTION"), "sort"=>"description", "default"=>false),
array("id"=>"USERS", "content"=>GetMessage('MAIN_USERS'), "sort"=>"users", "default"=>true, "align"=>"right"),
示例15: LocalRedirect
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
}
// copying
if ($copy_id > 0 && check_bitrix_sessid() && $F_RIGHT >= 30) {
$new_id = CForm::Copy($copy_id);
if (strlen($strError) <= 0 && intval($new_id) > 0) {
LocalRedirect("/bitrix/admin/form_edit.php?ID=" . $new_id . "&lang=" . LANGUAGE_ID);
}
}
// cleaning
if ($reset_id > 0 && check_bitrix_sessid() && $F_RIGHT >= 30) {
CForm::Reset($reset_id);
LocalRedirect("/bitrix/admin/form_edit.php?ID=" . $reset_id . "&lang=" . LANGUAGE_ID);
}
$w = CGroup::GetList($v1 = "dropdown", $v2 = "asc", array("ADMIN" => "N"));
$arGroups = array();
while ($wr = $w->Fetch()) {
$arGroups[] = array("ID" => $wr["ID"], "NAME" => "[<a title=\"" . GetMessage("FORM_GROUP_EDIT") . "\" href=\"/bitrix/admin/group_edit.php?ID=" . intval($wr["ID"]) . "&lang=" . LANGUAGE_ID . "\">" . intval($wr["ID"]) . "</a>] " . htmlspecialcharsbx($wr["NAME"]));
}
$z = CLanguage::GetList($v1, $v2, array("ACTIVE" => "Y"));
$arFormMenuLang = array();
while ($zr = $z->Fetch()) {
$arFormMenuLang[] = array("LID" => $zr["LID"], "NAME" => $zr["NAME"]);
}
$rs = CSite::GetList($by = "sort", $order = "asc");
$arrSites = array();
while ($ar = $rs->Fetch()) {
if ($ar["DEF"] == "Y") {
$def_site_id = $ar["ID"];
}