if (intval($arResult["FILTER"]["F_GROUP_ID"]) > 0) { $arFilter["GROUP_ID"] = intval($arResult["FILTER"]["F_GROUP_ID"]); } if (intval($arResult["FILTER"]["F_RESPONSIBLE_ID"]) > 0) { $arFilter["RESPONSIBLE_ID"] = intval($arResult["FILTER"]["F_RESPONSIBLE_ID"]); } $arResult["START"] = htmlspecialcharsEx($arFilter["PERIOD"]["START"]); $arResult["END"] = htmlspecialcharsEx($arFilter["PERIOD"]["END"]); // order if (isset($_GET["SORTF"]) && in_array($_GET["SORTF"], array("RESPONSIBLE", "NEW", "OPEN", "CLOSED", "OVERDUED", "MARKED", "POSITIVE")) && isset($_GET["SORTD"]) && in_array($_GET["SORTD"], array("ASC", "DESC"))) { $arResult["ORDER"] = $arOrder = array($_GET["SORTF"] => $_GET["SORTD"]); } else { $arResult["ORDER"] = $arOrder = array("RESPONSIBLE" => "ASC"); } $arParams["ITEMS_COUNT"] = 3; $rsReports = CTaskReport::GetList($arOrder, $arFilter, array('NAV_PARAMS' => array('nPageSize' => intval($arParams["ITEMS_COUNT"]) > 0 ? $arParams["ITEMS_COUNT"] : 10, 'bDescPageNumbering' => false))); $arResult["NAV_STRING"] = $rsReports->GetPageNavString("", "arrows"); $arResult["NAV_PARAMS"] = $rsReports->GetNavParams(); $arResult["REPORTS"] = array(); $arResult["DEPARTMENTS"] = array(); $IBlockID = COption::GetOptionInt('intranet', 'iblock_structure', 0); // subordinate departments $rsSections = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $IBlockID, "UF_HEAD" => $USER->GetID(), 'ACTIVE' => 'Y'), false, array('UF_HEAD')); $arResult["SUBORDINATE_DEPS"] = array(); while ($arSection = $rsSections->Fetch()) { $arSectionIDs[] = $arSection["ID"]; $arSubDepsFilter = array('IBLOCK_ID' => $IBlockID, 'GLOBAL_ACTIVE' => 'Y', '>LEFT_MARGIN' => $arSection['LEFT_MARGIN'], '<RIGHT_MARGIN' => $arSection['RIGHT_MARGIN'], '!ID' => $arSection['ID']); $rsChildSections = CIBlockSection::GetList(array('left_margin' => asc), $arSubDepsFilter, false, array("ID", "NAME", "DEPTH_LEVEL")); while ($arChildSection = $rsChildSections->GetNext()) { $arResult["SUBORDINATE_DEPS"][] = $arChildSection; }