Пример #1
0
    $notSelectedUsersId = $arParams['VALUE'];
    // Prevent using users, that doesn't activate it's account
    // http://jabber.bx/view.php?id=29118
    if (IsModuleInstalled('bitrix24')) {
        $arFilter['CONFIRM_CODE'] = false;
    }
    $dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $arFilter, array('SELECT' => array('UF_DEPARTMENT')));
    while ($arRes = $dbRes->GetNext()) {
        if (($key = array_search($arRes['ID'], $notSelectedUsersId)) !== false) {
            //if user already selected, then we not select from extranet
            unset($notSelectedUsersId[$key]);
        }
        $arResult["CURRENT_USERS"][] = array('ID' => $arRes['ID'], 'NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], $arRes, true, false), '~NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arRes["~NAME"], "LAST_NAME" => $arRes["~LAST_NAME"], "LOGIN" => $arRes["~LOGIN"], "SECOND_NAME" => $arRes["~SECOND_NAME"]), true, false), 'LOGIN' => $arRes['LOGIN'], 'EMAIL' => $arRes['EMAIL'], 'WORK_POSITION' => $arRes['WORK_POSITION'] ? $arRes['WORK_POSITION'] : $arRes['PERSONAL_PROFESSION'], '~WORK_POSITION' => $arRes['~WORK_POSITION'] ? $arRes['~WORK_POSITION'] : $arRes['~PERSONAL_PROFESSION'], 'PHOTO' => (string) CIntranetUtils::createAvatar($arRes, array(), $arParams['SITE_ID']), 'HEAD' => false, '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');
    }
    if ($notSelectedUsersId && CModule::IncludeModule('extranet')) {
        foreach (CIntranetUserSelectorHelper::getExtranetUsers(implode('|', $notSelectedUsersId)) as $arRes) {
            $arResult["CURRENT_USERS"][] = array('ID' => $arRes['ID'], 'NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], $arRes, true, false), '~NAME' => CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $arRes["~NAME"], "LAST_NAME" => $arRes["~LAST_NAME"], "LOGIN" => $arRes["~LOGIN"], "SECOND_NAME" => $arRes["~SECOND_NAME"]), true, false), 'LOGIN' => $arRes['LOGIN'], 'EMAIL' => $arRes['EMAIL'], 'WORK_POSITION' => $arRes['WORK_POSITION'] ? $arRes['WORK_POSITION'] : $arRes['PERSONAL_PROFESSION'], '~WORK_POSITION' => $arRes['~WORK_POSITION'] ? $arRes['~WORK_POSITION'] : $arRes['~PERSONAL_PROFESSION'], 'PHOTO' => (string) CIntranetUtils::createAvatar($arRes, array(), $arParams['SITE_ID']), 'HEAD' => false, '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');
        }
        unset($arRes);
    }
}
$arResult['FIXED_USERS'] = isset($arParams['FIXED_USERS']) && is_array($arParams['FIXED_USERS']) ? $arParams['FIXED_USERS'] : array();
$groups = array();
if ($arParams["DISPLAY_TAB_GROUP"] == 'Y') {
    $groups = CIntranetUserSelectorHelper::getUserGroups($USER->GetID());
}
$arResult["GROUPS"] = $groups;
$arResult["CURRENT_USERS"] = array_values(array_filter($arResult["CURRENT_USERS"], array('CIntranetUserSelectorHelper', 'filterViewableUsers')));
$arResult["LAST_USERS"] = array_values(array_filter($arResult["LAST_USERS"], array('CIntranetUserSelectorHelper', 'filterViewableUsers')));
CUtil::InitJSCore(array("tooltip"));
$this->IncludeComponentTemplate();
Пример #2
0
 function FilterViewableUsers($var)
 {
     return CIntranetUserSelectorHelper::filterViewableUsers($var);
 }
Пример #3
0
    }
    ?>
						</div>
					</div>
					<?php 
}
?>
					<?php 
if ($arParams["DISPLAY_TAB_GROUP"] == 'Y') {
    ?>
					<div class="finder-box-tab-content" id="<?php 
    echo $arResult["NAME"];
    ?>
_groups">
						<?php 
    CIntranetUserSelectorHelper::drawGroup($arResult["GROUPS"], $arResult["NAME"]);
    ?>
					</div>
					<?php 
}
?>
					<div class="finder-box-tab-content" id="<?php 
echo $arResult["NAME"];
?>
_search"></div>
				</div>
			</td>
			<?php 
if ($arParams["MULTIPLE"] == "Y") {
    ?>
			<td class="finder-box-right-column" id="<?php 
Пример #4
0
             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');
             }