Ejemplo n.º 1
0
 public static function GetNotifyEntryTitle($arLogFields, $type = "COMMENT")
 {
     switch ($arLogFields["EVENT_ID"]) {
         case "crm_lead_add":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_LEAD_ADD", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Lead, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_lead_message":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_LEAD_MESSAGE", array("#message_title#" => CCrmLiveFeedComponent::ParseText($arLogFields["MESSAGE"], array(), array("MAX_LENGTH" => 50)), "#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Lead, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_lead_progress":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_LEAD_PROGRESS", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Lead, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_company_add":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_COMPANY_ADD", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Company, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_company_message":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_COMPANY_MESSAGE", array("#message_title#" => CCrmLiveFeedComponent::ParseText($arLogFields["MESSAGE"], array(), array("MAX_LENGTH" => 50)), "#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Company, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_contact_add":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_CONTACT_ADD", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Contact, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_contact_message":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_CONTACT_MESSAGE", array("#message_title#" => CCrmLiveFeedComponent::ParseText($arLogFields["MESSAGE"], array(), array("MAX_LENGTH" => 50)), "#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Contact, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_deal_add":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_DEAL_ADD", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Deal, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_deal_message":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_DEAL_MESSAGE", array("#message_title#" => CCrmLiveFeedComponent::ParseText($arLogFields["MESSAGE"], array(), array("MAX_LENGTH" => 50)), "#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Deal, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_deal_progress":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_DEAL_PROGRESS", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Deal, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_invoice_add":
             return GetMessage("CRM_LF_IM_" . $type . "_TITLE_INVOICE_ADD", array("#title#" => CCrmOwnerType::GetCaption(CCrmOwnerType::Invoice, $arLogFields["ENTITY_ID"], false)));
             break;
         case "crm_activity_add":
             if ($arActivity = CCrmActivity::GetByID($arLogFields["ENTITY_ID"])) {
                 switch ($arActivity["TYPE_ID"]) {
                     case CCrmActivityType::Meeting:
                         return GetMessage("CRM_LF_IM_" . $type . "_TITLE_ACTIVITY_MEETING_ADD", array("#title#" => $arActivity["SUBJECT"]));
                         break;
                     case CCrmActivityType::Call:
                         return GetMessage("CRM_LF_IM_" . $type . "_TITLE_ACTIVITY_CALL_ADD", array("#title#" => $arActivity["SUBJECT"]));
                         break;
                     case CCrmActivityType::Email:
                         return GetMessage("CRM_LF_IM_" . $type . "_TITLE_ACTIVITY_EMAIL_ADD", array("#title#" => $arActivity["SUBJECT"]));
                         break;
                     case CCrmActivityType::Task:
                         return GetMessage("CRM_LF_IM_" . $type . "_TITLE_ACTIVITY_TASK_ADD", array("#title#" => $arActivity["SUBJECT"]));
                         break;
                 }
             }
             break;
     }
     return "";
 }
Ejemplo n.º 2
0
 }
 $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);
             $convertedText = str_replace('#TMPBR#', '<br>', $convertedText);
             $arResult["DESCRIPTION"] = $convertedText;
             break;
         default:
             $arResult["DESCRIPTION"] = $arParams["ACTIVITY"]["DESCRIPTION"];
     }
 } else {
     $arResult["DESCRIPTION"] = $arParams["ACTIVITY"]["DESCRIPTION"];
 }