// Don't format time, if it's 00:00 if (date('H:i', $arData['FROM_VALUE']) == '00:00') { $strDateFrom = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $arData['FROM_VALUE']); } else { $strDateFrom = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $arData['FROM_VALUE']); } } if ($arData['TO_VALUE']) { // Don't format time, if it's 00:00 if (date('H:i', $arData['TO_VALUE']) == '00:00') { $strDateTo = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATE), $arData['TO_VALUE']); } else { $strDateTo = FormatDate(CDatabase::DateFormatToPHP(FORMAT_DATETIME), $arData['TO_VALUE']); } } $arResult = array('td1' => '<span class="task-log-date">' . FormatDateFromDB($arData['CREATED_DATE']) . '</span>', 'td2' => '<a class="task-log-author" target="_top" href="' . CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_PROFILE'], array('user_id' => $authorUserId)) . '">' . htmlspecialcharsbx(tasksFormatNameShort($arCurUserData["NAME"], $arCurUserData["LAST_NAME"], $arCurUserData["LOGIN"], $arCurUserData["SECOND_NAME"], $arParams["NAME_TEMPLATE"])) . '</a>', 'td3' => '<span class="task-log-where">' . GetMessage("TASKS_LOG_DEADLINE") . '</span>', 'td4' => '<span class="task-log-what">' . $strDateFrom . '<span class="task-log-arrow">→</span>' . $strDateTo . '</span>'); header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET); echo CUtil::PhpToJsObject($arResult); } } elseif ($action === 'remove_file') { try { CTaskAssert::log('remove_file: fileId=' . $_POST['fileId'] . ', taskId=' . $_POST['taskId'] . ', userId=' . $loggedInUserId, CTaskAssert::ELL_INFO); CTaskAssert::assert(isset($_POST['fileId'], $_POST['taskId'])); $oTaskItem = new CTaskItem($_POST['taskId'], $loggedInUserId); $oTaskItem->removeAttachedFile($_POST['fileId']); echo 'Success'; } catch (Exception $e) { echo 'Error occured'; CTaskAssert::logWarning('Unable to remove_file: fileId=' . $_POST['fileId'] . ', taskId=' . $_POST['taskId'] . ', userId=' . $loggedInUserId); } } elseif ($action === 'render_task_detail_part') {
$arResult["Requests"]["List"] = false; while ($arRequests = $dbRequests->GetNext()) { if ($arResult["Requests"]["List"] == false) { $arResult["Requests"]["List"] = array(); } $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arRequests["USER_ID"])); $canViewProfile = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arRequests["USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin()); if (intval($arRequests["USER_PERSONAL_PHOTO"]) <= 0) { switch ($arRequests["USER_PERSONAL_GENDER"]) { case "M": $suffix = "male"; break; case "F": $suffix = "female"; break; default: $suffix = "unknown"; } $arRequests["USER_PERSONAL_PHOTO"] = COption::GetOptionInt("socialnetwork", "default_user_picture_" . $suffix, false, SITE_ID); } $arImage = CSocNetTools::InitImage($arRequests["USER_PERSONAL_PHOTO"], 150, "/bitrix/images/socialnetwork/nopic_user_150.gif", 150, $pu, $canViewProfile); $arResult["Requests"]["List"][] = array("ID" => $arRequests["ID"], "USER_ID" => $arRequests["USER_ID"], "USER_NAME" => $arRequests["USER_NAME"], "USER_LAST_NAME" => $arRequests["USER_LAST_NAME"], "USER_SECOND_NAME" => $arRequests["USER_SECOND_NAME"], "USER_LOGIN" => $arRequests["USER_LOGIN"], "USER_PERSONAL_PHOTO" => $arRequests["USER_PERSONAL_PHOTO"], "USER_PERSONAL_PHOTO_FILE" => $arImage["FILE"], "USER_PERSONAL_PHOTO_IMG" => $arImage["IMG"], "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "DATE_CREATE" => FormatDateFromDB($arRequests["DATE_CREATE"]), "MESSAGE" => $parser->convert($arRequests["~MESSAGE"], false, array(), array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "Y", "UPLOAD" => "N", "NL2BR" => "N"))); } $arResult["NAV_STRING"] = $dbRequests->GetPageNavStringEx($navComponentObject, GetMessage("SONET_C12_NAV"), "", false); } } } } } } $this->IncludeComponentTemplate();
function __SLEGetLogCommentRecord($arComments, $arParams, &$arAssets) { // for the same post log_update - time only, if not - date and time $timestamp = MakeTimeStamp(array_key_exists("LOG_DATE_FORMAT", $arComments) ? $arComments["LOG_DATE_FORMAT"] : $arComments["LOG_DATE"]); $timeFormated = FormatDateFromDB($arComments["LOG_DATE"], stripos($arParams["DATE_TIME_FORMAT"], 'a') || ($arParams["DATE_TIME_FORMAT"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'HH:MI'); $dateTimeFormated = FormatDate(!empty($arParams['DATE_TIME_FORMAT']) ? $arParams['DATE_TIME_FORMAT'] == 'FULL' ? $GLOBALS['DB']->DateFormatToPHP(str_replace(':SS', '', FORMAT_DATETIME)) : $arParams['DATE_TIME_FORMAT'] : $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATETIME), $timestamp); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $dateTimeFormated = ToLower($dateTimeFormated); } // strip current year if (!empty($arParams['DATE_TIME_FORMAT']) && ($arParams['DATE_TIME_FORMAT'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT'] == 'j F Y g:i a')) { $dateTimeFormated = ltrim($dateTimeFormated, '0'); $curYear = date('Y'); $dateTimeFormated = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $dateTimeFormated); } $path2Entity = $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arComments["ENTITY_ID"])) : CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["ENTITY_ID"])); if (intval($arComments["USER_ID"]) > 0) { $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arComments["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : ""; $arTmpUser = array("NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"]); $bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false; $arCreatedBy = array("FORMATTED" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $bUseLogin) . $suffix, "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["USER_ID"], "id" => $arComments["USER_ID"]))); $arCreatedBy["TOOLTIP_FIELDS"] = array("ID" => $arComments["USER_ID"], "NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"], "USE_THUMBNAIL_LIST" => "N", "PATH_TO_SONET_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"], "PATH_TO_SONET_USER_PROFILE" => $arParams["PATH_TO_USER"], "PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"] . $suffix, "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "INLINE" => "Y"); } else { $arCreatedBy = array("FORMATTED" => GetMessage("SONET_C73_CREATED_BY_ANONYMOUS")); } $arTmpUser = array("NAME" => $arComments["~USER_NAME"], "LAST_NAME" => $arComments["~USER_LAST_NAME"], "SECOND_NAME" => $arComments["~USER_SECOND_NAME"], "LOGIN" => $arComments["~USER_LOGIN"]); $arParamsTmp = $arParams; $arParamsTmp["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"]; $arTmpCommentEvent = array("EVENT" => $arComments, "LOG_DATE" => $arComments["LOG_DATE"], "LOG_DATE_TS" => MakeTimeStamp($arComments["LOG_DATE"]), "LOG_DATE_DAY" => ConvertTimeStamp(MakeTimeStamp($arComments["LOG_DATE"]), "SHORT"), "LOG_TIME_FORMAT" => $timeFormated, "LOG_DATETIME_FORMAT" => $dateTimeFormated, "TITLE_TEMPLATE" => "", "TITLE" => "", "TITLE_FORMAT" => "", "ENTITY_NAME" => $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? $arComments["GROUP_NAME"] : CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin), "ENTITY_PATH" => $path2Entity, "CREATED_BY" => $arCreatedBy, "AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arComments, $arParamsTmp)); $arEvent = CSocNetLogTools::FindLogCommentEventByID($arComments["EVENT_ID"]); if ($arEvent && array_key_exists("CLASS_FORMAT", $arEvent) && array_key_exists("METHOD_FORMAT", $arEvent)) { $arLog = $arParams["USER_COMMENTS"] == "Y" ? array() : array("TITLE" => $arComments["~LOG_TITLE"], "URL" => $arComments["~LOG_URL"], "PARAMS" => $arComments["~LOG_PARAMS"]); $arFIELDS_FORMATTED = call_user_func(array($arEvent["CLASS_FORMAT"], $arEvent["METHOD_FORMAT"]), $arComments, $arParams, false, $arLog); if ($arParams["USE_COMMENTS"] != "Y") { if (array_key_exists("CREATED_BY", $arFIELDS_FORMATTED) && isset($arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"])) { $arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] = $arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"]; } } } $message = $arFIELDS_FORMATTED && array_key_exists("EVENT_FORMATTED", $arFIELDS_FORMATTED) && array_key_exists("MESSAGE", $arFIELDS_FORMATTED["EVENT_FORMATTED"]) ? $arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"] : $arTmpCommentEvent["EVENT"]["MESSAGE"]; if (strlen($message) > 0) { $arFIELDS_FORMATTED["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] = CSocNetTextParser::closetags(htmlspecialcharsback($message)); } if (is_array($arTmpCommentEvent)) { $arFIELDS_FORMATTED["EVENT_FORMATTED"]["DATETIME"] = $arTmpCommentEvent["LOG_DATE_DAY"] == ConvertTimeStamp() ? $timeFormated : $dateTimeFormated; $arTmpCommentEvent["EVENT_FORMATTED"] = $arFIELDS_FORMATTED["EVENT_FORMATTED"]; if (isset($arComments["UF"]["UF_SONET_COM_URL_PRV"]) && !empty($arComments["UF"]["UF_SONET_COM_URL_PRV"]["VALUE"])) { $arCss = $GLOBALS["APPLICATION"]->sPath2css; $arJs = $GLOBALS["APPLICATION"]->arHeadScripts; ob_start(); $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:system.field.view", $arComments["UF"]["UF_SONET_COM_URL_PRV"]["USER_TYPE_ID"], array("arUserField" => $arComments["UF"]["UF_SONET_COM_URL_PRV"], "arAddField" => array("NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "PATH_TO_USER" => $arParams["~PATH_TO_USER"])), null, array("HIDE_ICONS" => "Y")); $urlPreviewText = ob_get_clean(); $arTmpCommentEvent["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] .= $urlPreviewText; $arAssets["CSS"] = array_merge($arAssets["CSS"], array_diff($GLOBALS["APPLICATION"]->sPath2css, $arCss)); $arAssets["JS"] = array_merge($arAssets["JS"], array_diff($GLOBALS["APPLICATION"]->arHeadScripts, $arJs)); unset($arComments["UF"]["UF_SONET_COM_URL_PRV"]); } $arTmpCommentEvent["UF"] = $arComments["UF"]; if (isset($arTmpCommentEvent["EVENT_FORMATTED"]) && is_array($arTmpCommentEvent["EVENT_FORMATTED"])) { $arFields2Cache = array("DATETIME", "MESSAGE", "FULL_MESSAGE_CUT", "ERROR_MSG"); foreach ($arTmpCommentEvent["EVENT_FORMATTED"] as $field => $value) { if (!in_array($field, $arFields2Cache)) { unset($arTmpCommentEvent["EVENT_FORMATTED"][$field]); } } } if (isset($arTmpCommentEvent["EVENT"]) && is_array($arTmpCommentEvent["EVENT"])) { if (!empty($arTmpCommentEvent["EVENT"]["URL"])) { $arTmpCommentEvent["EVENT"]["URL"] = str_replace("#GROUPS_PATH#", COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID), $arTmpCommentEvent["EVENT"]["URL"]); } $arFields2Cache = array("ID", "SOURCE_ID", "EVENT_ID", "USER_ID", "LOG_DATE", "RATING_TYPE_ID", "RATING_ENTITY_ID", "URL"); foreach ($arTmpCommentEvent["EVENT"] as $field => $value) { if (!in_array($field, $arFields2Cache)) { unset($arTmpCommentEvent["EVENT"][$field]); } } } if (isset($arTmpCommentEvent["CREATED_BY"]) && is_array($arTmpCommentEvent["CREATED_BY"])) { $arFields2Cache = array("TOOLTIP_FIELDS", "FORMATTED", "URL"); foreach ($arTmpCommentEvent["CREATED_BY"] as $field => $value) { if (!in_array($field, $arFields2Cache)) { unset($arTmpCommentEvent["CREATED_BY"][$field]); } } if (isset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"]) && is_array($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"])) { $arFields2Cache = array("ID", "PATH_TO_SONET_USER_PROFILE", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "EMAIL"); foreach ($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] as $field => $value) { if (!in_array($field, $arFields2Cache)) { unset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"][$field]); } } } } } foreach ($arTmpCommentEvent["EVENT"] as $key => $value) { if (strpos($key, "~") === 0) { unset($arTmpCommentEvent["EVENT"][$key]); } } return $arTmpCommentEvent; }
$arRecord[$key] .= '<a href="/bitrix/tools/bizproc_show_file.php?bp_id=' . $arParams['BP_ID'] . '&iblock_id=' . $arParams['BLOCK_ID'] . '&f=' . urlencode($key) . '&i=' . $file['ID'] . '">' . htmlspecialcharsbx($file['ORIGINAL_NAME']) . '</a>'; } } } if (is_array($arRecord[$key])) { $ar = $arRecord[$key]; $arRecord[$key] = ""; foreach ($ar as $val) { if (strlen($arRecord[$key]) > 0) { $arRecord[$key] .= ", "; } $arRecord[$key] .= $val; } } if (CheckDateTime($arRecord[$key])) { $arRecord[$key] = FormatDateFromDB($arRecord[$key]); } } $arResult["BP"] = $arRecord; } else { $arResult["FatalErrorMessage"] .= GetMessage("BPWC_WLC_WRONG_BP") . ". "; } } if (strlen($arResult["FatalErrorMessage"]) <= 0) { $arCurrentUserGroups = $GLOBALS["USER"]->GetUserGroupArray(); if ("user_" . $GLOBALS["USER"]->GetID() == $arResult["BP"]["CREATED_BY"]) { $arCurrentUserGroups[] = "author"; } $documentId = array("bizproc", "CBPVirtualDocument", $arResult["BP"]["ID"]); $arDocumentStates = CBPDocument::GetDocumentStates($documentType, $documentId); foreach ($arDocumentStates as $arDocumentState) {
$data["CREATED_BY"] = "[" . $data["CREATED_BY"] . "] " . $data["CREATED_USER_NAME"]; } if (isset($data["MODIFIED_BY"])) { $data["MODIFIED_BY"] = "[" . $data["MODIFIED_BY"] . "] " . $data["USER_NAME"]; } if (isset($data["ACTIVE_FROM"])) { $data['ACTIVE_FROM'] = FormatDateFromDB($data['ACTIVE_FROM']); } if (isset($data["ACTIVE_TO"])) { $data['ACTIVE_TO'] = FormatDateFromDB($data['ACTIVE_TO']); } if (isset($data["DATE_CREATE"])) { $data['DATE_CREATE'] = FormatDateFromDB($data['DATE_CREATE']); } if (isset($data["TIMESTAMP_X"])) { $data['TIMESTAMP_X'] = FormatDateFromDB($data['TIMESTAMP_X']); } if (CModule::IncludeModule("bizproc")) { $documentStates = CBPDocument::GetDocumentStates(BizProcDocument::generateDocumentComplexType($arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"]), BizProcDocument::getDocumentComplexId($arIBlock["IBLOCK_TYPE_ID"], $data["ID"])); if ($arResult["PROCESSES"] && $arResult["USE_COMMENTS"]) { if (!empty($documentStates)) { $stateTemporary = current($documentStates); $data["WORKFLOW_ID"] = $stateTemporary["ID"]; } else { $data["WORKFLOW_ID"] = ''; } } } $arUserGroupsForBPTmp = $arUserGroupsForBP; if ($USER->GetID() == $data["CREATED_BY"]) { $arUserGroupsForBPTmp[] = "Author";
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } $bHasTitle = true; if (strlen($arResult['MEETING']['TITLE']) <= 0) { $arResult['MEETING']['TITLE'] = GetMessage('ME_TITLE_DEFAULT'); $bHasTitle = false; } $tdef = htmlspecialcharsbx(CUtil::JSEscape(GetMessage('ME_TITLE_DEFAULT'))); if ($arResult['MEETING']['DATE_START'] && MakeTimeStamp($arResult['MEETING']['DATE_START']) > 0) { $date = MakeTimeStamp($arResult['MEETING']['DATE_START']); $date_date = FormatDateFromDB(ConvertTimeStamp($date, 'SHORT'), 'SHORT'); $date_time = FormatDate(IsAmPmMode() ? 'h:i a' : 'H:i', $date); } else { $date = $date_date = $date_time = ''; } $duration = intval($arResult['MEETING']['DURATION']); $duration_coef = 60; if ($duration % 3600 == 0) { $duration_coef = 3600; } $duration = intval($duration / $duration_coef); $keeper = 0; foreach ($arResult['MEETING']['USERS'] as $USER_ID => $USER_ROLE) { if ($USER_ROLE == CMeeting::ROLE_KEEPER) { $keeper = $USER_ID; } } $this->SetViewTarget('pagetitle', 100);
$dbRecordsList = CBPTaskService::GetList($gridSort["sort"], $arFilter, false, $gridOptions->GetNavParams(), $arSelectFields); while ($arRecord = $dbRecordsList->GetNext()) { $arRecord['MODIFIED'] = FormatDateFromDB($arRecord['MODIFIED']); $arRecord["DOCUMENT_URL"] = CBPDocument::GetDocumentAdminPage($arRecord["PARAMETERS"]["DOCUMENT_ID"]); $arRecord["MODULE_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][0]; $arRecord["ENTITY"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][1]; $arRecord["DOCUMENT_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][2]; $arRecord["URL"] = array("~TASK" => CComponentEngine::MakePathFromTemplate($arParams["~TASK_EDIT_URL"], $arRecord), "TASK" => CComponentEngine::MakePathFromTemplate($arParams["TASK_EDIT_URL"], $arRecord)); if (array_key_exists("DESCRIPTION", $arRecord)) { $arRecord["DESCRIPTION"] = nl2br($arRecord["DESCRIPTION"]); } if (count(array_intersect($arSelectFields, array("WORKFLOW_NAME", "WORKFLOW_STATE", "WORKFLOW_STARTED", "WORKFLOW_STARTED_BY"))) > 0) { $arState = CBPStateService::GetWorkflowState($arRecord["WORKFLOW_ID"]); $arRecord["WORKFLOW_NAME"] = $arState["TEMPLATE_NAME"]; $arRecord["WORKFLOW_STATE"] = $arState["STATE_TITLE"]; $arRecord["WORKFLOW_STARTED"] = FormatDateFromDB($arState["STARTED_FORMATTED"]); $arRecord["WORKFLOW_STARTED_BY"] = ""; if (intval($arState["STARTED_BY"]) > 0) { $dbUserTmp = CUser::GetByID($arState["STARTED_BY"]); $arUserTmp = $dbUserTmp->GetNext(); $arRecord["WORKFLOW_STARTED_BY"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true); $arRecord["WORKFLOW_STARTED_BY"] .= " [" . $arState["STARTED_BY"] . "]"; } } $aActions = array(array("ICONCLASS" => "edit", "DEFAULT" => true, "TEXT" => GetMessage("BPTL_C_DETAIL"), "ONCLICK" => "window.location='" . $arRecord["URL"]["TASK"] . "';")); if (strlen($arRecord["DOCUMENT_URL"]) > 0) { $aActions[] = array("ICONCLASS" => "", "DEFAULT" => false, "TEXT" => GetMessage("BPTL_C_DOCUMENT"), "ONCLICK" => "window.open('" . $arRecord["DOCUMENT_URL"] . "');"); } $arResult["RECORDS"][] = array("data" => $arRecord, "actions" => $aActions, "columns" => $aCols, "editable" => false); } $arResult["ROWS_COUNT"] = $dbRecordsList->SelectedRowsCount();
<ul class="bx-mylist-form-results"> <?php $i = 0; foreach ($arResult['RESULTS'][$FORM_ID] as $arRes) { ?> <li class="bx-mylist-row-<?php echo $i++ % 2; ?> "><div class="bx-mylist-form-status"><span class="<?php echo $arRes["STATUS_CSS"]; ?> "><?php echo $arRes["STATUS_TITLE"]; ?> </span></div> <div class="bx-mylist-form-data"><span class="bx-mylist-form-date intranet-date"><?php echo FormatDateFromDB($arRes['DATE_CREATE'], 'SHORT'); ?> </span> <a href="<?php echo $arRes['__LINK']; ?> "><?php echo GetMessage('FRLM_RESULT') . $arRes['ID']; echo $arRes['__TITLE'] ? ': ' . htmlspecialcharsbx($arRes['__TITLE']) : ''; ?> </a></div></li> <?php } ?> </ul> <?php if ($arForm['__LINK']) {
if (array_key_exists("NAME_LIST_FORMATTED", $arParams) && strlen(trim($arParams['NAME_LIST_FORMATTED'])) > 0) { $arResult["User"]["NAME_FORMATTED"] = trim($arParams['NAME_LIST_FORMATTED']); } else { $arResult["User"]["NAME_FORMATTED"] = CUser::FormatName($arParams['NAME_TEMPLATE'], $arResult["User"], $bUseLogin); } if ($bSocialNetwork) { $arResult["User"]["HTML_ID"] = $arParams["HTML_ID"]; } if (strlen($arParams["HREF"]) > 0) { $arResult["User"]["HREF"] = $arParams["~HREF"]; } $arResult["bSocialNetwork"] = $bSocialNetwork; if (strlen($arParams["DESCRIPTION"]) > 0) { $arResult["User"]["NAME_DESCRIPTION"] = $arParams["~DESCRIPTION"]; if (CheckDateTime($arResult["User"]["NAME_DESCRIPTION"])) { $arResult["User"]["NAME_DESCRIPTION"] = FormatDateFromDB($arResult["User"]["NAME_DESCRIPTION"]); } } } elseif ($arParams['AJAX_CALL'] == 'INFO') { $APPLICATION->RestartBuffer(); while (@ob_end_clean()) { } header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET); echo CUtil::PhpToJsObject(array('RESULT' => $arResult)); die; } if ($arParams["AJAX_ONLY"] != "Y") { ob_start(); $this->IncludeComponentTemplate(); $sReturn = ob_get_contents(); if ($arParams["DO_RETURN"] == "Y") {
public function formatDate($rawDate, $format = 'FULL') { return FormatDateFromDB($rawDate, $format); }
/** * Use component main.post.list to work with LiveFeed * @param int $commentId Comment ID which needs to send. * @param array $arParams Array of settings (DATE_TIME_FORMAT, SHOW_RATING, PATH_TO_USER, AVATAR_SIZE, NAME_TEMPLATE, SHOW_LOGIN) * @return string */ public static function addLiveComment($commentId = 0, $arParams = array()) { $res = ""; if ($commentId > 0 && CModule::IncludeModule("pull") && \CPullOptions::GetNginxStatus() && ($comment = CBlogComment::GetByID($commentId)) && ($arPost = CBlogPost::GetByID($comment["POST_ID"]))) { global $DB, $APPLICATION; $arParams["DATE_TIME_FORMAT"] = isset($arParams["DATE_TIME_FORMAT"]) ? $arParams["DATE_TIME_FORMAT"] : $DB->DateFormatToPHP(CSite::GetDateFormat("FULL")); $arParams["SHOW_RATING"] = $arParams["SHOW_RATING"] == "N" ? "N" : "Y"; $arParams["PATH_TO_USER"] = isset($arParams["PATH_TO_USER"]) ? $arParams["PATH_TO_USER"] : ''; $arParams["AVATAR_SIZE_COMMENT"] = $arParams["AVATAR_SIZE_COMMENT"] > 0 ? $arParams["AVATAR_SIZE_COMMENT"] : ($arParams["AVATAR_SIZE"] > $arParams["AVATAR_SIZE"] ? $arParams["AVATAR_SIZE"] : 58); $arParams["NAME_TEMPLATE"] = isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat(); $arParams["SHOW_LOGIN"] = $arParams["SHOW_LOGIN"] == "N" ? "N" : "Y"; $comment["DateFormated"] = FormatDateFromDB($comment["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true); $timestamp = MakeTimeStamp($comment["DATE_CREATE"]); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $comment["DateFormated"] = ToLower($comment["DateFormated"]); } $comment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $commentId, LANGUAGE_ID); $arAuthor = CBlogUser::GetUserInfo($comment["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"])); if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) { $image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arParams["AVATAR_SIZE_COMMENT"], "height" => $arParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT); $arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]); } $p = new blogTextParser(false, ''); $ufCode = "UF_BLOG_COMMENT_FILE"; if (is_array($comment["UF"][$ufCode])) { $p->arUserfields = array($ufCode => array_merge($comment["UF"][$ufCode], array("TAG" => "DOCUMENT ID"))); } $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y"); $arParserParams = array("imageWidth" => 800, "imageHeight" => 800); $comment["TextFormated"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams); $p->bMobile = true; $comment["TextFormatedMobile"] = $p->convert($comment["POST_TEXT"], false, array(), $arAllow, $arParserParams); $comment["TextFormatedJS"] = CUtil::JSEscape(htmlspecialcharsBack($comment["POST_TEXT"])); $comment["TITLE"] = CUtil::JSEscape(htmlspecialcharsBack($comment["TITLE"])); $eventHandlerID = AddEventHandler("main", "system.field.view.file", array("CSocNetLogTools", "logUFfileShow")); $res = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("TEMPLATE_ID" => 'BLOG_COMMENT_BG_', "RATING_TYPE_ID" => $arParams["SHOW_RATING"] == "Y" ? "BLOG_COMMENT" : "", "ENTITY_XML_ID" => "BLOG_" . $arPost["ID"], "RECORDS" => array($commentId => array("ID" => $comment["ID"], "NEW" => $arParams["FOLLOW"] != "N" && $comment["NEW"] == "Y" ? "Y" : "N", "APPROVED" => $comment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH ? "Y" : "N", "POST_TIMESTAMP" => $timestamp, "POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "AUTHOR" => array("ID" => $arAuthor["ID"], "NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "AVATAR" => $arAuthor["PERSONAL_PHOTO_resized"]["src"]), "FILES" => false, "UF" => $comment["UF"], "~POST_MESSAGE_TEXT" => $comment["POST_TEXT"], "WEB" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormated"], "AFTER" => <<<HTML <script>top.text{$commentId} = text{$commentId} = '{$comment["TextFormatedJS"]}';top.title{$commentId} = title{$commentId} = '{$comment["TITLE"]}';top.arComFiles{$commentId} = [];</script> HTML ), "MOBILE" => array("POST_TIME" => $comment["DATE_CREATE_TIME"], "POST_DATE" => $comment["DateFormated"], "CLASSNAME" => "", "POST_MESSAGE_TEXT" => $comment["TextFormatedMobile"]))), "NAV_STRING" => "", "NAV_RESULT" => "", "PREORDER" => "N", "RIGHTS" => array("MODERATE" => "N", "EDIT" => "N", "DELETE" => "N"), "VISIBLE_RECORDS_COUNT" => 1, "ERROR_MESSAGE" => "", "OK_MESSAGE" => "", "RESULT" => $commentId, "PUSH&PULL" => array("ACTION" => "REPLY", "ID" => $commentId), "MODE" => "PULL_MESSAGE", "VIEW_URL" => "", "EDIT_URL" => "", "MODERATE_URL" => "", "DELETE_URL" => "", "AUTHOR_URL" => "", "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "DATE_TIME_FORMAT" => "", "LAZYLOAD" => "", "NOTIFY_TAG" => "", "NOTIFY_TEXT" => "", "SHOW_MINIMIZED" => "Y", "SHOW_POST_FORM" => "", "IMAGE_SIZE" => "", "mfi" => ""), array(), null); if ($eventHandlerID !== false && intval($eventHandlerID) > 0) { RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID); } } return $res; }
} ?> ></span> <span class="timeman-comment-body"> <div class="timeman-comment-header"> <span class="timeman-comment-createdby"> <a href="<?php echo $res["AUTHOR_URL"]; ?> "><?php echo $res["AUTHOR_NAME"]; ?> </a> </span> <span class="timeman-comment-time"><?php echo FormatDateFromDB($res["POST_DATE"]); ?> </span> </div> <div class="timeman-comment-content"> <div class="timeman-message-full timeman-message-show"> <?php echo $res["POST_MESSAGE_HTML"]; ?> </div> </div> </span> </div> <?php } ?>
$arRecord["MODULE_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][0]; $arRecord["ENTITY"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][1]; $arRecord["DOCUMENT_ID"] = $arRecord["PARAMETERS"]["DOCUMENT_ID"][2]; if (empty($arRecord['DOCUMENT_NAME'])) { $arRecord['DOCUMENT_NAME'] = GetMessage("BPATL_DOCUMENT_NAME"); } $arRecord["URL"] = array("~TASK" => CComponentEngine::MakePathFromTemplate($arParams["~TASK_EDIT_URL"], $arRecord), "TASK" => CComponentEngine::MakePathFromTemplate($arParams["TASK_EDIT_URL"], $arRecord)); if (array_key_exists("DESCRIPTION", $arRecord)) { $arRecord["DESCRIPTION"] = nl2br($arRecord["DESCRIPTION"]); } if (isset($arRecord['WORKFLOW_TEMPLATE_NAME'])) { $arRecord["WORKFLOW_NAME"] = $arRecord["WORKFLOW_TEMPLATE_NAME"]; } // compatibility if (isset($arRecord['WORKFLOW_STARTED'])) { $arRecord["WORKFLOW_STARTED"] = FormatDateFromDB($arRecord["WORKFLOW_STARTED"]); } if (!empty($arRecord['WORKFLOW_STARTED_BY'])) { $tmpUserId = (int) $arRecord['WORKFLOW_STARTED_BY']; $arRecord["WORKFLOW_STARTED_BY"] = ""; if ($tmpUserId > 0) { $dbUserTmp = CUser::GetByID($tmpUserId); $arUserTmp = $dbUserTmp->fetch(); $arRecord["WORKFLOW_STARTED_BY"] = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true); $arRecord["WORKFLOW_STARTED_BY"] .= " [" . $tmpUserId . "]"; } } if (!$arRecord["IS_MY"]) { $arRecord["URL"]["TASK"] = CHTTP::urlAddParams($arRecord["URL"]["TASK"], array('USER_ID' => $targetUserId)); if (isset($arRecord['PARAMETERS']['AccessControl']) && $arRecord['PARAMETERS']['AccessControl'] == 'Y') { $arRecord["DESCRIPTION"] = '';
</div> </div> </div> </div> </div> </div><?php } ?> <table cellspacing="0" class="bx-group-layout"> <tr> <td class="bx-group-layout-column bx-group-layout-left-column"><?php echo GetMessage("SONET_C6_CREATED"); ?> :</td> <td class="bx-group-layout-column bx-group-layout-right-column"><?php echo FormatDateFromDB($arResult["Group"]["DATE_CREATE"], $arParams["DATE_TIME_FORMAT"], true); ?> </td> </tr> <tr> <td class="bx-group-layout-column bx-group-layout-left-column"><?php echo GetMessage("SONET_C6_NMEM"); ?> :</td> <td class="bx-group-layout-column bx-group-layout-right-column"><?php echo $arResult["Group"]["NUMBER_OF_MEMBERS"]; ?> </td> </tr> <tr> <td class="bx-group-layout-column bx-group-layout-left-column"><?php
if (!empty($arNextHistory)) { $iNextHistoryId = $arNextHistory['ID']; } $arResult['ELEMENT'] = $arHistoryResult['DOCUMENT']['FIELDS']; $arResult['ELEMENT']['~DETAIL_TEXT'] = $arResult['ELEMENT']['DETAIL_TEXT']; if (is_array($arHistoryResult['DOCUMENT']['PROPERTIES']['IMAGES']['VALUE'])) { foreach ($arHistoryResult['DOCUMENT']['PROPERTIES']['IMAGES']['VALUE'] as $_sImg) { $arResult['ELEMENT']['IMAGES'][strtolower(bx_basename($_sImg))] = $_sImg; } } $arParams['ELEMENT_ID'] = $arHistoryResult['DOCUMENT']['FIELDS']['ID']; $rsUser = CUser::GetByID($arHistoryResult['USER_ID']); $arUser = $rsUser->Fetch(); $arResult['VERSION'] = array(); $arResult['VERSION']['USER_LOGIN'] = CWikiUtils::GetUserLogin($arUser, $arParams["NAME_TEMPLATE"]); $arResult['VERSION']['MODIFIED'] = FormatDateFromDB($arHistoryResult['MODIFIED']); if ($iCurHistoryId != $historyId) { $arResult['VERSION']['CUR_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iCurHistoryId)); } if (!empty($iPrevHistoryId)) { $arResult['VERSION']['PREV_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iPrevHistoryId)); } if (!empty($iNextHistoryId)) { $arResult['VERSION']['NEXT_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $iNextHistoryId)); } $arHp = array('oldid' => $historyId, 'sessid' => bitrix_sessid()); if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') { $arHp[$arParams['OPER_VAR']] = 'history'; } $arResult['VERSION']['CANCEL_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp); }
protected function createDataExcel() { $obList = new CList($this->arIBlock["ID"]); $gridOptions = new CGridOptions($this->arResult["GRID_ID"]); $gridColumns = $gridOptions->GetVisibleColumns(); $gridSort = $gridOptions->GetSorting(array("sort" => array("name" => "asc"))); $this->arResult["ELEMENTS_HEADERS"] = array(); $arSelect = array("ID", "IBLOCK_ID"); $arProperties = array(); $this->arResult["FIELDS"] = $arListFields = $obList->GetFields(); foreach ($arListFields as $fieldId => $arField) { if (!count($gridColumns) || in_array($fieldId, $gridColumns)) { if (substr($fieldId, 0, 9) == "PROPERTY_") { $arProperties[] = $fieldId; } else { $arSelect[] = $fieldId; } } if ($fieldId == "CREATED_BY") { $arSelect[] = "CREATED_USER_NAME"; } if ($fieldId == "MODIFIED_BY") { $arSelect[] = "USER_NAME"; } $this->arResult["ELEMENTS_HEADERS"][$fieldId] = array("name" => htmlspecialcharsex($arField["NAME"]), "default" => true, "sort" => $arField["MULTIPLE"] == "Y" ? "" : $fieldId); } if (!count($gridColumns) || in_array("IBLOCK_SECTION_ID", $gridColumns)) { $arSelect[] = "IBLOCK_SECTION_ID"; } $this->arResult["ELEMENTS_HEADERS"]["IBLOCK_SECTION_ID"] = array("name" => Loc::getMessage("CC_BLL_COLUMN_SECTION"), "default" => true, "sort" => false); /* FILTER */ $sections = array(); foreach ($this->arResult["LIST_SECTIONS"] as $id => $name) { $sections[$id] = $name; } $this->arResult["FILTER"] = array(array("id" => "list_section_id", "type" => "list", "items" => $sections, "filtered" => $this->arResult["SECTION_ID"] !== false, "filter_value" => $this->arResult["SECTION_ID"], "value" => $this->arResult["SECTION_ID"])); $i = 1; $arFilterable = array(); $arDateFilter = array(); foreach ($arListFields as $fieldId => $arField) { if ($arField["TYPE"] == "ACTIVE_FROM" || $arField["TYPE"] == "ACTIVE_TO") { $this->arResult["FILTER"][$i] = array("id" => "DATE_" . $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "date"); $arFilterable["DATE_" . $fieldId] = ""; $arDateFilter["DATE_" . $fieldId] = true; } elseif ($arField["TYPE"] == "DATE_CREATE" || $arField["TYPE"] == "TIMESTAMP_X") { $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "date"); $arFilterable[$fieldId] = ""; $arDateFilter[$fieldId] = true; } elseif (is_array($arField["PROPERTY_USER_TYPE"]) && array_key_exists("GetPublicFilterHTML", $arField["PROPERTY_USER_TYPE"])) { $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "custom", "enable_settings" => false, "value" => call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicFilterHTML"], array($arField, array("VALUE" => $fieldId, "FORM_NAME" => "filter_" . $this->arResult["GRID_ID"], "GRID_ID" => $this->arResult["GRID_ID"])))); $arFilterable[$fieldId] = ""; } elseif ($arField["TYPE"] == "SORT" || $arField["TYPE"] == "N") { $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "number"); $arFilterable[$fieldId] = ""; } elseif ($arField["TYPE"] == "G") { $items = array(); $prop_secs = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $arField["LINK_IBLOCK_ID"])); while ($ar_sec = $prop_secs->Fetch()) { $items[$ar_sec["ID"]] = str_repeat(". ", $ar_sec["DEPTH_LEVEL"] - 1) . $ar_sec["NAME"]; } $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "list", "items" => $items, "params" => array("size" => 5, "multiple" => "multiple"), "valign" => "top"); $arFilterable[$fieldId] = ""; } elseif ($arField["TYPE"] == "E") { //Should be handled in template $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "E", "value" => $arField); $arFilterable[$fieldId] = ""; } elseif ($arField["TYPE"] == "L") { $items = array(); $propEnums = CIBlockProperty::GetPropertyEnum($arField["ID"]); while ($arEnum = $propEnums->Fetch()) { $items[$arEnum["ID"]] = $arEnum["VALUE"]; } $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"]), "type" => "list", "items" => $items, "params" => array("size" => 5, "multiple" => "multiple"), "valign" => "top"); $arFilterable[$fieldId] = ""; } elseif (in_array($arField["TYPE"], array("S", "S:HTML", "NAME", "DETAIL_TEXT", "PREVIEW_TEXT"))) { $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"])); $arFilterable[$fieldId] = "?"; } else { $this->arResult["FILTER"][$i] = array("id" => $fieldId, "name" => htmlspecialcharsex($arField["NAME"])); $arFilterable[$fieldId] = ""; } $i++; } $arFilter = array(); $gridFilter = $gridOptions->GetFilter($this->arResult["FILTER"]); foreach ($gridFilter as $key => $value) { if (substr($key, -5) == "_from") { $op = ">="; $newKey = substr($key, 0, -5); } elseif (substr($key, -3) == "_to") { $op = "<="; $newKey = substr($key, 0, -3); if (array_key_exists($newKey, $arDateFilter)) { if (!preg_match("/\\d\\d:\\d\\d:\\d\\d\$/", $value)) { $value .= " 23:59:59"; } } } else { $op = ""; $newKey = $key; } if (array_key_exists($newKey, $arFilterable)) { if ($op == "") { $op = $arFilterable[$newKey]; } $arFilter[$op . $newKey] = $value; } } $arFilter["IBLOCK_ID"] = $this->arIBlock["ID"]; if (!$this->arResult["ANY_SECTION"]) { $arFilter["SECTION_ID"] = $this->arResult["SECTION_ID"]; } $rsElements = CIBlockElement::GetList($gridSort["sort"], $arFilter, false, false, $arSelect); $this->arResult["EXCEL_COLUMN_NAME"] = array(); $this->arResult["EXCEL_CELL_VALUE"] = array(); $count = 0; while ($obElement = $rsElements->GetNextElement()) { $data = $obElement->GetFields(); $propertyArray = $obElement->GetProperties(); if (!empty($arProperties)) { foreach ($propertyArray as $arProp) { $fieldId = "PROPERTY_" . $arProp["ID"]; if (in_array($fieldId, $arProperties)) { $arField = $this->arResult["FIELDS"][$fieldId]; if (is_array($arField["PROPERTY_USER_TYPE"]) && is_array($arField["PROPERTY_USER_TYPE"]["GetPublicViewHTML"])) { if (is_array($arProp["~VALUE"])) { foreach ($arProp["~VALUE"] as $propValue) { $data[$fieldId][] = call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicViewHTML"], array($arField, array("VALUE" => $propValue), array())); } } else { $data[$fieldId] = call_user_func_array($arField["PROPERTY_USER_TYPE"]["GetPublicViewHTML"], array($arField, array("VALUE" => $arProp["~VALUE"]), array())); } } elseif ($arField["PROPERTY_TYPE"] == "L") { $data[$fieldId] = htmlspecialcharsex($arProp["VALUE_ENUM"]); } elseif ($arField["PROPERTY_TYPE"] == "F") { $files = is_array($arProp["VALUE"]) ? $arProp["VALUE"] : array($arProp["VALUE"]); foreach ($files as $file) { $value = CFile::MakeFileArray($file); $data[$fieldId] .= $value["name"] . "\r\n"; } } else { $data[$fieldId] = htmlspecialcharsex($arProp["VALUE"]); } } } if (!empty($data["IBLOCK_SECTION_ID"])) { if (array_key_exists($data["IBLOCK_SECTION_ID"], $this->arResult["SECTIONS"])) { $data["IBLOCK_SECTION_ID"] = $this->arResult["SECTIONS"][$data["IBLOCK_SECTION_ID"]]["NAME"]; } } if (in_array("BIZPROC", $gridColumns)) { $data["BIZPROC"] = $this->getArrayBizproc($data); } } if (isset($data["CREATED_BY"])) { $data["CREATED_BY"] = "[" . $data["CREATED_BY"] . "] " . $data["CREATED_USER_NAME"]; } if (isset($data["MODIFIED_BY"])) { $data["MODIFIED_BY"] = "[" . $data["MODIFIED_BY"] . "] " . $data["USER_NAME"]; } if (isset($data["ACTIVE_FROM"])) { $data['ACTIVE_FROM'] = FormatDateFromDB($data['ACTIVE_FROM']); } if (isset($data["ACTIVE_TO"])) { $data['ACTIVE_TO'] = FormatDateFromDB($data['ACTIVE_TO']); } if (isset($data["DATE_CREATE"])) { $data['DATE_CREATE'] = FormatDateFromDB($data['DATE_CREATE']); } if (isset($data["TIMESTAMP_X"])) { $data['TIMESTAMP_X'] = FormatDateFromDB($data['TIMESTAMP_X']); } foreach ($gridColumns as $position => $id) { $this->arResult["EXCEL_CELL_VALUE"][$count][$position] = is_array($data[$id]) ? implode('/', $data[$id]) : $data[$id]; $this->arResult["EXCEL_COLUMN_NAME"][$position] = $this->arResult["ELEMENTS_HEADERS"][$id]["name"]; } $count++; } }
</tr> <tr valign="bottom"> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100px"> <label for="ACTIVE_TO"><?php echo GetMessage("INTR_ABSENCE_ACTIVE_TO"); ?> </label> </td> <td> <?php $input_value_to = ""; if (isset($arElement["ACTIVE_TO"]) || isset($_POST["ACTIVE_TO"])) { $input_value_to = isset($arElement["ACTIVE_TO"]) ? htmlspecialcharsbx(FormatDateFromDB($arElement["ACTIVE_TO"])) : htmlspecialcharsbx(FormatDateFromDB($_POST["ACTIVE_TO"])); } $APPLICATION->IncludeComponent("bitrix:main.calendar", "", array("SHOW_INPUT" => "Y", "FORM_NAME" => "", "INPUT_NAME" => "ACTIVE_TO", "INPUT_VALUE" => $input_value_to, "SHOW_TIME" => "Y", "HIDE_TIMEBAR" => "Y")); ?> </td> </tr> </table> </td> </tr> </table> <?php echo bitrix_sessid_post(); ?> </form> <?php }
?> </th> <th class="task-time-comment-column"><?php echo GetMessage("TASKS_ELAPSED_COMMENT"); ?> </th> </tr> <?php foreach ($arResult["ELAPSED_TIME"] as $time) { ?> <tr id="elapsed-time-<?php echo $time["ID"]; ?> "> <td class="task-time-date-column"><span class="task-time-date"><?php echo FormatDateFromDB($time["CREATED_DATE"]); ?> </span></td> <td class="task-time-author-column"><script type="text/javascript">BX.tooltip(<?php echo $time["USER_ID"]; ?> , "anchor_elapsed_<?php echo $anchor_id; ?> ", "");</script><a id="anchor_elapsed_<?php echo $anchor_id; ?> " class="task-log-author" target="_top" href="<?php echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PROFILE"], array("user_id" => $time["USER_ID"])); ?> "><?php
function AddLiveComment($commentId = 0, $path = "", $arParams = array()) { if (IntVal($commentId) <= 0) { return; } if (CModule::IncludeModule("pull") && CPullOptions::GetNginxStatus() && ($arComment = CBlogComment::GetByID($commentId)) && ($arPost = CBlogPost::GetByID($arComment["POST_ID"]))) { if (strlen($path) <= 0 && strlen($arComment["PATH"]) > 0) { $path = CComponentEngine::MakePathFromTemplate($arComment["PATH"], array("post_id" => $arComment["POST_ID"], "comment_id" => $commentId)); } if (strlen($path) <= 0) { $path = CComponentEngine::MakePathFromTemplate($arPost["PATH"], array("post_id" => $arComment["POST_ID"], "comment_id" => $commentId)) . "?commentId=" . $commentId; } $arFormatParams = array("PATH_TO_USER" => isset($arParams["PATH_TO_USER"]) ? $arParams["PATH_TO_USER"] : '', "PATH_TO_POST" => $path, "NAME_TEMPLATE" => isset($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat(), "SHOW_LOGIN" => isset($arParams["SHOW_LOGIN"]) ? $arParams["SHOW_LOGIN"] : true, "AVATAR_SIZE_COMMENT" => isset($arParams["AVATAR_SIZE_COMMENT"]) ? $arParams["AVATAR_SIZE_COMMENT"] : 58, "PATH_TO_SMILE" => isset($arParams["PATH_TO_SMILE"]) ? $arParams["PATH_TO_SMILE"] : '', "DATE_TIME_FORMAT" => isset($arParams["DATE_TIME_FORMAT"]) ? $arParams["DATE_TIME_FORMAT"] : '', "SHOW_RATING" => isset($arParams["SHOW_RATING"]) ? $arParams["SHOW_RATING"] : '', "RATING_TYPE" => "like"); $arComment["DateFormated"] = FormatDateFromDB($arComment["DATE_CREATE"], $arFormatParams["DATE_TIME_FORMAT"], true); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $arComment["DateFormated"] = ToLower($arComment["DateFormated"]); } $arComment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("BLOG_COMMENT", $commentId, LANGUAGE_ID); $arAuthor = CBlogUser::GetUserInfo($arComment["AUTHOR_ID"], $arFormatParams["PATH_TO_USER"], array("AVATAR_SIZE_COMMENT" => $arFormatParams["AVATAR_SIZE_COMMENT"])); if (IsModuleInstalled('extranet') && CModule::IncludeModule('socialnetwork')) { CSocNetTools::InitGlobalExtranetArrays(); } $arTmpUser = array("NAME" => $arAuthor["~NAME"], "LAST_NAME" => $arAuthor["~LAST_NAME"], "SECOND_NAME" => $arAuthor["~SECOND_NAME"], "LOGIN" => $arAuthor["~LOGIN"], "NAME_LIST_FORMATTED" => ""); $arAuthor["NAME_FORMATED"] = CUser::FormatName($arFormatParams["NAME_TEMPLATE"], $arTmpUser, $arFormatParams["SHOW_LOGIN"] != "N"); if (intval($arAuthor["PERSONAL_PHOTO"]) > 0) { $image_resize = CFile::ResizeImageGet($arAuthor["PERSONAL_PHOTO"], array("width" => $arFormatParams["AVATAR_SIZE_COMMENT"], "height" => $arFormatParams["AVATAR_SIZE_COMMENT"]), BX_RESIZE_IMAGE_EXACT); $arAuthor["PERSONAL_PHOTO_RESIZED"] = array("src" => $image_resize["src"]); } $p = new blogTextParser(false, ''); $ufCode = "UF_BLOG_COMMENT_FILE"; if (is_array($arComment["UF"][$ufCode])) { $p->arUserfields = array($ufCode => array_merge($arComment["UF"][$ufCode], array("TAG" => "DOCUMENT ID"))); } $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "SHORT_ANCHOR" => "Y"); $arParserParams = array("imageWidth" => 800, "imageHeight" => 800); $arComment["TextFormated"] = $p->convert($arComment["POST_TEXT"], false, array(), $arAllow, $arParserParams); $p->bMobile = true; $arComment["TextFormatedMobile"] = $p->convert($arComment["POST_TEXT"], false, array(), $arAllow, $arParserParams); if ($perm >= BLOG_PERMS_MODERATE) { if ($arComment["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) { $arComment["CAN_HIDE"] = "Y"; } else { $arComment["CAN_SHOW"] = "Y"; } } else { $arComment["CAN_SHOW"] = $arComment["CAN_HIDE"] = "N"; } $urlToPost = CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFormatParams["PATH_TO_POST"]), array("post_id" => "#source_post_id#", "user_id" => $arPost["AUTHOR_ID"])); $urlToPost .= strpos($urlToPost, "?") !== false ? "&" : "?"; $arUrl = array("LINK" => $urlToPost, "SHOW" => $urlToPost . "show_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "HIDE" => $urlToPost . "hide_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "DELETE" => $urlToPost . "delete_comment_id=#comment_id#&comment_post_id=#post_id#&" . bitrix_sessid_get(), "USER" => htmlspecialcharsback($arFormatParams["PATH_TO_USER"])); CRatingsComponentsMain::GetShowRating($arFormatParams); if ($arFormatParams["SHOW_RATING"] == "Y") { $arRating = CRatings::GetRatingVoteResult('BLOG_COMMENT', array($arComment["ID"])); } $arCommentParams = array("ID" => $commentId, "ENTITY_XML_ID" => "BLOG_" . $arPost["ID"], "FULL_ID" => array("BLOG_" . $arPost["ID"], $commentId), "ACTION" => "REPLY", "APPROVED" => "Y", "PANELS" => array("EDIT" => "N", "MODERATE" => "N", "DELETE" => "N"), "NEW" => "Y", "AUTHOR" => array("ID" => $GLOBALS["USER"]->GetID(), "NAME" => $arAuthor["NAME_FORMATED"], "URL" => $arAuthor["url"], "E-MAIL" => $arComment["AuthorEmail"], "AVATAR" => $arAuthor["PERSONAL_PHOTO_resized"]["src"], "IS_EXTRANET" => is_array($GLOBALS["arExtranetUserID"]) && in_array($GLOBALS["USER"]->GetID(), $GLOBALS["arExtranetUserID"])), "POST_TIMESTAMP" => $arComment["DATE_CREATE_TS"], "POST_TIME" => $arComment["DATE_CREATE_TIME"], "POST_DATE" => $arComment["DateFormated"], "POST_MESSAGE_TEXT" => $arComment["TextFormated"], "POST_MESSAGE_TEXT_MOBILE" => $arComment["TextFormatedMobile"], "URL" => array("LINK" => str_replace(array("##comment_id#", "#comment_id#"), array("", $commentId), $arUrl["LINK"]), "EDIT" => "__blogEditComment('" . $commentId . "', '" . $arPost["ID"] . "');", "MODERATE" => str_replace(array("#source_post_id#", "#post_id#", "#comment_id#", "&" . bitrix_sessid_get()), array($arPost["ID"], $arPost["ID"], $commentId, ""), $arComment["CAN_SHOW"] == "Y" ? $arUrl["SHOW"] : ($arComment["CAN_HIDE"] == "Y" ? $arUrl["HIDE"] : "")), "DELETE" => str_replace(array("#source_post_id#", "#post_id#", "#comment_id#", "&" . bitrix_sessid_get()), array($arPost["ID"], $arPost["ID"], $commentId, ""), $arUrl["DELETE"])), "AFTER" => "", "BEFORE_ACTIONS_MOBILE" => "", "AFTER_MOBILE" => ""); if ($arFormatParams["SHOW_RATING"] == "Y") { $arRatingData = array("ENTITY_TYPE_ID" => "BLOG_COMMENT", "ENTITY_ID" => $commentId, "OWNER_ID" => $arComment["AUTHOR_ID"], "USER_VOTE" => $arRating[$commentId]["USER_VOTE"], "USER_HAS_VOTED" => $arRating[$commentId]["USER_HAS_VOTED"], "TOTAL_VOTES" => $arRating[$commentId]["TOTAL_VOTES"], "TOTAL_POSITIVE_VOTES" => $arRating[$commentId]["TOTAL_POSITIVE_VOTES"], "TOTAL_NEGATIVE_VOTES" => $arRating[$commentId]["TOTAL_NEGATIVE_VOTES"], "TOTAL_VALUE" => $arRating[$commentId]["TOTAL_VALUE"], "PATH_TO_USER_PROFILE" => $arUrl["USER"]); ob_start(); $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", $arFormatParams["RATING_TYPE"], $arRatingData, false, array("HIDE_ICONS" => "Y")); $arCommentParams["BEFORE_ACTIONS"] = ob_get_clean(); ob_start(); $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:rating.vote", "mobile_comment_" . $arFormatParams["RATING_TYPE"], $arRatingData, false, array("HIDE_ICONS" => "Y")); $arCommentParams["BEFORE_ACTIONS_MOBILE"] = ob_get_clean(); } $arUFResult = self::BuildUFFields($arComment["UF"]); $arCommentParams["AFTER"] .= $arUFResult["AFTER"]; $arCommentParams["AFTER_MOBILE"] .= $arUFResult["AFTER_MOBILE"]; if ($arComment["CAN_EDIT"] == "Y") { ob_start(); ?> <script> top.text<?php echo $commentId; ?> = text<?php echo $commentId; ?> = '<?php echo CUtil::JSEscape(htmlspecialcharsBack($arComment["POST_TEXT"])); ?> '; top.title<?php echo $commentId; ?> = title<?php echo $commentId; ?> = '<?php echo isset($arComment["TITLE"]) ? CUtil::JSEscape($arComment["TITLE"]) : ''; ?> '; top.arComFiles<?php echo $commentId; ?> = [];<?php ?> </script><?php $arCommentParams["AFTER"] .= ob_get_clean(); } CPullWatch::AddToStack('UNICOMMENTSBLOG_' . $arPost["ID"], array('module_id' => 'unicomments', 'command' => 'comment', 'params' => $arCommentParams)); } }
function getDateTime($strDate) { return FormatDateFromDB($strDate, CSite::GetDateFormat('FULL', LANGUAGE_ID)); }
{ $comment_id = $_REQUEST["cid"]; if ($arComment = CSocNetLogComments::GetByID($comment_id)) { $arResult["arComment"] = $arComment; $dateFormated = FormatDate( $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATE), MakeTimeStamp(array_key_exists("LOG_DATE_FORMAT", $arComment) ? $arComment["LOG_DATE_FORMAT"] : $arComment["LOG_DATE"]) ); $timeFormat = (isset($_REQUEST["dtf"]) ? $_REQUEST["dtf"] : CSite::GetTimeFormat()); $timeFormated = FormatDateFromDB( (array_key_exists("LOG_DATE_FORMAT", $arComment) ? $arComment["LOG_DATE_FORMAT"] : $arComment["LOG_DATE"]), (stripos($timeFormat, 'a') || ($timeFormat == 'FULL' && IsAmPmMode()) !== false ? 'H:MI T' : 'HH:MI') ); if (intval($arComment["USER_ID"]) > 0) { $arParams = array( "PATH_TO_USER" => $_REQUEST["p_user"], "NAME_TEMPLATE" => $_REQUEST["nt"], "SHOW_LOGIN" => $_REQUEST["sl"], "AVATAR_SIZE" => $_REQUEST["as"], "PATH_TO_SMILE" => $_REQUEST["p_smile"] ); $arUser = array( "ID" => $arComment["USER_ID"], "NAME" => $arComment["~CREATED_BY_NAME"],
if (strlen($arDocumentState["STATE_MODIFIED"]) > 0) { $iCountRow++; ?> <tr class="<?php echo $iCountRow == 1 ? "bizproc-item-row-first" : ""; ?> <?php echo empty($arTasks) && empty($arEvents) && empty($arDocumentState["TEMPLATE_PARAMETERS"]) && strlen($arDocumentState["STATE_NAME"]) <= 0 ? "bizproc-item-row-last" : ""; ?> "> <td class="bizproc-field-name"><?php echo GetMessage("IBEL_BIZPROC_DATE"); ?> :</td> <td class="bizproc-field-value"><?php echo FormatDateFromDB($arDocumentState["STATE_MODIFIED"]); ?> </td> </tr> <?php } ?> <?php if (strlen($arDocumentState["STATE_NAME"]) > 0) { $iCountRow++; ?> <tr class="<?php echo $iCountRow == 1 ? "bizproc-item-row-first" : ""; ?> <?php echo empty($arTasks) && empty($arEvents) && empty($arDocumentState["TEMPLATE_PARAMETERS"]) ? "bizproc-item-row-last" : "";
$arHistory['CANCEL_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp); if ($arHistoryFirst['ID'] != $arHistory['ID']) { $arHp = array('diffid' => $arHistoryFirst['ID'], 'oldid' => $arHistory['ID']); if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') { $arHp[$arParams['OPER_VAR']] = 'history_diff'; } $arHistory['CUR_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY_DIFF'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp); } if (CWikiUtils::IsDeleteable()) { $arHp = array('oldid' => $arHistory['ID'], 'sessid' => bitrix_sessid(), 'delete' => 1); if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') { $arHp[$arParams['OPER_VAR']] = 'history'; } $arHistory['DELETE_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp); } $arHistory['MODIFIED'] = FormatDateFromDB($arHistory['MODIFIED']); $arResult['HISTORY'][] = $arHistory; $iPrev = count($arResult['HISTORY']) - 2; if (isset($arResult['HISTORY'][$iPrev])) { $arHp = array('diffid' => $arResult['HISTORY'][$iPrev]['ID'], 'oldid' => $arHistory['ID']); if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') { $arHp[$arParams['OPER_VAR']] = 'history_diff'; } $arResult['HISTORY'][$iPrev]['PREV_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY_DIFF'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arHp); } } $CACHE_MANAGER->StartTagCache($this->GetCachePath()); $CACHE_MANAGER->RegisterTag('wiki_' . $arParams['ELEMENT_ID']); $CACHE_MANAGER->EndTagCache(); $this->IncludeComponentTemplate(); }
$arComment["DateFormated"] = ToLower($arComment["DateFormated"]); $arComment["DATE_CREATE_DATE"] = ToLower($arComment["DATE_CREATE_DATE"]); } // strip current year if (!empty($arParams['DATE_TIME_FORMAT_S']) && ($arParams['DATE_TIME_FORMAT_S'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT_S'] == 'j F Y g:i a')) { $arComment["DateFormated"] = ltrim($arComment["DateFormated"], '0'); $arComment["DATE_CREATE_DATE"] = ltrim($arComment["DATE_CREATE_DATE"], '0'); $curYear = date('Y'); $arComment["DateFormated"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arComment["DateFormated"]); $arComment["DATE_CREATE_DATE"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arComment["DATE_CREATE_DATE"]); } if ($arParams["MOBILE"] == "Y") { $timestamp = MakeTimeStamp($arComment["DATE_CREATE"]); $arComment["DATE_CREATE_TIME"] = FormatDate(GetMessage("SONET_SBPC_MOBILE_FORMAT_TIME"), $timestamp); } else { $arComment["DATE_CREATE_TIME"] = FormatDateFromDB($arComment["DATE_CREATE"], strpos($arParams["DATE_TIME_FORMAT_S"], 'a') !== false || ($arParams["DATE_TIME_FORMAT_S"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'GG:MI'); } $arResult["CommentsResult"][] = $arComment; $arResult["IDS"][] = $arComment["ID"]; $arFieldsHave = array(); if ($arComment["HAS_PROPS"] == "") { $arFieldsHave["HAS_PROPS"] = $bHasProps ? "Y" : "N"; } if (!empty($arFieldsHave)) { CBlogComment::Update($arComment["ID"], $arFieldsHave, false); } $i++; } while ($i < count($arCommentsAll) && ($arComment = $arCommentsAll[$i])); } unset($arResult["MESSAGE"]); unset($arResult["ERROR_MESSAGE"]);
} $arResult["Post"]["DATE_PUBLISH_FORMATED"] = FormatDateFromDB($arResult["Post"]["DATE_PUBLISH"], $arParams["DATE_TIME_FORMAT"], true); $arResult["Post"]["DATE_PUBLISH_DATE"] = FormatDateFromDB($arResult["Post"]["DATE_PUBLISH"], FORMAT_DATE); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $arResult["Post"]["DATE_PUBLISH_FORMATED"] = ToLower($arResult["Post"]["DATE_PUBLISH_FORMATED"]); $arResult["Post"]["DATE_PUBLISH_DATE"] = ToLower($arResult["Post"]["DATE_PUBLISH_DATE"]); } // strip current year if (!empty($arParams['DATE_TIME_FORMAT_S']) && ($arParams['DATE_TIME_FORMAT_S'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT_S'] == 'j F Y g:i a')) { $arResult["Post"]["DATE_PUBLISH_FORMATED"] = ltrim($arResult["Post"]["DATE_PUBLISH_FORMATED"], '0'); $arResult["Post"]["DATE_PUBLISH_DATE"] = ltrim($arResult["Post"]["DATE_PUBLISH_DATE"], '0'); $curYear = date('Y'); $arResult["Post"]["DATE_PUBLISH_FORMATED"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arResult["Post"]["DATE_PUBLISH_FORMATED"]); $arResult["Post"]["DATE_PUBLISH_DATE"] = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $arResult["Post"]["DATE_PUBLISH_DATE"]); } $arResult["Post"]["DATE_PUBLISH_TIME"] = FormatDateFromDB($arResult["Post"]["DATE_PUBLISH"], strpos($arParams["DATE_TIME_FORMAT_S"], 'a') !== false || ($arParams["DATE_TIME_FORMAT_S"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'GG:MI'); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $arResult["Post"]["DATE_PUBLISH_TIME"] = ToLower($arResult["Post"]["DATE_PUBLISH_TIME"]); } $arResult["arUser"] = CBlogUser::GetUserInfo($arPost["AUTHOR_ID"], $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"], "AVATAR_SIZE_COMMENT" => $arParams["AVATAR_SIZE_COMMENT"])); $arResult["arUser"]["isExtranet"] = intval($arPost["AUTHOR_ID"]) > 0 && is_array($GLOBALS["arExtranetUserID"]) && in_array($arPost["AUTHOR_ID"], $GLOBALS["arExtranetUserID"]); $arResult["Post"]["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["AUTHOR_ID"])); if (strlen($arPost["CATEGORY_ID"]) > 0) { $bHasTag = true; $arCategory = explode(",", $arPost["CATEGORY_ID"]); $dbCategory = CBlogCategory::GetList(array(), array("@ID" => $arCategory)); while ($arCatTmp = $dbCategory->Fetch()) { $arCatTmp["~NAME"] = $arCatTmp["NAME"]; $arCatTmp["NAME"] = htmlspecialcharsEx($arCatTmp["NAME"]); $arCatTmp["urlToCategory"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SEARCH_TAG"], array("tag" => urlencode($arCatTmp["NAME"]))); $arResult["Category"][] = $arCatTmp;
$arResult["NAV"] = $results; while ($row = $results->NavNext()) { if (!isset($arUsersTmp[$row['USER_ID']])) { $arUserInfo = array(); $rsUser = CUser::GetList($by = "", $ord = "", array("ID_EQUAL_EXACT" => intval($row['USER_ID'])), array("FIELDS" => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'PERSONAL_PHOTO'))); if ($arUser = $rsUser->GetNext()) { $arUserInfo["ID"] = $row['USER_ID']; $arUserInfo["FULL_NAME"] = CUser::FormatName($nameFormat, $arUser, true, false); $arUserInfo['avatar'] = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_EXACT, false); $arUsersTmp[$row['USER_ID']] = $arUserInfo; } } else { $arUserInfo = $arUsersTmp[$row['USER_ID']]; } $dateFormated = FormatDateFromDB($row["TIMESTAMP_X"], $dateFormat); $time = FormatDateFromDB($row["TIMESTAMP_X"], $timeFormat); foreach ($arModuleObjects as $key => $val) { if (isset($arObjectTypes[$key][$row['AUDIT_TYPE_ID']])) { $res = $val->GetEventInfo($row, $arParams, $arUserInfo, $arResult["ActiveFeatures"]); $res['time'] = $time; $res['user'] = array("name" => $arUserInfo["FULL_NAME"], "id" => $arUserInfo["ID"], "avatar" => $arUserInfo["avatar"]["src"]); $arResult['EVENT'][$dateFormated][] = $res; break; } } } } } else { $arResult["NO_ACTIVE_FEATURES"] = true; } $this->IncludeComponentTemplate();
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } if (!$this->__component->__parent || $this->__component->__parent->__name != "bitrix:webdav") { $GLOBALS['APPLICATION']->SetAdditionalCSS('/bitrix/components/bitrix/webdav/templates/.default/style.css'); } $GLOBALS['APPLICATION']->AddHeadScript('/bitrix/js/webdav/quickedit.js'); if (!empty($arResult["ERROR_MESSAGE"])) { ShowError($arResult["ERROR_MESSAGE"]); } $arResult["FIELDS"] = array(); if ($arResult["SECTION"]["ID"] > 0) { $arResult["FIELDS"][] = array("id" => "NAME", "name" => GetMessage("WD_NAME"), "type" => "custom", "value" => "<div class=\"quick-view wd-toggle-edit wd-file-name\">" . $arResult["SECTION"]["NAME"] . "</div>\n\t\t<input class=\"quick-edit wd-file-name\" type=\"text\" name=\"NAME\" value=\"" . $arResult["SECTION"]["NAME"] . "\" />"); ob_start(); $APPLICATION->IncludeComponent("bitrix:main.user.link", '', array("ID" => $arResult["SECTION"]["CREATED_BY"], "HTML_ID" => "group_mods_" . $arResult["SECTION"]["CREATED_BY"], "NAME" => $arResult["USERS"][$arResult["SECTION"]["CREATED_BY"]]["NAME"], "LAST_NAME" => $arResult["USERS"][$arResult["SECTION"]["CREATED_BY"]]["LAST_NAME"], "SECOND_NAME" => $arResult["USERS"][$arResult["SECTION"]["CREATED_BY"]]["SECOND_NAME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "LOGIN" => $arResult["USERS"][$arResult["SECTION"]["CREATED_BY"]]["LOGIN"], "PROFILE_URL" => $pu, "USE_THUMBNAIL_LIST" => "Y", "THUMBNAIL_LIST_SIZE" => 28, "DESCRIPTION" => FormatDateFromDB($arResult["SECTION"]["DATE_CREATE"]), "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"]), false, array("HIDE_ICONS" => "Y")); $createdUser = ob_get_clean(); if ($arResult["SECTION"]["MODIFIED_BY"] == $arResult["SECTION"]["CREATED_BY"] && $arResult["SECTION"]["DATE_CREATE"] == $arResult["SECTION"]["TIMESTAMP_X"]) { $modifiedUser = "******"wd-modified-empty\"> </div>"; $arResult["FIELDS"][] = array("id" => "CREATED", "name" => GetMessage("WD_CREATED"), "type" => "label", "value" => "<div class=\"wd-created wd-modified\">" . $createdUser . $modifiedUser . "</div>"); } else { ob_start(); $APPLICATION->IncludeComponent("bitrix:main.user.link", '', array("ID" => $arResult["SECTION"]["MODIFIED_BY"], "HTML_ID" => "group_mods_" . $arResult["SECTION"]["MODIFIED_BY"], "DESCRIPTION" => $arResult["SECTION"]["TIMESTAMP_X"], "NAME" => $arResult["USERS"][$arResult["SECTION"]["MODIFIED_BY"]]["NAME"], "LAST_NAME" => $arResult["USERS"][$arResult["SECTION"]["MODIFIED_BY"]]["LAST_NAME"], "SECOND_NAME" => $arResult["USERS"][$arResult["SECTION"]["CREATED_BY"]]["SECOND_NAME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "LOGIN" => $arResult["USERS"][$arResult["SECTION"]["MODIFIED_BY"]]["LOGIN"], "PROFILE_URL" => $pu, "USE_THUMBNAIL_LIST" => "Y", "THUMBNAIL_LIST_SIZE" => 28, "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"]), false, array("HIDE_ICONS" => "Y")); $modifiedUser = ob_get_clean(); $arResult["FIELDS"][] = array("id" => "CREATED", "name" => GetMessage("WD_CREATED"), "type" => "label", "value" => "<div class=\"wd-created\">" . $createdUser . "</div>"); $arResult["FIELDS"][] = array("id" => "UPDATED", "name" => GetMessage("WD_LAST_UPDATE"), "type" => "label", "value" => "<div class=\"wd-modified\">" . $modifiedUser . "</div>"); } } $arResult["FIELDS"][] = array("id" => "IBLOCK_SECTION_ID", "name" => GetMessage("WD_PARENT_SECTION"), "type" => "custom"); $arResult["DATA"]["IBLOCK_SECTION_ID"] = '<select class="quick-edit" name="IBLOCK_SECTION_ID">' . '<option value="0"' . ($arResult["SECTION"]["IBLOCK_SECTION_ID"] == 0 ? ' selected=selected"' : '') . ($arResult["~SECTION"]["IBLOCK_SECTION_ID"] <= 0 ? ' class="selected"' : '') . '>' . GetMessage("WD_CONTENT") . '</option>'; $sectionName = GetMessage("WD_CONTENT");
?> <?php } ?> <?php } ?> </td> </tr> <tr> <td><b><?php echo GetMessage("FORM_TIMESTAMP"); ?> </b></td> <td><?php echo FormatDateFromDB($arResult["RESULT_TIMESTAMP_X"]); ?> </td> </tr> <?php if ($arResult["isAccessFormParams"] == "Y") { if ($arResult["isStatisticIncluded"] == "Y") { ?> <tr> <td><b><?php echo GetMessage("FORM_GUEST"); ?> </b></td> <td>[<a title="<?php echo GetMessage("FORM_GUEST_ALT"); ?>
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("BPATL_NAV"))); while ($arResultItem = $dbResultList->NavNext(true, "f_")) { $row =& $lAdmin->AddRow($f_ID . '_' . $f_USER_ID, $arResultItem); $s = $allowAdminAccess ? "&uid=" . intval($arResultItem["USER_ID"]) : ""; $row->AddField("ID", '<a href="bizproc_task.php?id=' . $f_ID . $s . '&back_url=' . urlencode($APPLICATION->GetCurPageParam("lang=" . LANGUAGE_ID, array("lang"))) . '" title="' . GetMessage("BPATL_VIEW") . '">' . $f_ID . '</a>'); $row->AddField("NAME", $f_NAME); $description = $f_DESCRIPTION; if (strlen($description) > 100) { $description = substr($description, 0, 97) . "..."; } $row->AddField("DESCRIPTION", $description); $row->AddField("DESCRIPTION_FULL", $f_DESCRIPTION); $row->AddField("MODIFIED", $f_MODIFIED); $row->AddField("WORKFLOW_NAME", $f_WORKFLOW_TEMPLATE_NAME); $row->AddField("WORKFLOW_STATE", $f_WORKFLOW_STATE); $row->AddField("WORKFLOW_STARTED", FormatDateFromDB($f_WORKFLOW_STARTED)); if (intval($f_STARTED_BY) > 0) { $dbUserTmp = CUser::GetByID($f_STARTED_BY); $arUserTmp = $dbUserTmp->fetch(); $row->AddField("WORKFLOW_STARTED_BY", CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $arUserTmp, true) . " [" . $f_STARTED_BY . "]"); } if (in_array("USER", $arVisibleColumns)) { $dbUserTmp = CUser::GetByID($arResultItem["USER_ID"]); if ($arUserTmp = $dbUserTmp->GetNext()) { $str = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $arUserTmp, true); $str .= " [" . $arResultItem["USER_ID"] . "]"; } else { $str = str_replace("#USER_ID#", $arResultItem["USER_ID"], GetMessage("BPATL_USER_NOT_FOUND")); } $row->AddField("USER", $str); }
function __SLMAjaxGetComment($comment_id, $arParams, $bCheckRights = false) { if ($arComment = CSocNetLogComments::GetByID($comment_id)) { if ($bCheckRights) { if (strpos($arComment["ENTITY_TYPE"], "CRM") === 0 && IsModuleInstalled("crm")) { $arListParams = array("IS_CRM" => "Y", "CHECK_CRM_RIGHTS" => "Y"); } else { $arListParams = array("CHECK_RIGHTS" => "Y", "USE_SUBSCRIBE" => "N"); } if (intval($arComment["LOG_ID"]) <= 0 || !($rsLog = CSocNetLog::GetList(array(), array("ID" => $arComment["LOG_ID"]), false, false, array("ID"), $arListParams)) || !($arLog = $rsLog->Fetch())) { return false; } } $arParams["DATE_TIME_FORMAT"] = $_REQUEST["dtf"]; $dateFormated = FormatDate($GLOBALS['DB']->DateFormatToPHP(FORMAT_DATE), MakeTimeStamp($arComment["LOG_DATE"])); $timeFormated = FormatDateFromDB($arComment["LOG_DATE"], stripos($arParams["DATE_TIME_FORMAT"], 'a') || ($arParams["DATE_TIME_FORMAT"] == 'FULL' && IsAmPmMode()) !== false ? 'H:MI T' : 'HH:MI'); $dateTimeFormated = FormatDate(!empty($arParams['DATE_TIME_FORMAT']) ? $arParams['DATE_TIME_FORMAT'] == 'FULL' ? $GLOBALS['DB']->DateFormatToPHP(str_replace(':SS', '', FORMAT_DATETIME)) : $arParams['DATE_TIME_FORMAT'] : $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATETIME), MakeTimeStamp($arComment["LOG_DATE"])); if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) { $dateFormated = ToLower($dateFormated); $dateTimeFormated = ToLower($dateTimeFormated); } // strip current year if (!empty($arParams['DATE_TIME_FORMAT']) && ($arParams['DATE_TIME_FORMAT'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT'] == 'j F Y g:i a')) { $dateTimeFormated = ltrim($dateTimeFormated, '0'); $curYear = date('Y'); $dateTimeFormated = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $dateTimeFormated); } if (intval($arComment["USER_ID"]) > 0) { $arParams = array("PATH_TO_USER" => $_REQUEST["p_user"], "NAME_TEMPLATE" => $_REQUEST["nt"], "SHOW_LOGIN" => $_REQUEST["sl"], "AVATAR_SIZE" => $as, "PATH_TO_SMILE" => $_REQUEST["p_smile"]); $arUser = array("ID" => $arComment["USER_ID"], "NAME" => $arComment["~CREATED_BY_NAME"], "LAST_NAME" => $arComment["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComment["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComment["~CREATED_BY_LOGIN"], "PERSONAL_PHOTO" => $arComment["~CREATED_BY_PERSONAL_PHOTO"], "PERSONAL_GENDER" => $arComment["~CREATED_BY_PERSONAL_GENDER"]); $bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false; $arCreatedBy = array("FORMATTED" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, $bUseLogin), "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComment["USER_ID"], "id" => $arComment["USER_ID"]))); } else { $arCreatedBy = array("FORMATTED" => GetMessage("SONET_SLM_CREATED_BY_ANONYMOUS")); } $arTmpCommentEvent = array("LOG_DATE" => $arComment["LOG_DATE"], "LOG_DATE_FORMAT" => $arComment["LOG_DATE_FORMAT"], "LOG_DATE_DAY" => ConvertTimeStamp(MakeTimeStamp($arComment["LOG_DATE"]), "SHORT"), "LOG_TIME_FORMAT" => $timeFormated, "MESSAGE" => $arComment["MESSAGE"], "MESSAGE_FORMAT" => $arComment["~MESSAGE"], "CREATED_BY" => $arCreatedBy, "AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arUser, $arParams, ""), "USER_ID" => $arComment["USER_ID"]); $arEventTmp = CSocNetLogTools::FindLogCommentEventByID($arComment["EVENT_ID"]); if ($arEventTmp && array_key_exists("CLASS_FORMAT", $arEventTmp) && array_key_exists("METHOD_FORMAT", $arEventTmp)) { $arComment["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("SONET_COMMENT", $arComment["ID"], LANGUAGE_ID); $arFIELDS_FORMATTED = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arComment, array_merge($arParams, array("MOBILE" => "N", "PATH_TO_USER" => COption::GetOptionString("main", "TOOLTIP_PATH_TO_USER", SITE_DIR . "company/personal/user/#user_id#/", SITE_ID)))); $arTmpCommentEvent["MESSAGE_FORMAT"] = htmlspecialcharsback($arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"]); $arFIELDS_FORMATTED = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arComment, array_merge($arParams, array("MOBILE" => "Y", "PATH_TO_USER" => SITE_DIR . "mobile/users/?user_id=#user_id#"))); $arTmpCommentEvent["MESSAGE_FORMAT_MOBILE"] = htmlspecialcharsback($arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"]); } return $arTmpCommentEvent; } }