function InEmployeeDrawStructure($arStructure, $arSections, $key, $name) { CIntranetUserSelectorHelper::drawEmployeeStructure($arStructure, $arSections, $key, $name); }
} ?> <?php if ($arParams["DISPLAY_TAB_STRUCTURE"] == 'Y') { ?> <div class="finder-box-tab-content<?php echo $arParams["SHOW_STRUCTURE_ONLY"] == 'Y' ? ' finder-box-tab-content-selected' : ''; ?> " id="<?php echo $arResult["NAME"]; ?> _structure"> <div class="company-structure"> <?php if (sizeof($arResult["STRUCTURE"]) > 0) { CIntranetUserSelectorHelper::drawEmployeeStructure($arResult["STRUCTURE"], $arResult["SECTIONS"], 0, $arResult["NAME"], $arParams["SHOW_STRUCTURE_ONLY"] == "Y"); } ?> </div> </div> <?php } ?> <?php if ($arParams["DISPLAY_TAB_GROUP"] == 'Y') { ?> <div class="finder-box-tab-content" id="<?php echo $arResult["NAME"]; ?> _groups"> <?php
foreach ($arStructure['DATA'] as $k => $item) { $iblockSectionId = (int) $item['IBLOCK_SECTION_ID']; if (($isSub = !in_array($iblockSectionId, $arSubDeps)) && !in_array($item['ID'], $arSubDeps)) { unset($arStructure['DATA'][$k]); continue; } if ($isSub) { $iblockSectionId = 0; } if (!isset($arStructure['TREE'][$iblockSectionId])) { $arStructure['TREE'][$iblockSectionId] = array(); } $arStructure['TREE'][$iblockSectionId][] = $item['ID']; } } CIntranetUserSelectorHelper::drawEmployeeStructure($arStructure['TREE'], $arStructure['DATA'], $sectionId, $selectorName, !$showUsers); } $arFilter['UF_DEPARTMENT'] = $sectionId; } $arUsers = array(); if ($showUsers) { $arFilter["CONFIRM_CODE"] = false; if ($sectionId != "extranet") { $ufHead = CIntranetUtils::getDepartmentManagerID($sectionId); if ($ufHead > 0) { $arHeadFilter = array('ID' => $ufHead, 'ACTIVE' => $showActiveUsers, 'CONFIRM_CODE' => false); $dbUsers = CUser::GetList($sort_by = 'last_name', $sort_dir = 'asc', $arHeadFilter, array('SELECT' => array('UF_DEPARTMENT'))); if ($arRes = $dbUsers->Fetch()) { $arFilter['!ID'] = $arRes['ID']; $arUsers[] = array('ID' => $arRes['ID'], 'NAME' => CUser::FormatName($nameTemplate, $arRes, $bUseLogin, false), 'LOGIN' => $arRes['LOGIN'], 'EMAIL' => $arRes['EMAIL'], 'WORK_POSITION' => $arRes['WORK_POSITION'] ? $arRes['WORK_POSITION'] : $arRes['PERSONAL_PROFESSION'], 'PHOTO' => (string) CIntranetUtils::createAvatar($arRes, array()), 'HEAD' => true, 'UF_DEPARTMENT' => $arRes['UF_DEPARTMENT'], 'SUBORDINATE' => is_array($arSubDeps) && is_array($arRes['UF_DEPARTMENT']) && array_intersect($arRes['UF_DEPARTMENT'], $arSubDeps) ? 'Y' : 'N', 'SUPERORDINATE' => in_array($arRes["ID"], $arManagers) ? 'Y' : 'N'); }