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


PHP CSocNetLog::FormatEvent_IsMessageShort方法代码示例

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


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

示例1: SocNetFormatEvent

 public static function SocNetFormatEvent($arFields, $arParams, $bMail = false)
 {
     $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('TITLE' => $arFields["TITLE"], 'TITLE_24' => $arFields["TITLE"], "MESSAGE" => $arFields["~MESSAGE"], "SHORT_MESSAGE" => $arFields["~MESSAGE"], 'IS_IMPORTANT' => false, 'STYLE' => 'new-employee'));
     $arResult['CREATED_BY']['FORMATTED'] = "CRM";
     $arResult['ENTITY']['FORMATTED']["NAME"] = GetMessage("CRM_EXT_SALE_IM_GROUP") . " <a href='" . str_replace("#group_id#", $arFields["ENTITY_ID"], $arParams["PATH_TO_GROUP"]) . "'>" . $arFields["GROUP_NAME"] . "</a>";
     $arResult['ENTITY']['FORMATTED']["URL"] = "";
     if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
         $arResult['EVENT_FORMATTED']['IS_MESSAGE_SHORT'] = CSocNetLog::FormatEvent_IsMessageShort($arFields['MESSAGE']);
     }
     return $arResult;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:11,代码来源:crm_external_sale_import.php

示例2: FormatEvent

 public static function FormatEvent($arFields, $arParams, $bMail = false)
 {
     $arResult = array("EVENT" => $arFields);
     $user_url = str_replace('#user_id#', $arFields['ENTITY_ID'], $arParams['PATH_TO_USER']);
     $dbRes = CUser::GetByID($arFields['ENTITY_ID']);
     $arUser = $dbRes->Fetch();
     if ($arUser) {
         if (!$bMail) {
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arUser["ID"]));
             }
             ob_start();
             $GLOBALS['APPLICATION']->IncludeComponent('bitrix:intranet.livefeed.newuser', '', array('USER' => $arUser, 'PARAMS' => $arParams, 'AVATAR_SRC' => CSocNetLog::FormatEvent_CreateAvatar($arFields, $arParams, 'CREATED_BY'), 'USER_URL' => $user_url), null, array('HIDE_ICONS' => 'Y'));
             $html_message = ob_get_contents();
             ob_end_clean();
             $arResult = array('EVENT' => $arFields, 'EVENT_FORMATTED' => array('TITLE' => GetMessage('I_NEW_USER_TITLE'), 'TITLE_24' => GetMessage('I_NEW_USER_TITLE'), "MESSAGE" => $html_message, "SHORT_MESSAGE" => $html_message, 'IS_IMPORTANT' => true, 'STYLE' => 'new-employee', 'AVATAR_STYLE' => 'avatar-info'));
             $arResult['CREATED_BY']['FORMATTED'] = '';
             if (is_array($arUser['UF_DEPARTMENT']) && count($arUser['UF_DEPARTMENT']) > 0) {
                 if ($arParams["MOBILE"] == "Y") {
                     $url = "";
                 } else {
                     $url = $arParams['PATH_TO_CONPANY_DEPARTMENT'];
                     if (strlen($url) <= 0) {
                         $url = $arParams['PATH_TO_COMPANY_DEPARTMENT'];
                     }
                 }
                 $dbRes = CIBlockSection::GetList(array('ID' => 'ASC'), array('ID' => $arUser['UF_DEPARTMENT']));
                 if ($arSection = $dbRes->GetNext()) {
                     if (strlen($url) > 0) {
                         $arResult['CREATED_BY']['FORMATTED'] = '<a href="' . str_replace('#ID#', $arSection['ID'], $url) . '">' . $arSection['NAME'] . '</a>';
                     } else {
                         $arResult['CREATED_BY']['FORMATTED'] = $arSection['NAME'];
                     }
                 }
             }
             if (!$arResult['CREATED_BY']['FORMATTED']) {
                 $arResult['CREATED_BY']['FORMATTED'] = self::GetSiteName();
             }
             $arResult['ENTITY']['FORMATTED']["NAME"] = GetMessage('I_NEW_USER_TITLE');
             $arResult['ENTITY']['FORMATTED']["URL"] = $user_url;
             if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
                 $arResult['EVENT_FORMATTED']['IS_MESSAGE_SHORT'] = CSocNetLog::FormatEvent_IsMessageShort($arFields['MESSAGE']);
             }
         }
         return $arResult;
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:47,代码来源:notify.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

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