Ejemplo n.º 1
0
            $entityData[$k] = array('type' => 'custom', 'data' => array('html' => "<div class=\"crm-detail-stage\"><div class=\"crm-detail-stage-name\">{$statusText}</div>{$progressHtml}</div>"));
        } elseif ($k === 'CURRENCY_ID') {
            $entityData[$k] = __CrmQuickPanelViewPrepareCurrencyEnumeration($v, $enableInstantEdit, $entityContext);
        } elseif ($k === 'OPPORTUNITY') {
            $entityData[$k] = __CrmQuickPanelViewPrepareMoney(isset($entityFields['~OPPORTUNITY']) ? $entityFields['~OPPORTUNITY'] : 0.0, isset($entityFields['~CURRENCY_ID']) ? $entityFields['~CURRENCY_ID'] : CCrmCurrency::GetBaseCurrencyID(), $enableInstantEdit, $arResult['SERVICE_URL'], $entityContext);
        } elseif ($k === 'BIRTHDATE') {
            $entityData[$k] = array('type' => 'datetime', 'editable' => $enableInstantEdit, 'data' => array('text' => $v !== null && $v !== '' ? ConvertTimeStamp(MakeTimeStamp($v), 'SHORT', SITE_ID) : '', 'enableTime' => false));
        } elseif ($k === 'OPENED') {
            $v = $v !== null && $v !== '' ? strtoupper($v) : 'N';
            $entityData[$k] = array('type' => 'boolean', 'editable' => $enableInstantEdit, 'data' => array('baseType' => 'char', 'value' => $v));
        } elseif ($k === 'ASSIGNED_BY_ID') {
            $entityData['ASSIGNED_BY_ID'] = __CrmQuickPanelViewPrepareResponsible($entityFields, $userProfilePath, $nameTemplate, $enableInstantEdit, $arResult['INSTANT_EDITOR_ID'], $arResult['SERVICE_URL']);
        } elseif ($k === 'COMMENTS') {
            $entityData[$k] = array('type' => 'html', 'editable' => $enableInstantEdit, 'data' => array('html' => $entityFields["~{$k}"], 'serviceUrl' => $arResult['SERVICE_URL']));
        } elseif ($k === 'ADDRESS') {
            $entityData[$k] = array('type' => 'address', 'editable' => false, 'data' => array('lines' => LeadAddressFormatter::prepareLines($entityFields, array('NL2BR' => true))));
        } elseif ($k === 'STATUS_DESCRIPTION' || $k === 'SOURCE_DESCRIPTION') {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('text' => $entityFields["~{$k}"], 'multiline' => true));
        } else {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('text' => $entityFields["~{$k}"]));
        }
        $caption = isset($formFieldNames[$k]) ? $formFieldNames[$k] : '';
        if ($caption === '') {
            $caption = CCrmLead::GetFieldCaption($k);
        }
        $entityData[$k]['caption'] = $caption;
    }
    $arResult['HEAD_TITLE'] = isset($entityFields['TITLE']) ? $entityFields['TITLE'] : '';
    $arResult['HEAD_TITLE_FIELD_ID'] = 'TITLE';
} elseif ($entityTypeID === CCrmOwnerType::Quote) {
    $entityContext['SIP_MANAGER_CONFIG'][CCrmOwnerType::QuoteName] = array('ENTITY_TYPE' => CCrmOwnerType::QuoteName, 'SERVICE_URL' => '/bitrix/components/bitrix/crm.quote.show/ajax.php?' . bitrix_sessid_get());
Ejemplo n.º 2
0
$arResult['FIELDS']['tab_1'][] = array('id' => 'PHONE', 'name' => GetMessage('CRM_FIELD_PHONE'), 'type' => 'custom', 'colspan' => true, 'value' => CCrmViewHelper::PrepareFormMultiField($arResult['ELEMENT'], 'PHONE', $prefix, $arMutliFieldTypeInfos, array('ENABLE_SIP' => true, 'SIP_PARAMS' => array('ENTITY_TYPE' => 'CRM_' . CCrmOwnerType::LeadName, 'ENTITY_ID' => $arResult['ELEMENT_ID']))), 'isTactile' => true);
//<-- PHONE
// WEB -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'WEB', 'name' => GetMessage('CRM_FIELD_WEB'), 'type' => 'custom', 'colspan' => true, 'value' => CCrmViewHelper::PrepareFormMultiField($arResult['ELEMENT'], 'WEB', $prefix, $arMutliFieldTypeInfos), 'isTactile' => true);
// <-- WEB
// IM -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'IM', 'name' => GetMessage('CRM_FIELD_MESSENGER'), 'type' => 'custom', 'colspan' => true, 'value' => CCrmViewHelper::PrepareFormMultiField($arResult['ELEMENT'], 'IM', $prefix, $arMutliFieldTypeInfos), 'isTactile' => true);
// <-- IM
// COMPANY TITLE -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'COMPANY_TITLE', 'name' => GetMessage('CRM_FIELD_COMPANY_TITLE_2'), 'type' => 'label', 'params' => array('size' => 50), 'value' => isset($arResult['ELEMENT']['~COMPANY_TITLE']) ? $arResult['ELEMENT']['~COMPANY_TITLE'] : '', 'isTactile' => true);
// <-- COMPANY TITLE
// POST -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'POST', 'name' => GetMessage('CRM_FIELD_POST'), 'type' => 'label', 'params' => array('size' => 50), 'value' => isset($arResult['ELEMENT']['~POST']) ? $arResult['ELEMENT']['~POST'] : '', 'isTactile' => true);
//<-- POST
// ADDRESS -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'ADDRESS', 'name' => GetMessage('CRM_FIELD_ADDRESS'), 'type' => 'custom', 'value' => LeadAddressFormatter::format($arResult['ELEMENT'], array('SEPARATOR' => AddressSeparator::HtmlLineBreak, 'NL2BR' => true)), 'isTactile' => true);
//<-- ADDRESS
// COMMENTS -->
$arResult['FIELDS']['tab_1'][] = array('id' => 'COMMENTS', 'name' => GetMessage('CRM_FIELD_COMMENTS'), 'type' => 'custom', 'value' => isset($arResult['ELEMENT']['~COMMENTS']) ? $arResult['ELEMENT']['~COMMENTS'] : '', 'isTactile' => true);
// <-- COMMENTS
//<-- CONTACT INFO SECTION
if ($arResult['ELEMENT']['STATUS_ID'] == 'CONVERTED') {
    if (!$CCrmLead->cPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'READ')) {
        ob_start();
        $arResult['CONTACT_COUNT'] = $APPLICATION->IncludeComponent('bitrix:crm.contact.list', '', array('CONTACT_COUNT' => '20', 'PATH_TO_CONTACT_SHOW' => $arParams['PATH_TO_CONTACT_SHOW'], 'PATH_TO_CONTACT_EDIT' => $arParams['PATH_TO_CONTACT_EDIT'], 'PATH_TO_COMPANY_SHOW' => $arParams['PATH_TO_COMPANY_SHOW'], 'PATH_TO_DEAL_EDIT' => $arParams['PATH_TO_DEAL_EDIT'], 'INTERNAL_FILTER' => array('ID' => $arResult['ELEMENT']['CONTACT_ID']), 'GRID_ID_SUFFIX' => 'LEAD_SHOW', 'FORM_ID' => $arResult['FORM_ID'], 'TAB_ID' => 'tab_contact'), false);
        $sVal = ob_get_contents();
        ob_end_clean();
        $arResult['FIELDS']['tab_contact'][] = array('id' => 'LEAD_CONTACTS', 'name' => GetMessage('CRM_FIELD_LEAD_CONTACTS'), 'colspan' => true, 'type' => 'custom', 'value' => $sVal);
    }
    if (!$CCrmLead->cPerms->HavePerm('COMPANY', BX_CRM_PERM_NONE, 'READ')) {
        ob_start();
Ejemplo n.º 3
0
                    $totalTaskQty += $taskQty;
                    if ($totalTaskQty > 5) {
                        break;
                    }
                }
            }
            unset($arDocState);
            if (!$isInExportMode) {
                $arLead['BIZPROC_STATUS_HINT'] = '<span class=\'bizproc-item-title\'>' . GetMessage('CRM_BP_R_P') . ': <a href=\'' . $arLead['PATH_TO_BIZPROC_LIST'] . '\' title=\'' . GetMessage('CRM_BP_R_P_TITLE') . '\'>' . $docStatesQty . '</a></span>' . ($totalTaskQty === 0 ? '' : '<br /><span class=\'bizproc-item-title\'>' . GetMessage('CRM_TASKS') . ': <a href=\'' . $arLead['PATH_TO_USER_BP'] . '\' title=\'' . GetMessage('CRM_TASKS_TITLE') . '\'>' . $totalTaskQty . ($totalTaskQty > 5 ? '+' : '') . '</a></span>');
            }
        }
    }
    $arLead['ASSIGNED_BY_ID'] = $arLead['~ASSIGNED_BY_ID'] = intval($arLead['ASSIGNED_BY']);
    $arLead['ASSIGNED_BY'] = CUser::FormatName($arParams['NAME_TEMPLATE'], array('LOGIN' => $arLead['ASSIGNED_BY_LOGIN'], 'NAME' => $arLead['ASSIGNED_BY_NAME'], 'LAST_NAME' => $arLead['ASSIGNED_BY_LAST_NAME'], 'SECOND_NAME' => $arLead['ASSIGNED_BY_SECOND_NAME']), true, false);
    if (isset($arSelectMap['FULL_ADDRESS'])) {
        $arLead['FULL_ADDRESS'] = LeadAddressFormatter::format($arLead, array('SEPARATOR' => AddressSeparator::HtmlLineBreak, 'NL2BR' => true));
    }
}
unset($arLead);
$CCrmUserType->ListAddEnumFieldsValue($arResult, $arResult['LEAD'], $arResult['LEAD_UF'], $sExportType !== '' ? ', ' : '<br />', $sExportType !== '', array('FILE_URL_TEMPLATE' => '/bitrix/components/bitrix/crm.lead.show/show_file.php?ownerId=#owner_id#&fieldName=#field_name#&fileId=#file_id#'));
if (isset($arResult['LEAD_ID']) && !empty($arResult['LEAD_ID'])) {
    // try to load product rows
    $arProductRows = CCrmLead::LoadProductRows(array_keys($arResult['LEAD_ID']));
    foreach ($arProductRows as $arProductRow) {
        $ownerID = $arProductRow['OWNER_ID'];
        if (!isset($arResult['LEAD'][$ownerID])) {
            continue;
        }
        $arEntity =& $arResult['LEAD'][$ownerID];
        if (!isset($arEntity['PRODUCT_ROWS'])) {
            $arEntity['PRODUCT_ROWS'] = array();
Ejemplo n.º 4
0
 private function MapField(&$entityInfo, $fieldName)
 {
     $result = '';
     $typeID = isset($entityInfo['TYPE_ID']) ? intval($entityInfo['TYPE_ID']) : CCrmOwnerType::Undefined;
     $fields = isset($entityInfo['FIELDS']) ? $entityInfo['FIELDS'] : array();
     $isHtml = $this->contentType === CCrmContentType::Html;
     $isBBCode = $this->contentType === CCrmContentType::BBCode;
     $isPlainText = $this->contentType === CCrmContentType::PlainText;
     if ($typeID === CCrmOwnerType::Lead) {
         switch ($fieldName) {
             case 'ID':
                 $result = isset($fields[$fieldName]) ? intval($fields[$fieldName]) : 0;
                 break;
             case 'NAME':
             case 'SECOND_NAME':
             case 'LAST_NAME':
             case 'TITLE':
             case 'COMPANY_TITLE':
             case 'SOURCE_DESCRIPTION':
             case 'STATUS_DESCRIPTION':
             case 'POST':
             case 'ASSIGNED_BY_WORK_POSITION':
                 $result = self::MapFieldValue($fields, $fieldName, $isHtml);
                 break;
             case 'ADDRESS':
                 $addressOptions = array();
                 if ($isHtml) {
                     $addressOptions['SEPARATOR'] = AddressSeparator::HtmlLineBreak;
                     $addressOptions['NL2BR'] = true;
                 } else {
                     $addressOptions['SEPARATOR'] = AddressSeparator::NewLine;
                 }
                 $result = LeadAddressFormatter::format($fields, $addressOptions);
                 break;
             case 'COMMENTS':
                 if ($isBBCode) {
                     $result = self::MapHtmlFieldAsBbCode($fields, 'COMMENTS');
                 } elseif ($isPlainText) {
                     $result = self::MapHtmlFieldAsPlainText($fields, 'COMMENTS');
                 } else {
                     $result = self::MapFieldValue($fields, $fieldName, false);
                 }
                 break;
             case 'SOURCE':
                 $result = self::MapReferenceValue(self::PrepareSources(), $fields, 'SOURCE_ID', $isHtml);
                 break;
             case 'STATUS':
                 $result = self::MapReferenceValue(self::PrepareLeadStatuses(), $fields, 'STATUS_ID', $isHtml);
                 break;
             case 'FORMATTED_NAME':
                 $result = CCrmLead::PrepareFormattedName(array('HONORIFIC' => isset($fields['HONORIFIC']) ? $fields['HONORIFIC'] : '', 'NAME' => isset($fields['NAME']) ? $fields['NAME'] : '', 'SECOND_NAME' => isset($fields['SECOND_NAME']) ? $fields['SECOND_NAME'] : '', 'LAST_NAME' => isset($fields['LAST_NAME']) ? $fields['LAST_NAME'] : ''));
                 if ($isHtml) {
                     $result = htmlspecialcharsbx($result);
                 }
                 break;
             case 'ASSIGNED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['ASSIGNED_BY_ID']) ? $fields['ASSIGNED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'CREATED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['CREATED_BY_ID']) ? $fields['CREATED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'MODIFY_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['MODIFY_BY_ID']) ? $fields['MODIFY_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'DATE_CREATE':
                 $result = isset($fields['DATE_CREATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_CREATE'])) : '';
                 break;
             case 'DATE_MODIFY':
                 $result = isset($fields['DATE_MODIFY']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_MODIFY'])) : '';
                 break;
             case 'CURRENCY':
                 $result = isset($fields['CURRENCY_ID']) ? CCrmCurrency::GetCurrencyName($fields['CURRENCY_ID']) : '';
                 break;
             case 'OPPORTUNITY':
                 $result = isset($fields['OPPORTUNITY']) ? $fields['OPPORTUNITY'] : 0.0;
                 break;
             case 'OPPORTUNITY_FORMATTED':
                 $result = CCrmCurrency::MoneyToString(isset($fields['OPPORTUNITY']) ? $fields['OPPORTUNITY'] : 0.0, isset($fields['CURRENCY_ID']) ? $fields['CURRENCY_ID'] : '');
                 break;
         }
     } elseif ($typeID === CCrmOwnerType::Deal) {
         switch ($fieldName) {
             case 'ID':
                 $result = isset($fields[$fieldName]) ? intval($fields[$fieldName]) : 0;
                 break;
             case 'TITLE':
             case 'ASSIGNED_BY_WORK_POSITION':
                 $result = self::MapFieldValue($fields, $fieldName, $isHtml);
                 break;
             case 'COMMENTS':
                 if ($isBBCode) {
                     $result = self::MapHtmlFieldAsBbCode($fields, 'COMMENTS');
                 } elseif ($isPlainText) {
                     $result = self::MapHtmlFieldAsPlainText($fields, 'COMMENTS');
                 } else {
                     $result = self::MapFieldValue($fields, $fieldName, false);
                 }
                 break;
             case 'TYPE':
                 $result = self::MapReferenceValue(self::PrepareDealTypes(), $fields, 'TYPE_ID', $isHtml);
                 break;
             case 'STAGE':
                 $result = self::MapReferenceValue(self::PrepareDealStages(), $fields, 'STAGE_ID', $isHtml);
                 break;
             case 'PROBABILITY':
                 $result = (isset($fields[$fieldName]) ? intval($fields[$fieldName]) : 0) . ' %';
                 break;
             case 'BEGINDATE':
                 $result = isset($fields['BEGINDATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['BEGINDATE'])) : '';
                 break;
             case 'CLOSEDATE':
                 $result = isset($fields['CLOSEDATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['CLOSEDATE'])) : '';
                 break;
             case 'ASSIGNED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['ASSIGNED_BY_ID']) ? $fields['ASSIGNED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'CREATED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['CREATED_BY_ID']) ? $fields['CREATED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'MODIFY_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['MODIFY_BY_ID']) ? $fields['MODIFY_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'DATE_CREATE':
                 $result = isset($fields['DATE_CREATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_CREATE'])) : '';
                 break;
             case 'DATE_MODIFY':
                 $result = isset($fields['DATE_MODIFY']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_MODIFY'])) : '';
                 break;
             case 'CURRENCY':
                 $result = isset($fields['CURRENCY_ID']) ? CCrmCurrency::GetCurrencyName($fields['CURRENCY_ID']) : '';
                 break;
             case 'OPPORTUNITY':
                 $result = isset($fields['OPPORTUNITY']) ? $fields['OPPORTUNITY'] : 0.0;
                 break;
             case 'OPPORTUNITY_FORMATTED':
                 $result = CCrmCurrency::MoneyToString(isset($fields['OPPORTUNITY']) ? $fields['OPPORTUNITY'] : 0.0, isset($fields['CURRENCY_ID']) ? $fields['CURRENCY_ID'] : '');
                 break;
             case 'COMPANY':
                 $result = self::ResolveEntityInfo(CCrmOwnerType::Company, isset($fields['COMPANY_ID']) ? intval($fields['COMPANY_ID']) : 0);
                 break;
             case 'CONTACT':
                 $result = self::ResolveEntityInfo(CCrmOwnerType::Contact, isset($fields['CONTACT_ID']) ? intval($fields['CONTACT_ID']) : 0);
                 break;
         }
     } elseif ($typeID === CCrmOwnerType::Contact) {
         switch ($fieldName) {
             case 'ID':
                 $result = isset($fields[$fieldName]) ? intval($fields[$fieldName]) : 0;
                 break;
             case 'NAME':
             case 'SECOND_NAME':
             case 'LAST_NAME':
             case 'POST':
             case 'SOURCE_DESCRIPTION':
             case 'ASSIGNED_BY_WORK_POSITION':
                 $result = self::MapFieldValue($fields, $fieldName, $isHtml);
                 break;
             case 'ADDRESS':
                 $addressOptions = array();
                 if ($isHtml) {
                     $addressOptions['SEPARATOR'] = AddressSeparator::HtmlLineBreak;
                     $addressOptions['NL2BR'] = true;
                 } else {
                     $addressOptions['SEPARATOR'] = AddressSeparator::NewLine;
                 }
                 $result = ContactAddressFormatter::format($fields, $addressOptions);
                 break;
             case 'COMMENTS':
                 if ($isBBCode) {
                     $result = self::MapHtmlFieldAsBbCode($fields, 'COMMENTS');
                 } elseif ($isPlainText) {
                     $result = self::MapHtmlFieldAsPlainText($fields, 'COMMENTS');
                 } else {
                     $result = self::MapFieldValue($fields, $fieldName, false);
                 }
                 break;
             case 'FORMATTED_NAME':
                 $result = CCrmContact::PrepareFormattedName(array('HONORIFIC' => isset($fields['HONORIFIC']) ? $fields['HONORIFIC'] : '', 'NAME' => isset($fields['NAME']) ? $fields['NAME'] : '', 'SECOND_NAME' => isset($fields['SECOND_NAME']) ? $fields['SECOND_NAME'] : '', 'LAST_NAME' => isset($fields['LAST_NAME']) ? $fields['LAST_NAME'] : ''));
                 if ($isHtml) {
                     $result = htmlspecialcharsbx($result);
                 }
                 break;
             case 'SOURCE':
                 $result = self::MapReferenceValue(self::PrepareSources(), $fields, 'SOURCE_ID', $isHtml);
                 break;
             case 'TYPE':
                 $result = self::MapReferenceValue(self::PrepareContactTypes(), $fields, 'TYPE_ID', $isHtml);
                 break;
             case 'COMPANY':
                 $result = self::ResolveEntityInfo(CCrmOwnerType::Company, isset($fields['COMPANY_ID']) ? intval($fields['COMPANY_ID']) : 0);
                 break;
             case 'ASSIGNED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['ASSIGNED_BY_ID']) ? $fields['ASSIGNED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'CREATED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['CREATED_BY_ID']) ? $fields['CREATED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'MODIFY_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['MODIFY_BY_ID']) ? $fields['MODIFY_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'DATE_CREATE':
                 $result = isset($fields['DATE_CREATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_CREATE'])) : '';
                 break;
             case 'DATE_MODIFY':
                 $result = isset($fields['DATE_MODIFY']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_MODIFY'])) : '';
                 break;
         }
     } elseif ($typeID === CCrmOwnerType::Company) {
         switch ($fieldName) {
             case 'ID':
                 $result = isset($fields[$fieldName]) ? intval($fields[$fieldName]) : 0;
                 break;
             case 'TITLE':
             case 'COMPANY_TITLE':
             case 'SOURCE_DESCRIPTION':
             case 'ASSIGNED_BY_WORK_POSITION':
             case 'BANKING_DETAILS':
                 $result = self::MapFieldValue($fields, $fieldName, $isHtml);
                 break;
             case 'ADDRESS':
             case 'ADDRESS_LEGAL':
                 $addressOptions = array('TYPE_ID' => $fieldName === 'ADDRESS' ? EntityAddress::Primary : EntityAddress::Registered);
                 if ($isHtml) {
                     $addressOptions['SEPARATOR'] = AddressSeparator::HtmlLineBreak;
                     $addressOptions['NL2BR'] = true;
                 } else {
                     $addressOptions['SEPARATOR'] = AddressSeparator::NewLine;
                 }
                 $result = CompanyAddressFormatter::format($fields, $addressOptions);
                 break;
             case 'COMMENTS':
                 if ($isBBCode) {
                     $result = self::MapHtmlFieldAsBbCode($fields, 'COMMENTS');
                 } elseif ($isPlainText) {
                     $result = self::MapHtmlFieldAsPlainText($fields, 'COMMENTS');
                 } else {
                     $result = self::MapFieldValue($fields, $fieldName, false);
                 }
                 break;
             case 'COMPANY_TYPE':
             case 'TYPE':
                 $result = self::MapReferenceValue(self::PrepareCompanyTypes(), $fields, 'COMPANY_TYPE', $isHtml);
                 break;
             case 'INDUSTRY':
                 $result = self::MapReferenceValue(self::PrepareIndustries(), $fields, 'INDUSTRY', $isHtml);
                 break;
             case 'EMPLOYEES':
                 $result = self::MapReferenceValue(self::PrepareEmployees(), $fields, 'EMPLOYEES', $isHtml);
                 break;
             case 'CURRENCY':
                 $result = isset($fields['CURRENCY_ID']) ? CCrmCurrency::GetCurrencyName($fields['CURRENCY_ID']) : '';
                 break;
             case 'REVENUE':
                 $result = isset($fields['REVENUE']) ? $fields['REVENUE'] : 0.0;
                 break;
             case 'REVENUE_FORMATTED':
                 $result = CCrmCurrency::MoneyToString(isset($fields['REVENUE']) ? $fields['REVENUE'] : 0.0, isset($fields['CURRENCY_ID']) ? $fields['CURRENCY_ID'] : '');
                 break;
             case 'ASSIGNED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['ASSIGNED_BY_ID']) ? $fields['ASSIGNED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'CREATED_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['CREATED_BY_ID']) ? $fields['CREATED_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'MODIFY_BY_FULL_NAME':
                 $result = CCrmViewHelper::GetFormattedUserName(isset($fields['MODIFY_BY_ID']) ? $fields['MODIFY_BY_ID'] : 0, '', $isHtml);
                 break;
             case 'DATE_CREATE':
                 $result = isset($fields['DATE_CREATE']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_CREATE'])) : '';
                 break;
             case 'DATE_MODIFY':
                 $result = isset($fields['DATE_MODIFY']) ? FormatDate('SHORT', MakeTimeStamp($fields['DATE_MODIFY'])) : '';
                 break;
         }
     }
     return $result;
 }