Exemplo n.º 1
0
         $arResult["FatalError"] .= GetMessage("INTS_TASKS_OFF") . ".";
     }
 }
 if (strlen($arResult["FatalError"]) <= 0) {
     if (!CIntranetTasks::CanCurrentUserPerformOperation($taskType, $ownerId, "view")) {
         $arResult["FatalError"] .= GetMessage("INTS_NO_SONET_PERMS") . ".";
     }
 }
 if (strlen($arResult["FatalError"]) <= 0) {
     $globalParentSectionId = CIntranetTasks::InitializeIBlock($taskType, $ownerId, $arParams["FORUM_ID"]);
     if ($globalParentSectionId <= 0) {
         $arResult["FatalError"] .= GetMessage("INTS_NO_TASK") . ". ";
     }
 }
 if (strlen($arResult["FatalError"]) <= 0) {
     $arResult["TaskFields"] = CIntranetTasks::GetTaskFields($taskType, $ownerId);
     $arResult["TaskFields"]["TASKSTATUS"] = array("NAME" => GetMessage("INTASK_L_TASKSTATUS"), "FULL_NAME" => GetMessage("INTASK_L_TASKSTATUS"), "FILTERABLE" => true);
     $arResult["TaskFieldsMap"] = CIntranetTasks::GetTaskFieldsMap($arResult["TaskFields"]);
     $arResult["TaskFieldsMap"]["TASKSTATUS"] = "TASKSTATUS";
     $arTaskStatusOldLink = array();
     $arTaskStatusOldLinkMap = array("NOTACCEPTED" => "NotAccepted", "NOTSTARTED" => "NotStarted", "INPROGRESS" => "InProgress", "COMPLETED" => "Closed", "WAITING" => "Waiting", "DEFERRED" => "Deferred");
     $dbRes = CIBlockProperty::GetPropertyEnum("TaskStatus", array("SORT" => "ASC"), array("IBLOCK_ID" => $iblockId));
     while ($arRes = $dbRes->Fetch()) {
         $arTaskStatusOldLink[$arRes["ID"]] = $arTaskStatusOldLinkMap[strtoupper($arRes["XML_ID"])];
     }
 }
 /**************************  ACTIONS  **********************************/
 if (strlen($arResult["FatalError"]) <= 0) {
     if (isset($_GET['bx_task_action_request']) && $_GET['bx_task_action_request'] == 'Y') {
         define("BX_INTASKS_FROM_COMPONENT", true);
         $GLOBALS["APPLICATION"]->RestartBuffer();