Exemplo n.º 1
0
 private static function getSortedItems(\CDBResult $result, $userId, $groupId, $prevTaskSort, $prevTaskId, $sourceId, $targetId)
 {
     $items = array();
     $itemIndex = -1;
     $prevTaskIndex = null;
     $targetFound = false;
     while ($row = $result->fetch()) {
         if ($sourceId == $row["ID"]) {
             //Skip source task
             continue;
         }
         if ($prevTaskIndex !== null) {
             $items[$prevTaskIndex]["NEXT_TASK_ID"] = $row["ID"];
         }
         $prevTaskSort += static::SORT_INDEX_INCREMENT;
         $fields = array("TASK_ID" => $row["ID"], "SORT" => $prevTaskSort, "PREV_TASK_ID" => $prevTaskId, "NEXT_TASK_ID" => 0);
         if ($groupId) {
             $fields["GROUP_ID"] = $groupId;
         } else {
             $fields["USER_ID"] = $userId;
         }
         $items[++$itemIndex] = $fields;
         $prevTaskIndex = $itemIndex;
         $prevTaskId = $row["ID"];
         if ($targetId == $row["ID"]) {
             $targetFound = true;
             break;
         }
     }
     return array($items, $targetFound);
 }
Exemplo n.º 2
0
                        unset($arResult["arComments"][$key]);
                    }
                }
            }
            $tmp = reset($arResult["arComments"]);
            $request = \Bitrix\Main\Context::getCurrent()->getRequest();
            $rating_entity_type = $tmp["EVENT"]["RATING_TYPE_ID"] ?: false;
            $lastLogTs = (int) $request->getQuery("lastLogTs");
            $db_res = new CDBResult();
            $db_res->InitFromArray($arResult["arComments"]);
            //$db_res->NavNum = 1;
            //$db_res->NavStart(10, false);
            $records = array();
            $arEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arLog["EVENT_ID"]);
            $offset = CTimeZone::GetOffset();
            while (($arComment = $db_res->fetch()) && $arComment) {
                $commentId = $arComment["EVENT"]["SOURCE_ID"] ? $arComment["EVENT"]["SOURCE_ID"] : $arComment["EVENT"]["ID"];
                $timestamp = $arComment["LOG_DATE_TS"];
                $datetime_formatted = CSocNetLogComponent::getDateTimeFormatted($timestamp, array("DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "DATE_TIME_FORMAT_WITHOUT_YEAR" => $arParams["DATE_TIME_FORMAT_WITHOUT_YEAR"], "TIME_FORMAT" => $arParams["TIME_FORMAT"]));
                ob_start();
                ?>
<script>
					top.arLogCom<?php 
                echo $arLog["ID"];
                echo $commentId;
                ?>
 = '<?php 
                echo $arComment["EVENT"]["ID"];
                ?>
';<?php 
                ?>
Exemplo n.º 3
0
    $result->NavStart();
}
$result->NavRecordCount = $totalCount;
$result->NavPageCount = $totalPage;
$result->NavPageNomer = $page;
$arResult["NAV_OBJECT"] = $result;
$arResult["ROWS_COUNT"] = $result->SelectedRowsCount();
$arResult["ELEMENTS_ROWS"] = array();
$arAvailableStatuses = array("200", "304", "603", "404", "486", "503", "480", "402", "1", "2", "3");
$bModuleCatalog = false;
if (CModule::IncludeModule("catalog")) {
    $bModuleCatalog = true;
}
$arUserIds = array();
$portalNumbers = CVoxImplantConfig::GetPortalNumbers();
while ($data = $result->fetch()) {
    $data = CVoxImplantHistory::PrepereData($data);
    if ($data["PORTAL_USER_ID"] > 0 && !in_array($data["PORTAL_USER_ID"], $arUserIds)) {
        $arUserIds[] = $data["PORTAL_USER_ID"];
    }
    if (in_array($data["CALL_FAILED_CODE"], array(1, 2, 3, 409))) {
        $data["CALL_FAILED_REASON"] = GetMessage("TELEPHONY_STATUS_" . $data["CALL_FAILED_CODE"]);
    }
    if (isset($portalNumbers[$data["PORTAL_NUMBER"]])) {
        $data["PORTAL_NUMBER"] = $portalNumbers[$data["PORTAL_NUMBER"]];
    } else {
        if (substr($data["PORTAL_NUMBER"], 0, 3) == 'sip') {
            $data["PORTAL_NUMBER"] = GetMessage("TELEPHONY_PORTAL_PHONE_SIP_OFFICE", array('#ID#' => substr($data["PORTAL_NUMBER"], 3)));
        } else {
            if (substr($data["PORTAL_NUMBER"], 0, 3) == 'reg') {
                $data["PORTAL_NUMBER"] = GetMessage("TELEPHONY_PORTAL_PHONE_SIP_CLOUD", array('#ID#' => substr($data["PORTAL_NUMBER"], 3)));