当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetLog::FormatEvent_FillTooltip方法代码示例

本文整理汇总了PHP中CSocNetLog::FormatEvent_FillTooltip方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetLog::FormatEvent_FillTooltip方法的具体用法?PHP CSocNetLog::FormatEvent_FillTooltip怎么用?PHP CSocNetLog::FormatEvent_FillTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetLog的用法示例。


在下文中一共展示了CSocNetLog::FormatEvent_FillTooltip方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FormatEvent

 public static function FormatEvent($arFields, $arParams, $bMail = false)
 {
     global $APPLICATION, $CACHE_MANAGER;
     $arResult = array("EVENT" => $arFields);
     if (defined("BX_COMP_MANAGED_CACHE")) {
         $CACHE_MANAGER->RegisterTag("CALENDAR_EVENT_" . intval($arFields["SOURCE_ID"]));
         $CACHE_MANAGER->RegisterTag("CALENDAR_EVENT_LIST");
     }
     $eventViewResult = $APPLICATION->IncludeComponent('bitrix:calendar.livefeed.view', '', array("EVENT_ID" => $arFields["SOURCE_ID"], "USER_ID" => $arFields["USER_ID"], "PATH_TO_USER" => $arParams["PATH_TO_USER"], "MOBILE" => $arParams["MOBILE"]), null, array('HIDE_ICONS' => 'Y'));
     $arResult["EVENT_FORMATTED"] = array("TITLE" => GetMessage("EC_EDEV_EVENT"), "TITLE_24" => GetMessage("EC_EDEV_EVENT"), "URL" => "javascript:BX.StartSlider(" . $arFields["USER_ID"] . "," . $arFields["SOURCE_ID"] . ");", "MESSAGE" => $eventViewResult['MESSAGE'], "FOOTER_MESSAGE" => $eventViewResult['FOOTER_MESSAGE'], "IS_IMPORTANT" => false, "STYLE" => "calendar-confirm");
     $eventId = $arFields["SOURCE_ID"];
     if (!$eventId) {
         $eventId = 0;
     }
     $editUrl = CCalendar::GetPath('user', $arFields["USER_ID"]);
     $editUrl = $editUrl . (strpos($editUrl, "?") === false ? '?' : '&') . 'EVENT_ID=EDIT' . $eventId;
     $arRights = array();
     $dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
     while ($arRight = $dbRight->Fetch()) {
         $arRights[] = $arRight["GROUP_CODE"];
     }
     $arResult["EVENT_FORMATTED"]["DESTINATION"] = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"])));
     if (isset($eventViewResult['CACHED_JS_PATH'])) {
         $arResult['CACHED_JS_PATH'] = $eventViewResult['CACHED_JS_PATH'];
     }
     $arResult['ENTITY']['FORMATTED']["NAME"] = "ENTITY FORMATTED NAME";
     $arResult['ENTITY']['FORMATTED']["URL"] = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
     $arResult['AVATAR_SRC'] = CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY');
     $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
     $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
     return $arResult;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:32,代码来源:calendar_livefeed.php

示例2: FormatEvent_Data

 function FormatEvent_Data($arFields, $arParams, $bMail = false)
 {
     $arResult = array("EVENT" => $arFields, "URL" => "");
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail);
         $rsRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         $arRights = array();
         while ($arRight = $rsRight->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         $arDestination = CSocNetLogTools::FormatDestinationFromRights($arRights, $arParams, $iMoreCount);
     }
     $title = "";
     $arEventParams = unserialize(strlen($arFields["~PARAMS"]) > 0 ? $arFields["~PARAMS"] : $arFields["PARAMS"]);
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER)) && is_array($arEventParams) && count($arEventParams) > 0 && array_key_exists("ENTITY_NAME", $arEventParams) && strlen($arEventParams["ENTITY_NAME"]) > 0) {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arEventParams["ENTITY_NAME"] . '</a>';
         } else {
             $title_tmp = $arEventParams["ENTITY_NAME"];
         }
     } else {
         if (!$bMail && strlen($arFields["URL"]) > 0) {
             $title_tmp = '<a href="' . $arFields["URL"] . '">' . $arFields["TITLE"] . '</a>';
         } else {
             $title_tmp = $arFields["TITLE"];
         }
     }
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($title_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_" . $arFields["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_TITLE"));
     $url = false;
     if (strlen($arFields["URL"]) > 0) {
         $url = $arFields["URL"];
     }
     if (in_array($arFields["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         if (!$bMail) {
             $message = $arFields["MESSAGE"];
         } else {
             $message = $arFields["TITLE"] . "#BR##BR#" . $arFields["MESSAGE"];
         }
     } else {
         $message = $arFields["MESSAGE"];
     }
     $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
     $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
     $twitInfo = unserialize($arFields['~PARAMS']);
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $arFields["TITLE"], "TITLE_24" => "", "MESSAGE" => "<a  target=\"_blank\" style=\"text-decoration: none; color: #5C6470; font-weight: bold; font-size: 12px\" href=\"https://twitter.com/" . $twitInfo['SCREEN_NAME'] . "/status/" . $twitInfo['TWIT_ID'] . "\">" . $arFields["TITLE"] . "</a><p>" . ($bMail ? CSocNetTextParser::killAllTags($message) : $message), "IS_IMPORTANT" => false, "STYLE" => "", "DESTINATION" => $arDestination);
     if (intval($iMoreCount) > 0) {
         $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iMoreCount;
     }
     if (is_array($arEventParams) && array_key_exists("SOURCE_TIMESTAMP", $arEventParams)) {
         $arResult["EVENT_FORMATTED"]["LOG_DATE_FORMAT"] = ConvertTimeStamp($arEventParams["SOURCE_TIMESTAMP"], "FULL");
     }
     if (strlen($url) > 0) {
         $arResult["EVENT_FORMATTED"]["URL"] = $url;
     }
     if (!$bMail) {
         if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
             $arGroup = array("IMAGE_ID" => $arFields["GROUP_IMAGE_ID"]);
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatarGroup($arGroup, $arParams);
         } elseif ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER) {
             $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams, "USER_");
         } elseif ($arFields["ENTITY_TYPE"] == "N") {
             $arResult["EVENT_FORMATTED"]["AVATAR_STYLE"] = "avatar-info";
         }
         $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback(str_replace("#CUT#", "", $arResult["EVENT_FORMATTED"]["MESSAGE"])), array(), $arAllow), 500);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
         }
     }
     return $arResult;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:77,代码来源:include.php

