Esempio n. 1
0
        $File = rTrim($Upload['Name'], '.gz');
        #---------------------------------------------------------------------------
        $File = PathInfo($File);
        #---------------------------------------------------------------------------
        switch (StrToLower($File['extension'])) {
            case 'xml':
                #-----------------------------------------------------------------------
                $Data = String_XML_Parse($Data);
                if (Is_Exception($Data)) {
                    return SPrintF('Ошибка чтения базы данных: (%s)', $Data->String);
                }
                #-----------------------------------------------------------------------
                break;
            case 'serialize':
                #-----------------------------------------------------------------------
                $Data = UnSerialize($Data);
                if (!$Data) {
                    return 'Ошибка чтения базы данных';
                }
                #-----------------------------------------------------------------------
                break;
            default:
                return 'Не верный формат файла';
        }
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$Data = $Data->ToArray('User', 'Contract', 'Invoice', 'HostingOrder', 'DomainOrder', 'Ticket', 'Message');
#-------------------------------------------------------------------------------
Esempio n. 2
0
         if (StrLen($strSectionId) > 0) {
             $arResult["Urls"]["TasksList"] .= StrPos($arResult["Urls"]["TasksList"], "?") === false ? "?" : "&";
             $arResult["Urls"]["TasksList"] .= $strSectionId;
         }
     }
 } else {
     $arResult["Urls"]["ChangeView"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS"], array("owner_id" => $ownerId));
     if (StrPos($arResult["Urls"]["ChangeView"], "?") === false) {
         $arResult["Urls"]["ChangeView"] .= "?user_settings_id=";
     } else {
         $arResult["Urls"]["ChangeView"] .= "&user_settings_id=";
     }
     $arResult["Views"] = array();
     $dbUserOptionsList = CUserOptions::GetList(array("ID" => "ASC"), array("USER_ID_EXT" => $GLOBALS["USER"]->GetID(), "CATEGORY" => $userSettingsCategory));
     while ($arUserOptionTmp = $dbUserOptionsList->Fetch()) {
         $val = UnSerialize($arUserOptionTmp["VALUE"]);
         if ($val["IBLOCK_ID"] != $iblockId || $val["TASK_TYPE"] != $taskType || $val["OWNER_ID"] != $ownerId) {
             continue;
         }
         $id = IntVal(SubStr($arUserOptionTmp["NAME"], $userSettingsNamePartLength));
         $arResult["Views"][] = array("ID" => $id, "TITLE" => HtmlSpecialCharsbx($val["TITLE"]));
     }
     if (Count($arResult["Views"]) <= 0) {
         __InTaskInstallViews($iblockId, $taskType, $ownerId);
     }
     $userSettingsId = IntVal($arParams["USER_SETTINGS_ID"]);
     if (StrLen($arParams["USER_SETTINGS_ID"]) <= 0) {
         $userSettingsId = IntVal($_REQUEST["user_settings_id"]);
         if (StrLen($_REQUEST["user_settings_id"]) <= 0 && Array_Key_Exists("INTASK_TASKVIEW_current_view", $_SESSION) && Is_Array($_SESSION["INTASK_TASKVIEW_current_view"]) && Array_Key_Exists($taskType . "-" . $ownerId, $_SESSION["INTASK_TASKVIEW_current_view"])) {
             $userSettingsId = IntVal($_SESSION["INTASK_TASKVIEW_current_view"][$taskType . "-" . $ownerId]);
         }