本文整理汇总了PHP中CIntranetUtils::GetSubordinateDepartmentsList方法的典型用法代码示例。如果您正苦于以下问题:PHP CIntranetUtils::GetSubordinateDepartmentsList方法的具体用法?PHP CIntranetUtils::GetSubordinateDepartmentsList怎么用?PHP CIntranetUtils::GetSubordinateDepartmentsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntranetUtils
的用法示例。
在下文中一共展示了CIntranetUtils::GetSubordinateDepartmentsList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isSupervisor
/**
* Check if user is head of any company departmant
* @param integer $userID User ID
* @return boolean
*/
public static function isSupervisor($userID)
{
if (!Loader::includeModule('intranet')) {
return false;
}
$dbResult = \CIntranetUtils::GetSubordinateDepartmentsList($userID);
return is_array($dbResult->Fetch());
}
示例2: GetSubordinateDepartmentsOld
function GetSubordinateDepartmentsOld($USER_ID = null, $bRecursive = false)
{
global $USER;
$arDpts = array();
if (!$USER_ID) {
$USER_ID = $USER->GetID();
}
if ($USER_ID) {
$dbRes = CIntranetUtils::GetSubordinateDepartmentsList($USER_ID);
while ($arRes = $dbRes->Fetch()) {
$arDpts[] = $arRes['ID'];
}
if ($bRecursive && count($arDpts) > 0) {
$arDpts = CIntranetUtils::GetIBlockSectionChildren($arDpts);
}
}
return $arDpts;
}
示例3: CPHPCache
}
$arResult["IS_ONLINE"] = $arResult["User"]["IS_ONLINE"] == "Y";
if (CModule::IncludeModule('intranet')) {
$arResult['IS_HONOURED'] = CIntranetUtils::IsUserHonoured($arResult["User"]["ID"]);
$arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arResult["User"]["ID"], $arParams['CALENDAR_USER_IBLOCK_ID']);
//departments and managers
$obCache = new CPHPCache();
$path = "/user_card_" . intval($arResult["User"]["ID"] / 100);
if ($arParams["CACHE_TIME"] == 0 || $obCache->StartDataCache($arParams["CACHE_TIME"], $arResult["User"]["ID"], $path)) {
if ($arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->StartTagCache($path);
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_CARD_" . intval($arResult["User"]["ID"] / 100));
}
//departments
$arResult['DEPARTMENTS'] = array();
$dbRes = CIntranetUtils::GetSubordinateDepartmentsList($arResult["User"]["ID"]);
while ($arRes = $dbRes->GetNext()) {
$arRes['URL'] = str_replace('#ID#', $arRes['ID'], $arParams['PATH_TO_CONPANY_DEPARTMENT']);
$arResult['DEPARTMENTS'][$arRes['ID']] = $arRes;
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT'] = 0;
$rsUsers = CIntranetUtils::GetDepartmentEmployees(array($arRes['ID']), $bRecursive = true);
while ($arUser = $rsUsers->Fetch()) {
if ($arUser['ID'] != $arResult["User"]["ID"]) {
//self
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT']++;
}
}
}
//managers
$arResult['MANAGERS'] = CIntranetUtils::GetDepartmentManager($arResult["User"]["UF_DEPARTMENT"], $arResult["User"]["ID"], true);
if ($arParams["CACHE_TIME"] > 0) {
示例4: CPHPCache
$arUser["IS_ONLINE"] = $arUser["IS_ONLINE"] == "Y";
if ($componentPage == "user") {
if (CModule::IncludeModule('intranet')) {
$arResult['IS_HONOURED'] = CIntranetUtils::IsUserHonoured($arUser["ID"]);
//$arResult['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser["ID"], $arParams['CALENDAR_USER_IBLOCK_ID']);
//departments and managers
$obCache = new CPHPCache();
$path = "/user_card_" . intval($arUser["ID"] / 100);
if ($arParams["CACHE_TIME"] == 0 || $obCache->StartDataCache($arParams["CACHE_TIME"], $arUser["ID"], $path)) {
if ($arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->StartTagCache($path);
$GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_CARD_" . intval($arUser["ID"] / 100));
}
//departments
$arResult['DEPARTMENTS'] = array();
$dbRes = CIntranetUtils::GetSubordinateDepartmentsList($arUser["ID"]);
while ($arRes = $dbRes->GetNext()) {
$arRes['URL'] = str_replace('#ID#', $arRes['ID'], $arParams['PATH_TO_COMPANY_DEPARTMENT']);
$arResult['DEPARTMENTS'][$arRes['ID']] = $arRes;
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT'] = 0;
$rsUsers1 = CIntranetUtils::GetDepartmentEmployees(array($arRes['ID']), $bRecursive = true);
while ($arUser1 = $rsUsers1->Fetch()) {
if ($arUser1['ID'] != $arUser["ID"]) {
//self
$arResult['DEPARTMENTS'][$arRes['ID']]['EMPLOYEE_COUNT']++;
}
}
}
//managers
$arRes = CIntranetUtils::GetDepartmentManager($arUser["UF_DEPARTMENT"], $arUser["ID"], true);
foreach ($arRes as $val) {