示例3: FormatEvent

 public static function FormatEvent($arFields, $arParams, $bMail = false)
 {
     $user_url = strlen($arParams["PATH_TO_USER"]) > 0 ? $arParams["PATH_TO_USER"] : COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $arFields["SITE_ID"]);
     $dbReport = CTimeManReportFull::GetByID($arFields["SOURCE_ID"]);
     $arReport = $dbReport->Fetch();
     if (!$arReport) {
         return false;
     }
     $arManagers = CTimeMan::GetUserManagers($arReport["USER_ID"]);
     $arManagers[] = $arReport["USER_ID"];
     $arManagers = array_unique($arManagers);
     $dbManagers = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => implode('|', $arManagers)));
     $arCurrentUserManagers = array();
     while ($manager = $dbManagers->GetNext()) {
         $tmpUser = array('ID' => $manager['ID'], 'LOGIN' => $manager['LOGIN'], 'NAME' => CUser::FormatName(CSite::GetNameFormat(false), $manager, true, false), 'URL' => str_replace(array('#ID#', '#USER_ID#', '#id#', '#user_id#'), $manager['ID'], $user_url), 'WORK_POSITION' => $manager['WORK_POSITION'], 'PERSONAL_PHOTO' => $manager['PERSONAL_PHOTO'], 'SEX' => $manager["PERSONAL_GENDER"]);
         if ($manager['ID'] == $arReport["USER_ID"]) {
             $arUser = $tmpUser;
         }
         if ($manager['ID'] != $arReport["USER_ID"] || count($arManagers) == 1) {
             $arCurrentUserManagers[] = $tmpUser;
         }
     }
     $arResult["EVENT"] = $arFields;
     if (!$bMail) {
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
             $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arCurrentUserManagers[0]["ID"]));
         }
         ob_start();
         $GLOBALS['APPLICATION']->IncludeComponent('bitrix:timeman.livefeed.workreport', $arParams["MOBILE"] == "Y" ? 'mobile' : '', array("USER" => $arUser, "MANAGER" => $arCurrentUserManagers[0], "MARK" => $arReport["MARK"], "REPORT_ID" => $arReport["ID"], "PARAMS" => $arParams), null, array('HIDE_ICONS' => 'Y'));
         $html_message = ob_get_contents();
         ob_end_clean();
         $arResult["EVENT"] = $arFields;
         if ($arParams["MOBILE"] == "Y") {
             $arResult["EVENT_FORMATTED"] = array("TITLE_24" => ($arFields["USER_ID"] == $arFields["ENTITY_ID"] ? GetMessage("REPORT_ADD_24" . ($arUser["SEX"] == "M" ? "_M" : ($arUser["SEX"] == "F" ? "_F" : ""))) : GetMessage("REPORT_CHANGE_24" . ($arCurrentUserManagers[0]["SEX"] == "M" ? "_M" : ($arCurrentUserManagers[0]["SEX"] == "F" ? "_F" : "")))) . " " . $arFields["TITLE"], "MESSAGE" => htmlspecialcharsbx($html_message), "IS_IMPORTANT" => false, "DESCRIPTION" => in_array($arReport["MARK"], array("G", "B")) ? array(GetMessage("REPORT_FULL_COMMENT_CONFIRM_MOBILE"), GetMessage("REPORT_FULL_COMMENT_CONFIRM_MOBILE_VALUE_" . $arReport["MARK"])) : ($arReport["MARK"] == "N" ? GetMessage("REPORT_FULL_COMMENT_CONFIRM_WO_MARK") : ""), "DESCRIPTION_STYLE" => in_array($arReport["MARK"], array("G", "B")) ? $arReport["MARK"] == "G" ? "green" : "red" : false);
         } else {
             $arResult["EVENT_FORMATTED"] = array("TITLE" => ($arFields["USER_ID"] == $arFields["ENTITY_ID"] ? $arUser["SEX"] == "F" ? GetMessage("REPORT_ADD_W") : GetMessage("REPORT_ADD") : ($arCurrentUserManagers[0]["SEX"] == "F" ? GetMessage("REPORT_CHANGE_W") : GetMessage("REPORT_CHANGE"))) . " <a href='javascript:BX.StartSlider(" . $arReport["USER_ID"] . "," . $arFields["SOURCE_ID"] . ");'>" . $arFields["TITLE"] . "</a>", "TITLE_24" => ($arFields["USER_ID"] == $arFields["ENTITY_ID"] ? GetMessage("REPORT_ADD_24" . ($arUser["SEX"] == "M" ? "_M" : ($arUser["SEX"] == "F" ? "_F" : ""))) : GetMessage("REPORT_CHANGE_24" . ($arCurrentUserManagers[0]["SEX"] == "M" ? "_M" : ($arCurrentUserManagers[0]["SEX"] == "F" ? "_F" : "")))) . " <a href='javascript:BX.StartSlider(" . $arReport["USER_ID"] . "," . $arFields["SOURCE_ID"] . ");'>" . $arFields["TITLE"] . "</a>", "URL" => "javascript:BX.StartSlider(" . $arReport["USER_ID"] . "," . $arFields["SOURCE_ID"] . ");", "MESSAGE" => $html_message, "SHORT_MESSAGE" => $html_message, "IS_IMPORTANT" => false, "STYLE" => $arReport["MARK"] == "G" ? "workday-confirm" : ($arReport["MARK"] == "B" ? "workday-rejected" : "workday-edit"));
             if ($arParams["NEW_TEMPLATE"] != "Y") {
                 $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLog::FormatEvent_IsMessageShort($arFields['MESSAGE']);
             }
             $arResult['ENTITY']['FORMATTED']["NAME"] = GetMessage('REPORT_TITLE');
             $arResult['ENTITY']['FORMATTED']["URL"] = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
         }
         $arResult['AVATAR_SRC'] = CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY');
         $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
         $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
     } else {
         $reportURL = COption::GetOptionString("timeman", "WORK_REPORT_PATH", "/company/work_report.php");
         if (strlen($reportURL) == 0) {
             $reportURL = "/company/work_report.php";
         }
         $reportURL = CSocNetLogTools::FormatEvent_GetURL(array("URL" => $reportURL, "SITE_ID" => $arFields["SITE_ID"]));
         $arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("REPORT_TITLE_FOR_MAIL");
         $arResult['EVENT_FORMATTED'] = array("TITLE" => $arUser["NAME"] . " " . ($arUser["SEX"] == "F" ? GetMessage("REPORT_ADD_W") : GetMessage("REPORT_ADD")) . " " . GetMessage("REPORT_WORK_REPORT"), "URL" => $reportURL . "#user_id=" . $arReport["USER_ID"] . "&report=" . $arFields["SOURCE_ID"], "MESSAGE" => $arFields["TITLE"], "IS_IMPORTANT" => false);
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:57,代码来源:timeman_report_full.php

示例4: FormatEvent


//.........这里部分代码省略.........
     $arEventFields = array("LOG_ID" => $arFields["ID"], "EVENT_ID" => $arFields["EVENT_ID"]);
     if ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Activity) {
         $dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         while ($arRight = $dbRight->Fetch()) {
             if (preg_match('/^SG(\\d+)$/', $arRight["GROUP_CODE"], $matches)) {
                 $arRights[] = $arRight["GROUP_CODE"];
             }
         }
     }
     if ($arParams["MOBILE"] == "Y") {
         self::OnBeforeSocNetLogEntryGetRights($arEventFields, $arRights);
         $arDestination = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"], "USE_ALL_DESTINATION" => true)), $iMoreCount);
         if ($arFields['ENTITY_TYPE'] == CCrmLiveFeedEntity::Activity && $arActivity && $arActivity["TYPE_ID"] == CCrmActivityType::Task) {
             $title_24 = '';
         } else {
             $title_24 = GetMessage('CRM_LF_MESSAGE_TITLE_24');
         }
         $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('TITLE_24' => $title_24, "MESSAGE" => htmlspecialcharsbx($html_message), "IS_IMPORTANT" => false, "DESTINATION" => $arDestination), "AVATAR_SRC" => CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY'));
     } else {
         if ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Activity) {
             $arEventFields["ACTIVITY"] = $arActivity;
         } elseif ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Invoice) {
             $arEventFields["ACTIVITY"] = $arInvoice;
         }
         self::OnBeforeSocNetLogEntryGetRights($arEventFields, $arRights);
         if ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Activity && $arActivity) {
             if ($arActivity["TYPE_ID"] == CCrmActivityType::Call) {
                 if ($arActivity["DIRECTION"] == CCrmActivityDirection::Incoming) {
                     $title24_2 = GetMessage("CRM_LF_ACTIVITY_CALL_INCOMING_TITLE");
                 } elseif ($arActivity["DIRECTION"] == CCrmActivityDirection::Outgoing) {
                     $title24_2 = GetMessage("CRM_LF_ACTIVITY_CALL_OUTGOING_TITLE");
                 }
                 $title24_2 = str_replace("#COMPLETED#", "<i>" . GetMessage($arActivity["COMPLETED"] == "Y" ? "CRM_LF_ACTIVITY_CALL_COMPLETED" : "") . "</i>", $title24_2);
             } elseif ($arActivity["TYPE_ID"] == CCrmActivityType::Email) {
                 if ($arActivity["DIRECTION"] == CCrmActivityDirection::Incoming) {
                     $title24_2 = GetMessage("CRM_LF_ACTIVITY_EMAIL_INCOMING_TITLE");
                 } elseif ($arActivity["DIRECTION"] == CCrmActivityDirection::Outgoing) {
                     $title24_2 = GetMessage("CRM_LF_ACTIVITY_EMAIL_OUTGOING_TITLE");
                 }
             } elseif ($arActivity["TYPE_ID"] == CCrmActivityType::Meeting) {
                 $title24_2 = GetMessage("CRM_LF_ACTIVITY_MEETING_TITLE");
                 $title24_2 = str_replace("#COMPLETED#", "<i>" . GetMessage($arActivity["COMPLETED"] == "Y" ? "CRM_LF_ACTIVITY_MEETING_COMPLETED" : "CRM_LF_ACTIVITY_MEETING_NOT_COMPLETED") . "</i>", $title24_2);
             }
             $title24_2_style = "crm-feed-activity-status";
         }
         $arDestination = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"], "USE_ALL_DESTINATION" => true)), $iMoreCount);
         $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('URL' => "", "MESSAGE" => htmlspecialcharsbx($html_message), "IS_IMPORTANT" => false, "DESTINATION" => $arDestination));
         if ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Activity && $arActivity["TYPE_ID"] == CCrmActivityType::Email && $arActivity["DIRECTION"] == CCrmActivityDirection::Incoming) {
             switch ($arActivity['OWNER_TYPE_ID']) {
                 case CCrmOwnerType::Company:
                     $rsCrmCompany = CCrmCompany::GetListEx(array(), array('ID' => $arActivity['OWNER_ID'], 'CHECK_PERMISSIONS' => 'N'), false, false, array('LOGO'));
                     if ($arCrmCompany = $rsCrmCompany->Fetch()) {
                         $fileID = $arCrmCompany['LOGO'];
                     }
                     break;
                 case CCrmOwnerType::Contact:
                     $rsCrmContact = CCrmContact::GetListEx(array(), array('ID' => $arActivity['OWNER_ID'], 'CHECK_PERMISSIONS' => 'N'), false, false, array('PHOTO'));
                     if ($arCrmContact = $rsCrmContact->Fetch()) {
                         $fileID = $arCrmContact['PHOTO'];
                     }
                     break;
                 default:
                     $fileID = false;
             }
             $arResult["AVATAR_SRC"] = CSocNetLog::FormatEvent_CreateAvatar(array('PERSONAL_PHOTO' => $fileID), $arParams, '');
         } else {
             $arResult["AVATAR_SRC"] = CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY');
         }
         if (isset($title24_2)) {
             $arResult["EVENT_FORMATTED"]["TITLE_24_2"] = $title24_2;
             if (isset($title24_2_style)) {
                 $arResult["EVENT_FORMATTED"]["TITLE_24_2_STYLE"] = $title24_2_style;
             }
         }
         $arResult["CACHED_CSS_PATH"] = array("/bitrix/themes/.default/crm-entity-show.css");
         $arResult["CACHED_JS_PATH"] = array("/bitrix/js/crm/progress_control.js", "/bitrix/js/crm/activity.js", "/bitrix/js/crm/common.js");
         if (IsModuleInstalled("tasks")) {
             $arResult["CACHED_CSS_PATH"][] = "/bitrix/js/tasks/css/tasks.css";
         }
         if (is_array($arComponentReturn) && !empty($arComponentReturn["CACHED_CSS_PATH"])) {
             $arResult["CACHED_CSS_PATH"][] = $arComponentReturn["CACHED_CSS_PATH"];
         }
         if (is_array($arComponentReturn) && !empty($arComponentReturn["CACHED_JS_PATH"])) {
             $arResult["CACHED_JS_PATH"][] = $arComponentReturn["CACHED_JS_PATH"];
         }
         if (intval($iDestinationsMore) > 0) {
             $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iDestinationsMore;
         }
     }
     if ($arFields["ENTITY_TYPE"] == CCrmLiveFeedEntity::Activity && $arActivity["TYPE_ID"] == CCrmActivityType::Email && $arActivity["DIRECTION"] == CCrmActivityDirection::Incoming) {
         $arResult['CREATED_BY']['FORMATTED'] = CCrmOwnerType::GetCaption($arActivity['OWNER_TYPE_ID'], $arActivity['OWNER_ID'], false);
     } else {
         $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
         $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
     }
     if ($arFields['ENTITY_TYPE'] == CCrmLiveFeedEntity::Activity && $arActivity && $arActivity["TYPE_ID"] == CCrmActivityType::Task) {
         $arResult["COMMENTS_PARAMS"] = array("ENTITY_TYPE" => "TK", "ENTITY_XML_ID" => "TASK_" . $arActivity["ASSOCIATED_ENTITY_ID"], "NOTIFY_TAGS" => "FORUM|COMMENT");
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:livefeed.php

示例5: FormatEvent

 public static function FormatEvent($arFields, $arParams, $bMail = false)
 {
     $arResult = array();
     $user_url = strlen($arParams["PATH_TO_USER"]) > 0 ? $arParams["PATH_TO_USER"] : COption::GetOptionString('intranet', 'path_user', '/company/personal/user/#USER_ID#/', $arFields["SITE_ID"]);
     $arManagers = CTimeMan::GetUserManagers($arFields["ENTITY_ID"]);
     $arManagers[] = $arFields["ENTITY_ID"];
     $arManagers[] = $arFields["USER_ID"];
     $arManagers = array_unique($arManagers);
     $dbEntry = CTimeManEntry::GetList(array(), array('ID' => $arFields["SOURCE_ID"]), false, false, array('DATE_START', 'INACTIVE_OR_ACTIVATED', 'ACTIVE'));
     $arEntry = $dbEntry->Fetch();
     $dbManagers = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => implode('|', $arManagers)));
     $arCurrentUserManagers = array();
     $arUser = array();
     $arChanger = array();
     while ($manager = $dbManagers->GetNext()) {
         $info = array('ID' => $manager['ID'], 'LOGIN' => $manager['LOGIN'], 'NAME' => CUser::FormatName(CSite::GetNameFormat(false), $manager, true, false), 'URL' => str_replace(array('#ID#', '#USER_ID#', '#id#', '#user_id#'), $manager['ID'], $user_url), 'WORK_POSITION' => $manager['WORK_POSITION'], 'PERSONAL_PHOTO' => $manager['PERSONAL_PHOTO'], 'PERSONAL_GENDER' => $manager['PERSONAL_GENDER']);
         if ($manager['ID'] == $arFields["ENTITY_ID"]) {
             $arUser = $info;
         }
         if ($manager['ID'] == $arFields["USER_ID"]) {
             $arChanger = $info;
         }
         if ($manager['ID'] != $arFields["ENTITY_ID"] || count($arManagers) == 1) {
             $arCurrentUserManagers[] = $info;
         }
     }
     $arResult["EVENT"] = $arFields;
     $gender = trim($arChanger['PERSONAL_GENDER']);
     if (strlen($gender) <= 0) {
         $gender = 'N';
     }
     if (!$bMail) {
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
             $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arCurrentUserManagers[0]["ID"]));
         }
         ob_start();
         $GLOBALS['APPLICATION']->IncludeComponent('bitrix:timeman.livefeed.workday', $arParams["MOBILE"] == "Y" ? 'mobile' : '', array('USER' => $arUser, 'MANAGER' => $arCurrentUserManagers[0], 'ENTRY' => $arEntry, 'PARAMS' => $arParams), null, array('HIDE_ICONS' => 'Y'));
         $html_message = ob_get_contents();
         ob_end_clean();
         if ($arParams["MOBILE"] == "Y") {
             $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('TITLE_24' => GetMessage('TIMEMAN_ENTRY_LF_TITLE' . ($arEntry['INACTIVE_OR_ACTIVATED'] == 'N' ? '_COMMENT' : ($arFields['ENTITY_ID'] == $arFields['USER_ID'] ? '' : '2')) . $gender . "_24_MOBILE", array('#DATE#' => FormatDate('j F', MakeTimeStamp($arEntry['DATE_START'])))), "MESSAGE" => htmlspecialcharsbx($html_message), "IS_IMPORTANT" => false, "DESCRIPTION" => $arEntry['INACTIVE_OR_ACTIVATED'] == 'N' ? '' : ($arFields['ENTITY_ID'] == $arFields['USER_ID'] ? GetMessage("TIMEMAN_ENTRY_LF_DESCRIPTION_24_MOBILE") : array(GetMessage("TIMEMAN_ENTRY_LF_DESCRIPTION2_24_MOBILE"), GetMessage("TIMEMAN_ENTRY_LF_DESCRIPTION2_24_MOBILE_VALUE"))), "DESCRIPTION_STYLE" => $arEntry["INACTIVE_OR_ACTIVATED"] == "Y" && $arEntry["ACTIVE"] == "N" ? false : "green"));
         } else {
             $href = "javascript:BX.StartNotifySlider('" . $arFields["ENTITY_ID"] . "', '" . $arFields["SOURCE_ID"] . "', 1);";
             $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('TITLE' => GetMessage('TIMEMAN_ENTRY_LF_TITLE' . ($arEntry['INACTIVE_OR_ACTIVATED'] == 'N' ? '_COMMENT' : ($arFields['ENTITY_ID'] == $arFields['USER_ID'] ? '' : '2')) . $gender, array('#URL#' => $href, '#DATE#' => FormatDate('j F', MakeTimeStamp($arEntry['DATE_START'])))), 'TITLE_24' => GetMessage('TIMEMAN_ENTRY_LF_TITLE' . ($arEntry['INACTIVE_OR_ACTIVATED'] == 'N' ? '_COMMENT' : ($arFields['ENTITY_ID'] == $arFields['USER_ID'] ? '' : '2')) . $gender . "_24", array('#URL#' => $href, '#DATE#' => FormatDate('j F', MakeTimeStamp($arEntry['DATE_START'])))), 'URL' => $href, "MESSAGE" => $html_message, "SHORT_MESSAGE" => $html_message, "IS_IMPORTANT" => false, "STYLE" => $arEntry["INACTIVE_OR_ACTIVATED"] == "Y" && $arEntry["ACTIVE"] == "N" ? "workday-edit" : "workday-confirm"));
             $arResult["ENTITY"]["FORMATTED"]["NAME"] = GetMessage("TIMEMAN_NOTIFY_TITLE");
             $arResult["ENTITY"]["FORMATTED"]["URL"] = COption::GetOptionString("timeman", "TIMEMAN_REPORT_PATH", "/company/timeman.php");
         }
         $arResult['AVATAR_SRC'] = CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY');
         $arFieldsTooltip = array('ID' => $arFields['USER_ID'], 'NAME' => $arFields['~CREATED_BY_NAME'], 'LAST_NAME' => $arFields['~CREATED_BY_LAST_NAME'], 'SECOND_NAME' => $arFields['~CREATED_BY_SECOND_NAME'], 'LOGIN' => $arFields['~CREATED_BY_LOGIN']);
         $arResult['CREATED_BY']['TOOLTIP_FIELDS'] = CSocNetLog::FormatEvent_FillTooltip($arFieldsTooltip, $arParams);
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult['EVENT_FORMATTED']['IS_MESSAGE_SHORT'] = CSocNetLog::FormatEvent_IsMessageShort($arFields['MESSAGE']);
         }
     } else {
         $URL = COption::GetOptionString("timeman", "TIMEMAN_REPORT_PATH", "/company/timeman.php");
         $URL = CSocNetLogTools::FormatEvent_GetURL(array("URL" => $URL, "SITE_ID" => $arFields["SITE_ID"]));
         $arResult["ENTITY"]["TYPE_MAIL"] = GetMessage("TIMEMAN_TITLE_FOR_MAIL");
         $arResult['EVENT_FORMATTED'] = array("TITLE" => $arChanger["NAME"] . " " . GetMessage('TIMEMAN_ENTRY_LF_TITLE' . ($arEntry['INACTIVE_OR_ACTIVATED'] == 'N' ? '_COMMENT' : ($arFields['ENTITY_ID'] == $arFields['USER_ID'] ? '' : '2')) . '_MAIL' . $gender, array('#DATE#' => FormatDate('j F', MakeTimeStamp($arEntry['DATE_START'])))), "URL" => $URL, "MESSAGE" => $arFields["TITLE"], "IS_IMPORTANT" => false);
     }
     return $arResult;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:62,代码来源:timeman_notify.php


注:本文中的CSocNetLog::FormatEvent_FillTooltip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。