Exemple #1
0
    $arResult['SHOW_SECTION_PROJECTS'] = 'N';
}
$arResult['SHOW_SECTION_MANAGE'] = $arParams['SHOW_SECTION_MANAGE'];
$arResult['F_SEARCH'] = null;
if (strlen($fTitle = tasksGetFilter("F_TITLE")) > 0) {
    $arResult['F_SEARCH'] = $fTitle;
} elseif (intval($fID = tasksGetFilter("F_META::ID_OR_NAME")) > 0) {
    $arResult['F_SEARCH'] = $fID;
}
if ($arParams['SHOW_SECTIONS_BAR'] === 'Y' || $arParams['SHOW_FILTER_BAR'] === 'Y' || $arParams['SHOW_COUNTERS_BAR'] === 'Y') {
    // Show this section ONLY if given user is head of department
    // and logged in user is admin or given user or manager of given user
    if ($arParams['SHOW_SECTION_MANAGE'] === 'A') {
        $arResult['SHOW_SECTION_MANAGE'] = 'N';
        if ($isAccessToCounters) {
            if (CModule::Includemodule('intranet')) {
                $arDepartments = CIntranetUtils::GetSubordinateDepartments($arParams['USER_ID'], $bRecursive = false);
            }
            if (!empty($arDepartments)) {
                $arResult['SHOW_SECTION_MANAGE'] = 'Y';
            }
        }
    }
    if ($arResult['SHOW_SECTION_MANAGE'] === 'Y' && $arParams['GROUP_ID'] > 0) {
        $arResult['SHOW_SECTION_MANAGE'] = 'N';
    }
    if ($arResult['SHOW_SECTION_MANAGE'] === 'Y') {
        $arResult['SECTION_MANAGE_COUNTER'] = 0;
        if ($arEmployees = CTaskIntranetTools::getImmediateEmployees($arParams['USER_ID'])) {
            foreach ($arEmployees as $employeeId) {
                $employeeId = (int) $employeeId;