if (!isset($arParams["PATH_TO_CONPANY_DEPARTMENT"]) || strlen($arParams["PATH_TO_CONPANY_DEPARTMENT"]) <= 0) { $arParams["PATH_TO_CONPANY_DEPARTMENT"] = "/company/structure.php?set_filter_structure=Y&structure_UF_DEPARTMENT=#ID#"; } if (!isset($arParams["PATH_TO_MESSAGES_CHAT"]) || strlen($arParams["PATH_TO_MESSAGES_CHAT"]) <= 0) { $arParams["PATH_TO_MESSAGES_CHAT"] = "/company/personal/messages/chat/#user_id#/"; } if (!isset($arParams["PATH_TO_VIDEO_CALL"]) || strlen($arParams["PATH_TO_VIDEO_CALL"]) <= 0) { $arParams["PATH_TO_VIDEO_CALL"] = "/company/personal/video/#user_id#/"; } $arParams["CACHE_TIME"] = 3600 * 24 * 365; if (strlen(trim($arParams["NAME_TEMPLATE"])) <= 0) { $arParams["NAME_TEMPLATE"] = CSite::GetNameFormat(); } $arParams['SHOW_LOGIN'] = $arParams['SHOW_LOGIN'] != "N" ? "Y" : "N"; $arParams['DATE_TIME_FORMAT_S'] = $arParams['DATE_TIME_FORMAT']; CSocNetLogComponent::processDateTimeFormatParams($arParams); // activation rating CRatingsComponentsMain::GetShowRating($arParams); $arParams["USE_CUT"] = $arParams["USE_CUT"] == "Y" ? "Y" : "N"; $arParams["IMAGE_MAX_WIDTH"] = IntVal($arParams["IMAGE_MAX_WIDTH"]); $arParams["IMAGE_MAX_HEIGHT"] = IntVal($arParams["IMAGE_MAX_HEIGHT"]); if (IntVal($arParams["IMAGE_MAX_WIDTH"]) <= 0) { $arParams["IMAGE_MAX_WIDTH"] = COption::GetOptionString("blog", "image_max_width", 600); } if (IntVal($arParams["IMAGE_MAX_HEIGHT"]) <= 0) { $arParams["IMAGE_MAX_HEIGHT"] = COption::GetOptionString("blog", "image_max_height", 600); } $arParams["ATTACHED_IMAGE_MAX_WIDTH_SMALL"] = IntVal($arParams["ATTACHED_IMAGE_MAX_WIDTH_SMALL"]) > 0 ? IntVal($arParams["ATTACHED_IMAGE_MAX_WIDTH_SMALL"]) : 70; $arParams["ATTACHED_IMAGE_MAX_HEIGHT_SMALL"] = IntVal($arParams["ATTACHED_IMAGE_MAX_HEIGHT_SMALL"]) > 0 ? IntVal($arParams["ATTACHED_IMAGE_MAX_HEIGHT_SMALL"]) : 70; $arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"] = IntVal($arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"]) > 0 ? IntVal($arParams["ATTACHED_IMAGE_MAX_WIDTH_FULL"]) : 1000; $arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"] = IntVal($arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"]) > 0 ? IntVal($arParams["ATTACHED_IMAGE_MAX_HEIGHT_FULL"]) : 1000;
if (isset($arCounters[$arResult["COUNTER_TYPE"]])) { $arResult["LOG_COUNTER"] = intval($arCounters[$arResult["COUNTER_TYPE"]]); } else { $bEmptyCounter = true; $arResult["LOG_COUNTER"] = 0; } } else { $arParams["SHOW_UNREAD"] = "N"; } if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y" && (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)) { CUserCounter::ClearByUser($user_id, array(SITE_ID, "**"), $arResult["COUNTER_TYPE"], true); CUserCounter::ClearByUser($user_id, SITE_ID, "BLOG_POST_IMPORTANT"); } if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage && (!$dateLastPageStart || $dateLastPageStart != $dateLastPage || $bNeedSetLogPage)) { $groupCode = strlen($arResult["COUNTER_TYPE"]) > 0 ? $arResult["COUNTER_TYPE"] : "**"; $bNeedSetTraffic = CSocNetLogComponent::isSetTrafficNeeded(array("PAGE_NUMBER" => $arResult["PAGE_NUMBER"], "GROUP_CODE" => $groupCode, "TRAFFIC_LAST_DATE_TS" => $arLastPageStart['TRAFFIC_LAST_DATE_TS'])); CSocNetLogPages::Set($user_id, $dateLastPage, $arParams["PAGE_SIZE"], $arResult["PAGE_NUMBER"], SITE_ID, $groupCode, $bNeedSetTraffic ? ($arLastPageStart['TRAFFIC_AVG'] + $dateFirstPageTS - $arResult["dateLastPageTS"]) / ($arLastPageStart['TRAFFIC_CNT'] + 1) : false, $bNeedSetTraffic ? $arLastPageStart['TRAFFIC_CNT'] + 1 : false); } } else { $arResult["NEED_AUTH"] = "Y"; } if (!isset($arResult["FatalError"]) && $GLOBALS["USER"]->IsAuthorized() && !$arResult["AJAX_CALL"]) { $cache = new CPHPCache(); $cache_id = "log_form_comments" . serialize($arParams["COMMENT_PROPERTY"]); $cache_path = "/sonet/log_form/comments"; if (defined("BX_COMP_MANAGED_CACHE")) { $ttl = 2592000; } else { $ttl = 600; } if ($cache->InitCache($ttl, $cache_id, $cache_path)) {
return; } $arDefaultUrlTemplates404 = array("index" => "index.php", "user_reindex" => "user_reindex.php", "user_content_search" => "user/#user_id#/search/", "user" => "user/#user_id#/", "user_current" => "user/index.php", "user_friends" => "user/#user_id#/friends/", "user_friends_add" => "user/#user_id#/friends/add/", "user_friends_delete" => "user/#user_id#/friends/delete/", "user_groups" => "user/#user_id#/groups/", "user_groups_add" => "user/#user_id#/groups/add/", "group_create" => "user/#user_id#/groups/create/", "user_profile_edit" => "user/#user_id#/edit/", "user_settings_edit" => "user/#user_id#/settings/", "user_features" => "user/#user_id#/features/", "user_subscribe" => "user/#user_id#/subscribe/", "user_requests" => "user/#user_id#/requests/", "group_request_group_search" => "group/#user_id#/group_search/", "group_request_user" => "group/#group_id#/user/#user_id#/request/", "search" => "search.php", "mail" => "mail/", "message_form" => "messages/form/#user_id#/", "message_form_mess" => "messages/chat/#user_id#/#message_id#/", "messages_chat" => "messages/chat/#user_id#/", "messages_users" => "messages/", "messages_users_messages" => "messages/#user_id#/", "messages_input" => "messages/input/", "messages_output" => "messages/output/", "messages_input_user" => "messages/input/#user_id#/", "messages_output_user" => "messages/output/#user_id#/", "user_ban" => "messages/ban/", "log" => "log/", "crm" => "crm/", "log_entry" => "log/#log_id#/", "activity" => "user/#user_id#/activity/", "subscribe" => "subscribe/", "bizproc" => "bizproc/", "bizproc_edit" => "bizproc/#task_id#/", "bizproc_task_list" => "user/#user_id#/bizproc/", "bizproc_task" => "user/#user_id#/bizproc/#task_id#/", "video_call" => "video/#user_id#/", "processes" => "processes/", "user_photo" => "user/#user_id#/photo/", "user_photo_gallery" => "user/#user_id#/photo/gallery/", "user_photo_gallery_edit" => "user/#user_id#/photo/gallery/action/#action#/", "user_photo_galleries" => "user/#user_id#/photo/galleries/", "user_photo_section" => "user/#user_id#/photo/album/#section_id#/", "user_photo_section_edit" => "user/#user_id#/photo/album/#section_id#/action/#action#/", "user_photo_section_edit_icon" => "user/#user_id#/photo/album/#section_id#/icon/action/#action#/", "user_photo_element_upload" => "user/#user_id#/photo/photo/#section_id#/action/upload/", "user_photo_element" => "user/#user_id#/photo/photo/#section_id#/#element_id#/", "user_photo_element_edit" => "user/#user_id#/photo/photo/#section_id#/#element_id#/action/#action#/", "user_photo_element_slide_show" => "user/#user_id#/photo/photo/#section_id#/#element_id#/slide_show/", "user_photofull_gallery" => "user/#user_id#/photo/gallery/#user_alias#/", "user_photofull_gallery_edit" => "user/#user_id#/photo/gallery/#user_alias#/action/#action#/", "user_photofull_section" => "user/#user_id#/photo/album/#user_alias#/#section_id#/", "user_photofull_section_edit" => "user/#user_id#/photo/album/#user_alias#/#section_id#/action/#action#/", "user_photofull_section_edit_icon" => "user/#user_id#/photo/album/#user_alias#/#section_id#/icon/action/#action#/", "user_photofull_element_upload" => "user/#user_id#/photo/photo/#user_alias#/#section_id#/action/upload/", "user_photofull_element" => "user/#user_id#/photo/photo/#user_alias#/#section_id#/#element_id#/", "user_photofull_element_edit" => "user/#user_id#/photo/photo/#user_alias#/#section_id#/#element_id#/action/#action#/", "user_photofull_element_slide_show" => "user/#user_id#/photo/photo/#user_alias#/#section_id#/#element_id#/slide_show/", "user_calendar" => "user/#user_id#/calendar/", "user_files" => "user/#user_id#/files/lib/#path#", "user_files_short" => "folder/view/#section_id#/#element_id#/#element_name#", "user_files_section_edit" => "user/#user_id#/files/folder/edit/#section_id#/#action#/", "user_files_element" => "user/#user_id#/files/element/view/#element_id#/", "user_files_element_comment" => "user/#user_id#/files/element/comment/#topic_id#/#message_id#/", "user_files_element_edit" => "user/#user_id#/files/element/edit/#element_id#/#action#/", "user_files_element_file" => "", "user_files_element_history" => "user/#user_id#/files/element/history/#element_id#/", "user_files_element_history_get" => "user/#user_id#/files/element/historyget/#element_id#/#element_name#", "user_files_element_version" => "user/#user_id#/files/element/version/#action#/#element_id#/", "user_files_element_versions" => "user/#user_id#/files/element/versions/#element_id#/", "user_files_element_upload" => "user/#user_id#/files/element/upload/#section_id#/", "user_files_help" => "user/#user_id#/files/help/", "user_files_connector" => "user/#user_id#/files/connector/", "user_files_webdav_bizproc_history" => "user/#user_id#/files/bizproc/history/#element_id#/", "user_files_webdav_bizproc_history_get" => "user/#user_id#/files/bizproc/historyget/#element_id#/#id#/#element_name#", "user_files_webdav_bizproc_log" => "user/#user_id#/files/bizproc/log/#element_id#/#id#/", "user_files_webdav_bizproc_view" => "user/#user_id#/files/bizproc/bizproc/#element_id#/", "user_files_webdav_bizproc_workflow_admin" => "user/#user_id#/files/bizproc/admin/", "user_files_webdav_bizproc_workflow_edit" => "user/#user_id#/files/bizproc/edit/#id#/", "user_files_webdav_start_bizproc" => "user/#user_id#/files/bizproc/start/#element_id#/", "user_blog" => "user/#user_id#/blog/", "user_blog_post_important" => "user/#user_id#/blog/important/", "user_blog_post_edit" => "user/#user_id#/blog/edit/#post_id#/", "user_blog_rss" => "user/#user_id#/blog/rss/#type#/", "user_blog_post_rss" => "user/#user_id#/blog/rss/#type#/#post_id#/", "user_blog_draft" => "user/#user_id#/blog/draft/", "user_blog_moderation" => "user/#user_id#/blog/moderation/", "user_blog_post" => "user/#user_id#/blog/#post_id#/", "user_tasks" => "user/#user_id#/tasks/", "user_tasks_task" => "user/#user_id#/tasks/task/#action#/#task_id#/", "user_tasks_view" => "user/#user_id#/tasks/view/#action#/#view_id#/", "user_tasks_departments_overview" => "user/#user_id#/tasks/departments/", "user_tasks_projects_overview" => "user/#user_id#/tasks/projects/", "user_tasks_report" => "user/#user_id#/tasks/report/", "user_tasks_report_construct" => "user/#user_id#/tasks/report/construct/#report_id#/#action#/", "user_tasks_report_view" => "user/#user_id#/tasks/report/view/#report_id#/", "user_tasks_templates" => "user/#user_id#/tasks/templates/", "user_templates_template" => "user/#user_id#/tasks/templates/template/#action#/#template_id#/", "user_forum" => "user/#user_id#/forum/", "user_forum_topic" => "user/#user_id#/forum/#topic_id#/", "user_forum_topic_edit" => "user/#user_id#/forum/edit/#action#/#topic_id#/#message_id#/", "user_forum_message" => "user/#user_id#/forum/message/#topic_id#/#message_id#/", "user_forum_message_edit" => "user/#user_id#/forum/message/#action#/#topic_id#/#message_id#/", "user_security" => "user/#user_id#/security/", "user_codes" => "user/#user_id#/codes/", "user_passwords" => "user/#user_id#/passwords/"); $diskEnabled = \Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk'); $bExtranetEnabled = IsModuleInstalled('extranet'); if ($bExtranetEnabled) { $extranetSiteId = COption::GetOptionString("extranet", "extranet_site"); if (strlen($extranetSiteId) <= 0) { $bExtranetEnabled = false; } } if ($bExtranetEnabled && $arParams["SEF_MODE"] == "Y" && SITE_ID == $extranetSiteId && !CSocNetUser::IsCurrentUserModuleAdmin() && CModule::IncludeModule('intranet')) { if ($USER->IsAuthorized()) { $rsCurrentUser = CUser::GetById($USER->GetId()); if (($arCurrentUser = $rsCurrentUser->Fetch()) && !empty($arCurrentUser["UF_DEPARTMENT"]) && is_array($arCurrentUser["UF_DEPARTMENT"]) && intval($arCurrentUser["UF_DEPARTMENT"][0]) > 0) { $arRedirectSite = CSocNetLogComponent::GetSiteByDepartmentId($arCurrentUser["UF_DEPARTMENT"]); if (!$arRedirectSite) { $arRedirectSite = array("LID" => SITE_ID, "SERVER_NAME" => SITE_SERVER_NAME); } } } } if ($diskEnabled) { $arDefaultUrlTemplates404["user_disk"] = "user/#user_id#/disk/path/#PATH#"; $arDefaultUrlTemplates404["user_disk_file"] = "user/#user_id#/disk/file/#FILE_PATH#"; $arDefaultUrlTemplates404["user_trashcan_list"] = "user/#user_id#/disk/trashcan/#TRASH_PATH#"; $arDefaultUrlTemplates404["user_trashcan_file_view"] = "user/#user_id#/disk/trash/file/#TRASH_FILE_PATH#"; $arDefaultUrlTemplates404["user_external_link_list"] = "user/#user_id#/disk/external"; $arDefaultUrlTemplates404["user_disk_help"] = "user/#user_id#/disk/help"; } if ($bExtranetEnabled) {
} $arResult["PATH_TO_GROUP_LOG_RSS_MASK"] = $arResult["~PATH_TO_GROUP_LOG_RSS_MASK"] = $APPLICATION->GetCurPage(true) . "?page=group_log_rss&group_id=" . $arVariables["group_id"]; } if (strlen($arParams["PATH_TO_USER_BLOG_POST"]) <= 0) { $arParams["PATH_TO_USER_BLOG_POST"] = COption::GetOptionString("socialnetwork", "userblogpost_page", false, SITE_ID); } if ($arRedirectSite && $arParams["SEF_MODE"] == "Y") { if (is_array($arVariables)) { foreach ($arVariables as $i => $variable) { if (!is_string($variable)) { unset($arVariables[$i]); } } unset($variable); } CSocNetLogComponent::redirectExtranetSite($arRedirectSite, $componentPage, $arVariables, $arDefaultUrlTemplates404, "workgroup"); } if ($bExtranetEnabled && CModule::IncludeModule("extranet")) { CExtranet::ExtranetRedirect(); } $arResult = array_merge(array("SEF_MODE" => $arParams["SEF_MODE"], "SEF_FOLDER" => $arParams["SEF_FOLDER"], "VARIABLES" => $arVariables, "ALIASES" => $arParams["SEF_MODE"] == "Y" ? array() : $arVariableAliases, "SET_TITLE" => $arParams["SET_TITLE"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_TIME_LONG" => $arParams["CACHE_TIME_LONG"], "SET_NAV_CHAIN" => $arParams["SET_NAV_CHAIN"], "SET_NAVCHAIN" => $arParams["SET_NAV_CHAIN"], "ITEM_DETAIL_COUNT" => $arParams["ITEM_DETAIL_COUNT"], "ITEM_MAIN_COUNT" => $arParams["ITEM_MAIN_COUNT"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "USER_PROPERTY_MAIN" => $arParams["USER_PROPERTY_MAIN"], "USER_PROPERTY_CONTACT" => $arParams["USER_PROPERTY_CONTACT"], "USER_PROPERTY_PERSONAL" => $arParams["USER_PROPERTY_PERSONAL"], "GROUP_PROPERTY" => $arParams["GROUP_PROPERTY"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"]), $arResult); $arParams["PATH_TO_SEARCH_EXTERNAL"] = Trim($arParams["PATH_TO_SEARCH_EXTERNAL"]); if (StrLen($arParams["PATH_TO_SEARCH_EXTERNAL"]) > 0) { $arResult["PATH_TO_SEARCH"] = $arParams["PATH_TO_SEARCH_EXTERNAL"]; } $arParams["PATH_TO_USER_CALENDAR"] = trim($arParams["PATH_TO_USER_CALENDAR"]); if (strlen($arParams["PATH_TO_USER_CALENDAR"]) > 0) { $arResult["PATH_TO_USER_CALENDAR"] = $arParams["PATH_TO_USER_CALENDAR"]; } if (!empty($arParams["PATH_TO_USER_BLOG_POST_IMPORTANT"])) { $arResult["PATH_TO_USER_BLOG_POST_IMPORTANT"] = $arParams["PATH_TO_USER_BLOG_POST_IMPORTANT"];
} if (!isset($arResult["strMessage"])) { if (strlen($comment_text) <= 0) { $arResult["strMessage"] = GetMessage("SONET_LOG_COMMENT_EMPTY"); } } if (!isset($arResult["strMessage"])) { $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "LOG_ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "LIST" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "UPLOAD" => $arForum["ALLOW_UPLOAD"], "NL2BR" => "N", "SMILES" => "N"); if ($editCommentID > 0 && $arComment) { $bHasEditCallback = is_array($arCommentEvent) && isset($arCommentEvent["UPDATE_CALLBACK"]) && ($arCommentEvent["UPDATE_CALLBACK"] == "NO_SOURCE" || is_callable($arCommentEvent["UPDATE_CALLBACK"])); if ($bHasEditCallback && $arComment["USER_ID"] == $GLOBALS["USER"]->GetId()) { $arFields = array("MESSAGE" => $comment_text, "TEXT_MESSAGE" => $comment_text, "EVENT_ID" => $arComment["EVENT_ID"]); CSocNetLogComponent::checkEmptyUFValue('UF_SONET_COM_DOC'); $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arFields); if (!empty($_POST["attachedFilesRaw"]) && is_array($_POST["attachedFilesRaw"])) { CSocNetLogComponent::saveRawFilesToUF($_POST["attachedFilesRaw"], IsModuleInstalled("webdav") || IsModuleInstalled("disk") ? "UF_SONET_COM_DOC" : "UF_SONET_COM_FILE", $arFields); } $comment = CSocNetLogComments::Update($editCommentID, $arFields, true); } } else { $arFields = array("ENTITY_TYPE" => $arLog["ENTITY_TYPE"], "ENTITY_ID" => $arLog["ENTITY_ID"], "EVENT_ID" => $arCommentEvent["EVENT_ID"], "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $comment_text, "TEXT_MESSAGE" => $comment_text, "URL" => $source_url, "MODULE_ID" => false, "LOG_ID" => $arLog["ID"], "USER_ID" => $GLOBALS["USER"]->GetID(), "PATH_TO_USER_BLOG_POST" => $arParams["PATH_TO_USER_BLOG_POST"], "PATH_TO_GROUP_BLOG_POST" => $arParams["PATH_TO_GROUP_BLOG_POST"], "PATH_TO_USER_MICROBLOG_POST" => $arParams["PATH_TO_USER_MICROBLOG_POST"], "PATH_TO_GROUP_MICROBLOG_POST" => $arParams["PATH_TO_GROUP_MICROBLOG_POST"], "BLOG_ALLOW_POST_CODE" => $arParams["BLOG_ALLOW_POST_CODE"]); if ($arSaveResult) { $arFields[$ufCode] = array(isset($arFileStorage["DISC_FOLDER"]) ? "n" . $arSaveResult["ID"] : $arSaveResult["ID"]); } $GLOBALS[$ufCode] = $arFields[$ufCode]; $comment = CSocNetLogComments::Add($arFields, true, false); unset($GLOBALS[$ufCode]); CSocNetLog::CounterIncrement($comment, false, false, "LC"); } if (!is_array($comment) && intval($comment) > 0) { $arResult["SUCCESS"] = "Y";
public static function getCommentByRequest($commentId, $postId, $action = false, $checkPerms = true, $checkAdminSession = true) { $commentId = intval($commentId); $postId = intval($postId); $arOrder = array(); $rsLog = CSocNetLog::GetList(array(), array("ID" => $postId), false, false, array("EVENT_ID", "SOURCE_ID")); if ($arLog = $rsLog->Fetch()) { $arCommentEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arLog["EVENT_ID"]); $arFilter = array("EVENT_ID" => $arCommentEvent["EVENT_ID"]); if (isset($arCommentEvent["DELETE_CALLBACK"]) && $arCommentEvent["DELETE_CALLBACK"] != "NO_SOURCE") { $arFilter["SOURCE_ID"] = $commentId; // forum etc. } else { $arFilter["ID"] = $commentId; // socialnetwork } $dbRes = CSocNetLogComments::GetList($arOrder, $arFilter, false, false, array("ID", "EVENT_ID", "MESSAGE", "USER_ID", "SOURCE_ID", "LOG_SOURCE_ID", "UF_*")); if ($arRes = $dbRes->Fetch()) { if ($checkPerms) { $bAllow = CSocNetLogComponent::canUserChangeComment(array("ACTION" => $action, "LOG_ID" => $postId, "LOG_EVENT_ID" => $arLog["EVENT_ID"], "LOG_SOURCE_ID" => $arLog["SOURCE_ID"], "COMMENT_ID" => $arRes["ID"], "COMMENT_USER_ID" => $arRes["USER_ID"], "CHECK_ADMIN_SESSION" => $checkAdminSession ? "Y" : "N")); } else { $bAllow = true; } if (!$bAllow) { $arRes = false; } else { if ($action == "edit") { $arUFMeta = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("SONET_COMMENT", 0, LANGUAGE_ID); $arRes["UF"] = array(); foreach ($arUFMeta as $field_name => $arUF) { if (array_key_exists($field_name, $arRes) && !empty($arRes[$field_name])) { $arRes["UF"][$field_name] = $arUFMeta[$field_name]; $arRes["UF"][$field_name]["VALUE"] = $arRes[$field_name]; $arRes["UF"][$field_name]["ENTITY_VALUE_ID"] = $arRes["ID"]; unset($arRes[$field_name]); } } } } } return $arRes; } return false; }
} if ($arResult["bGetComments"] && intval($arParams["CREATED_BY_ID"]) > 0) { if ($arCommentTmp["EVENT"]["USER_ID"] == $arParams["CREATED_BY_ID"]) { $arCommentsFullListCut[] = $arCommentTmp; } } else { $event_date_log_ts = isset($arCommentTmp["EVENT"]["LOG_DATE_TS"]) ? $arCommentTmp["EVENT"]["LOG_DATE_TS"] : MakeTimeStamp($arCommentTmp["EVENT"]["LOG_DATE"]) - intval($arResult["TZ_OFFSET"]); if ($arParams["COMMENT_ID"] <= 0 && $key >= $arParams["COMMENTS_IN_EVENT"] && (intval($arResult["LAST_LOG_TS"]) <= 0 || $event_date_log_ts <= $arResult["LAST_LOG_TS"])) { // } else { $arCommentsFullListCut[] = $arCommentTmp; } } $arCommentID[] = $arCommentTmp["EVENT"]["RATING_ENTITY_ID"]; } $arCommentRights = CSocNetLogComponent::getCommentRights(array("EVENT_ID" => $arEvent["EVENT"]["EVENT_ID"], "SOURCE_ID" => $arEvent["EVENT"]["SOURCE_ID"])); $arResult["COMMENT_RIGHTS_EDIT"] = $arCommentRights["COMMENT_RIGHTS_EDIT"]; $arResult["COMMENT_RIGHTS_DELETE"] = $arCommentRights["COMMENT_RIGHTS_DELETE"]; $arEvent["COMMENTS"] = array_reverse($arCommentsFullListCut); $arResult["RATING_COMMENTS"] = array(); if (!empty($arCommentID) && $arParams["SHOW_RATING"] == "Y" && strlen($rating_entity_type) > 0) { $arResult["RATING_COMMENTS"] = CRatings::GetRatingVoteResult($rating_entity_type, $arCommentID); } } } else { return; } $arResult["Event"] = $arEvent; $arResult["WORKGROUPS_PAGE"] = COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID); $arResult["GET_COMMENTS"] = $bGetComments ? "Y" : "N"; $this->IncludeComponentTemplate();
$post_id = intval($_REQUEST["post_id"]); if ($comment_id > 0 && $post_id > 0) { $arRes = CSocNetLogComponent::getCommentByRequest($comment_id, $post_id, "edit"); if ($arRes) { $arResult["id"] = intval($arRes["ID"]); $arResult["message"] = str_replace("<br />", "\n", $arRes["MESSAGE"]); $arResult["sourceId"] = intval($arRes["SOURCE_ID"]) > 0 ? intval($arRes["SOURCE_ID"]) : intval($arRes["ID"]); $arResult["UF"] = !empty($arRes["UF"]) ? $arRes["UF"] : array(); } } } elseif ($action == "delete_comment") { $arResult = false; $comment_id = intval($_REQUEST["delete_comment_id"]); $post_id = intval($_REQUEST["post_id"]); if ($comment_id > 0 && $post_id > 0) { $arRes = CSocNetLogComponent::getCommentByRequest($comment_id, $post_id, "delete"); if ($arRes) { $bSuccess = CSocNetLogComments::Delete($arRes["ID"], true); if (!$bSuccess && ($e = $GLOBALS["APPLICATION"]->GetException())) { $errorMessage = $e->GetString(); } $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("ENTITY_XML_ID" => $_REQUEST["ENTITY_XML_ID"], "PUSH&PULL" => array("ID" => $bSuccess ? $arRes["SOURCE_ID"] > 0 ? $arRes["SOURCE_ID"] : $arRes["ID"] : false, "ACTION" => "DELETE"), "OK_MESSAGE" => $bSuccess ? GetMessage('SONET_LOG_COMMENT_DELETED') : '', "ERROR_MESSAGE" => !$bSuccess ? $errorMessage : '')); } } } header('Content-Type:application/json; charset=UTF-8'); echo \Bitrix\Main\Web\Json::encode($arResult); /** @noinspection PhpUndefinedClassInspection */ \CMain::finalActions(); die; }
$db_events = GetModuleEvents("socialnetwork", "OnSonetLogFilterProcess"); while ($arEvent = $db_events->Fetch()) { $arEventResult = ExecuteModuleEventEx($arEvent, array($preset_filter_top_id, $preset_filter_id, $arResultPresetFiltersTop, $arResultPresetFilters)); if (is_array($arEventResult)) { if (array_key_exists("GET_COMMENTS", $arEventResult)) { $bGetComments = $arEventResult["GET_COMMENTS"]; } if (array_key_exists("PARAMS", $arEventResult) && is_array($arEventResult["PARAMS"])) { foreach ($arEventResult["PARAMS"] as $key => $value) { $arParams[$key] = $value; } } } } if ($arParams["SHOW_EVENT_ID_FILTER"] != "N") { $arEventResult = CSocNetLogComponent::OnSonetLogFilterProcess($preset_filter_top_id, $preset_filter_id, $arResultPresetFiltersTop, $arResultPresetFilters); if (is_array($arEventResult)) { if (array_key_exists("GET_COMMENTS", $arEventResult)) { $bGetComments = $arEventResult["GET_COMMENTS"]; } if (array_key_exists("PARAMS", $arEventResult) && is_array($arEventResult["PARAMS"])) { foreach ($arEventResult["PARAMS"] as $key => $value) { $arParams[$key] = $value; } } } } if (array_key_exists("flt_date_datesel", $_REQUEST) && strlen($_REQUEST["flt_date_datesel"]) > 0) { switch ($_REQUEST["flt_date_datesel"]) { case "today": $arParams["LOG_DATE_FROM"] = $arParams["LOG_DATE_TO"] = ConvertTimeStamp();
$arResult["ALL_ITEM_TITLE"] = false; $db_events = GetModuleEvents("socialnetwork", "OnBeforeSonetLogFilterFill"); while ($arEvent = $db_events->Fetch()) { ExecuteModuleEventEx($arEvent, array(&$arResult["PageParamsToClear"], &$arResult["PresetFiltersTop"], &$arResult["PresetFilters"], &$arResult["ALL_ITEM_TITLE"])); } if (!function_exists("__SL_PF_sort")) { function __SL_PF_sort($a, $b) { if ($a["SORT"] == $b["SORT"]) { return 0; } return $a["SORT"] < $b["SORT"] ? -1 : 1; } } usort($arResult["PresetFilters"], "__SL_PF_sort"); $arResult["PresetFilters"] = CSocNetLogComponent::ConvertPresetToFilters($arResult["PresetFilters"], $arParams); if ($_REQUEST["preset_filter_top_id"] == "clearall") { $preset_filter_top_id = false; } elseif (array_key_exists("preset_filter_top_id", $_REQUEST) && strlen($_REQUEST["preset_filter_top_id"]) > 0) { $preset_filter_top_id = $_REQUEST["preset_filter_top_id"]; } if (strlen($preset_filter_top_id) > 0 && array_key_exists($preset_filter_top_id, $arResult["PresetFiltersTop"]) && is_array($arResult["PresetFiltersTop"][$preset_filter_top_id])) { $arResult["PresetFilterTopActive"] = $preset_filter_top_id; } else { $arResult["PresetFilterTopActive"] = false; } if ($_REQUEST["preset_filter_id"] == "clearall") { $preset_filter_id = false; } elseif (array_key_exists("preset_filter_id", $_REQUEST) && strlen($_REQUEST["preset_filter_id"]) > 0) { $preset_filter_id = $_REQUEST["preset_filter_id"]; }
public static function InviteUser($arUser, $messageText) { global $USER; $bExtranet = !isset($arUser["UF_DEPARTMENT"]) || is_array($arUser["UF_DEPARTMENT"]) && intval($arUser["UF_DEPARTMENT"][0]) <= 0 || !is_array($arUser["UF_DEPARTMENT"]) && intval($arUser["UF_DEPARTMENT"]) <= 0; if ($bExtranet && CModule::IncludeModule("extranet")) { $SITE_ID = CExtranet::GetExtranetSiteID(); } elseif (IsModuleInstalled("bitrix24")) { $bExtranet = false; $SITE_ID = SITE_ID; } else { CModule::IncludeModule('socialnetwork'); $arSite = CSocNetLogComponent::GetSiteByDepartmentId($arUser["UF_DEPARTMENT"]); $SITE_ID = $arSite["LID"]; $bExtranet = false; } $rsSites = CSite::GetByID($SITE_ID); $arSite = $rsSites->Fetch(); $serverName = strlen($arSite["SERVER_NAME"]) > 0 ? $arSite["SERVER_NAME"] : (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name", "")); $event = new CEvent(); if ($bExtranet) { $event->SendImmediate("EXTRANET_INVITATION", $SITE_ID, array("USER_ID" => $arUser["ID"], "CHECKWORD" => $arUser["CONFIRM_CODE"], "EMAIL" => $arUser["EMAIL"])); } elseif (IsModuleInstalled("bitrix24")) { $event->SendImmediate("BITRIX24_USER_INVITATION", $SITE_ID, array("EMAIL_FROM" => $USER->GetEmail(), "EMAIL_TO" => $arUser["EMAIL"], "LINK" => CHTTP::URN2URI("/bitrix/tools/intranet_invite_dialog.php?user_id=" . $arUser['ID'] . "&checkword=" . urlencode($arUser["CONFIRM_CODE"]), $serverName), "USER_TEXT" => $messageText)); } else { $event->SendImmediate("INTRANET_USER_INVITATION", $SITE_ID, array("EMAIL_TO" => $arUser["EMAIL"], "LINK" => CHTTP::URN2URI("/bitrix/tools/intranet_invite_dialog.php?user_id=" . $arUser['ID'] . "&checkword=" . urlencode($arUser["CONFIRM_CODE"]), $serverName), "USER_TEXT" => $messageText)); } }
} } <?php } ?> }); return BX.PreventDefault(this); " class="feed-post-more-link"><span class="feed-post-more-text"><?php echo GetMessage("BLOG_POST_BUTTON_MORE"); ?> </span><span class="feed-post-more-arrow"></span></a><?php } ?> <span class="feed-post-time-wrap"><?php $timestamp = MakeTimeStamp($arResult["Post"]["DATE_PUBLISH"]); $datetime_detail = 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"])); ?> <a href="<?php echo $arResult["Post"]["urlToPost"]; ?> "><span class="feed-time"><?php echo $datetime_detail; ?> </span></a><?php ?> </span> </div> </div><?php if (!in_array($arParams["TYPE"], array("DRAFT", "MODERATION"))) { if (empty($_REQUEST["bxajaxid"]) && empty($_REQUEST["logajax"]) || $_REQUEST["RELOAD"] == "Y" && !(empty($_REQUEST["bxajaxid"]) && empty($_REQUEST["logajax"]))) { include_once $_SERVER["DOCUMENT_ROOT"] . $templateFolder . "/destination.php";