예제 #1
0
     case CCrmActivityType::Meeting:
     case CCrmActivityType::Email:
         $arParams["~ACTIVITY"]["START_END_TIME"] = $arParams["~ACTIVITY"]["START_TIME"];
         break;
 }
 try {
     $oFormat = new CCrmLiveFeedComponent(array("FIELDS" => $arParams["~FIELDS"], "PARAMS" => $arParams["~PARAMS"], "ACTIVITY" => $arParams["~ACTIVITY"]));
 } catch (Exception $e) {
     return false;
 }
 $aFields = $oFormat->formatFields();
 $arResult["FORMAT"] = "table";
 $arResult["FIELDS_FORMATTED"] = array();
 if (!empty($aFields)) {
     foreach ($aFields as $key => $arField) {
         $arResult["FIELDS_FORMATTED"][$key] = $oFormat->showField($arField);
     }
 }
 $arResult["DATE_WEEK_DAY"] = FormatDate("D", MakeTimeStamp($arParams["~ACTIVITY"]["START_END_TIME"]));
 $arResult["DATE_MONTH_DAY"] = FormatDate("j", MakeTimeStamp($arParams["~ACTIVITY"]["START_END_TIME"]));
 $arResult["IS_COMPLETED"] = $arParams["~ACTIVITY"]["COMPLETED"] == "Y";
 if (!empty($arParams["ACTIVITY"]["DESCRIPTION"])) {
     switch ($arParams["ACTIVITY"]["DESCRIPTION_TYPE"]) {
         case CCrmContentType::BBCode:
             $arResult["DESCRIPTION"] = CCrmLiveFeedComponent::ParseText(htmlspecialcharsback($arParams["ACTIVITY"]["DESCRIPTION"]), array(), array());
             break;
         case CCrmContentType::Html:
             $convertedText = htmlspecialcharsback($arParams["ACTIVITY"]["DESCRIPTION"]);
             $convertedText = preg_replace('/<br\\s*\\/*>/i', '#TMPBR#', $convertedText);
             $convertedText = preg_replace('/<\\/p>/i', '#TMPBR#', $convertedText);
             $convertedText = CTextParser::clearAllTags($convertedText);
예제 #2
0
    die;
}
if (!CModule::IncludeModule('crm')) {
    return;
}
$arEventParams = array();
if (is_array($arParams["~FIELDS"]) && !empty($arParams["~FIELDS"]["~PARAMS"])) {
    $arEventParams = unserialize($arParams["~FIELDS"]["~PARAMS"]);
    if (!is_array($arEventParams)) {
        $arEventParams = array();
    }
}
try {
    $oFormat = new CCrmLiveFeedComponent(array("FIELDS" => $arParams["~FIELDS"], "PARAMS" => $arParams["~PARAMS"], "EVENT_PARAMS" => $arEventParams));
} catch (Exception $e) {
    return false;
}
$aFields = $oFormat->formatFields();
if (in_array($arParams["FIELDS"]["EVENT_ID"], array("crm_company_message", "crm_contact_message", "crm_lead_message", "crm_deal_message"))) {
    $arResult["FORMAT"] = "div";
} else {
    $arResult["FORMAT"] = "table";
}
$arResult["FIELDS_FORMATTED"] = array();
$arUF = !empty($arParams["~FIELDS"]["UF"]) ? $arParams["~FIELDS"]["UF"] : array();
if (!empty($aFields)) {
    foreach ($aFields as $arField) {
        $arResult["FIELDS_FORMATTED"][] = $oFormat->showField($arField, $arUF);
    }
}
$this->IncludeComponentTemplate();