本文整理汇总了PHP中CCrmFieldMulti::GetEntityTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmFieldMulti::GetEntityTypes方法的具体用法?PHP CCrmFieldMulti::GetEntityTypes怎么用?PHP CCrmFieldMulti::GetEntityTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmFieldMulti
的用法示例。
在下文中一共展示了CCrmFieldMulti::GetEntityTypes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialcharsbx
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
global $APPLICATION;
$APPLICATION->AddHeadString('<script type="text/javascript" src="' . CUtil::GetAdditionalFileURL(SITE_TEMPLATE_PATH . '/crm_mobile.js') . '"></script>', true, \Bitrix\Main\Page\AssetLocation::AFTER_JS_KERNEL);
$APPLICATION->SetPageProperty('BodyClass', 'crm-page');
$UID = $arResult['UID'];
$mode = $arResult['MODE'];
$prefix = htmlspecialcharsbx($UID);
$entityID = $arResult['ENTITY_ID'];
$entity = $arResult['ENTITY'];
$dataItem = CCrmMobileHelper::PrepareCompanyData($entity);
$multiFieldTypeInfos = CCrmFieldMulti::GetEntityTypes();
$multiFieldTypeSettings = array();
foreach ($multiFieldTypeInfos as $multiFieldTypeID => &$multiFieldTypeInfo) {
$multiFieldTypeSettings[$multiFieldTypeID] = array();
foreach ($multiFieldTypeInfo as $multiFieldValueTypeID => &$multiFieldValueTypeInfo) {
$multiFieldTypeSettings[$multiFieldTypeID][$multiFieldValueTypeID] = isset($multiFieldValueTypeInfo['ABBR']) ? $multiFieldValueTypeInfo['ABBR'] : $multiFieldValueTypeID;
}
unset($multiFieldValueTypeInfo);
}
unset($multiFieldTypeInfo);
$formTitle = GetMessage("M_CRM_COMPANY_EDIT_{$mode}_TITLE");
if (!function_exists('__CrmMobileCompanyEditRenderMultiFields')) {
function __CrmMobileCompanyEditRenderMultiFields($typeName, &$fields, &$typeInfos, $prefix = '')
{
$typeName = strtoupper($typeName);
$data = isset($fields[$typeName]) ? $fields[$typeName] : array();
if ($prefix !== '') {
示例2: showField
//.........这里部分代码省略.........
break;
case "AVATAR_ID":
if (intval($arField["VALUE"]) > 0) {
$arFileTmp = CFile::ResizeImageGet($arField["VALUE"], array('width' => $this->params["AVATAR_SIZE"], 'height' => $this->params["AVATAR_SIZE"]), BX_RESIZE_IMAGE_EXACT, false);
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding">';
$strResult .= '<img src="' . $arFileTmp["src"] . '" border="0" alt="' . $this->params["AVATAR_SIZE"] . '" width="" height="' . $this->params["AVATAR_SIZE"] . '">';
$strResult .= '</span>';
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "SUM":
if (intval($arField["VALUE"]["VALUE"]) > 0) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding">';
$strResult .= '<span class="crm-feed-info-sum">' . CCrmCurrency::MoneyToString($arField["VALUE"]["VALUE"], $arField["VALUE"]["CURRENCY"]) . '</span>';
$strResult .= '</span>';
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "PHONE":
case "EMAIL":
if (!empty($arField["VALUE"])) {
$infos = CCrmFieldMulti::GetEntityTypes();
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding">';
$strResult .= CCrmViewHelper::PrepareFirstMultiFieldHtml($arField["FORMAT"], $arField["VALUE"], $infos[$arField["FORMAT"]]);
if (count($arField["VALUE"]) > 1 || !empty($arField["VALUE"]["WORK"]) && count($arField["VALUE"]["WORK"]) > 1 || !empty($arField["VALUE"]["MOBILE"]) && count($arField["VALUE"]["MOBILE"]) > 1 || !empty($arField["VALUE"]["FAX"]) && count($arField["VALUE"]["FAX"]) > 1 || !empty($arField["VALUE"]["PAGER"]) && count($arField["VALUE"]["PAGER"]) > 1 || !empty($arField["VALUE"]["OTHER"]) && count($arField["VALUE"]["OTHER"]) > 1) {
$anchorID = strtolower($arField["FORMAT"]);
$strResult .= '<span style="margin-left: 10px;" class="crm-item-tel-list" id="' . htmlspecialcharsbx($anchorID) . '"' . ' onclick="' . CCrmViewHelper::PrepareMultiFieldValuesPopup($anchorID, $anchorID, $arField["FORMAT"], $arField["VALUE"], $infos[$arField["FORMAT"]]) . '"></span>';
}
$strResult .= '</span>';
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
if ($arField["FORMAT"] == "PHONE" && defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->RegisterTag("CRM_CALLTO_SETTINGS");
}
}
break;
case "TEXT_FORMATTED":
case "TEXT_FORMATTED_BOLD":
if ($arField["VALUE"] != CCrmLiveFeed::UntitledMessageStub) {
$text_formatted = $this->ParseText(htmlspecialcharsback($arField["VALUE"]), $arUF, $arParams["PARAMS"]);
if (strlen($text_formatted) > 0) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_colspan2#";
if ($arField["FORMAT"] == "TEXT_FORMATTED_BOLD") {
$strResult .= "<b>" . $text_formatted . "</b>";
} else {
$strResult .= $text_formatted;
}
$strResult .= "#cell_end#";
示例3: PrepareExportFieldsList
public static function PrepareExportFieldsList(&$arSelect, $arFieldMap, $processMultiFields = true)
{
if ($processMultiFields) {
$arMultiFieldTypes = CCrmFieldMulti::GetEntityTypes();
foreach ($arMultiFieldTypes as $typeID => &$arType) {
if (isset($arFieldMap[$typeID])) {
continue;
}
$arFieldMap[$typeID] = array();
$arValueTypes = array_keys($arType);
foreach ($arValueTypes as $valueType) {
$arFieldMap[$typeID][] = "{$typeID}_{$valueType}";
}
}
unset($arType);
}
foreach ($arFieldMap as $fieldID => &$arFieldReplace) {
$offset = array_search($fieldID, $arSelect, true);
if ($offset === false) {
continue;
}
array_splice($arSelect, $offset, 1, array_diff($arFieldReplace, $arSelect));
}
unset($arFieldReplace);
}
示例4: __CrmQuickPanelViewPrepareMultiFields
function __CrmQuickPanelViewPrepareMultiFields(array $multiFields, $entityTypeName, $entityID, $typeID)
{
if (empty($multiFields)) {
return null;
}
$arEntityTypeInfos = CCrmFieldMulti::GetEntityTypeInfos();
$arEntityTypes = CCrmFieldMulti::GetEntityTypes();
$sipConfig = array('STUB' => GetMessage('CRM_ENTITY_QPV_MULTI_FIELD_NOT_ASSIGNED'), 'ENABLE_SIP' => true, 'SIP_PARAMS' => array('ENTITY_TYPE' => 'CRM_' . $entityTypeName, 'ENTITY_ID' => $entityID));
$typeInfo = isset($arEntityTypeInfos[$typeID]) ? $arEntityTypeInfos[$typeID] : array();
$result = array('type' => 'multiField', 'caption' => isset($typeInfo['NAME']) ? $typeInfo['NAME'] : $typeID, 'data' => array('type' => $typeID, 'items' => array()));
foreach ($multiFields as $multiField) {
$value = isset($multiField['VALUE']) ? $multiField['VALUE'] : '';
$valueType = isset($multiField['VALUE_TYPE']) ? $multiField['VALUE_TYPE'] : '';
$entityType = $arEntityTypes[$typeID];
$valueTypeInfo = isset($entityType[$valueType]) ? $entityType[$valueType] : null;
$params = array('VALUE' => $value, 'VALUE_TYPE_ID' => $valueType, 'VALUE_TYPE' => $valueTypeInfo);
$result['data']['items'][] = CCrmViewHelper::PrepareMultiFieldValueItemData($typeID, $params, $sipConfig);
}
return $result;
}
示例5: PrepareMultiFieldValueItemData
public static function PrepareMultiFieldValueItemData($typeName, $params, $arOptions = array())
{
$enableSip = is_array($arOptions) && isset($arOptions['ENABLE_SIP']) && (bool) $arOptions['ENABLE_SIP'];
$sipParams = $enableSip && isset($arOptions['SIP_PARAMS']) ? $arOptions['SIP_PARAMS'] : null;
$value = isset($params['VALUE']) ? $params['VALUE'] : '';
$valueTypeID = isset($params['VALUE_TYPE_ID']) ? $params['VALUE_TYPE_ID'] : '';
$valueType = isset($params['VALUE_TYPE']) ? $params['VALUE_TYPE'] : null;
if (!$valueType && $valueTypeID !== '') {
$arEntityTypes = CCrmFieldMulti::GetEntityTypes();
$arValueTypes = isset($arEntityTypes[$typeName]) ? $arEntityTypes[$typeName] : array();
$valueType = isset($arValueTypes[$valueTypeID]) ? $arValueTypes[$valueTypeID] : null;
}
$itemData = array('value' => self::PrepareMultiFieldHtml($typeName, $params, $arOptions), 'type' => htmlspecialcharsbx(is_array($valueType) && isset($valueType['SHORT']) ? strtolower($valueType['SHORT']) : ''));
if ($typeName === 'PHONE' && $enableSip && $value !== '') {
$itemData['sipCallHtml'] = self::PrepareSipCallHtml($value, $sipParams);
}
return $itemData;
}