Example #1
0
            $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' => ContactAddressFormatter::prepareLines($entityFields, array('NL2BR' => true))));
        } elseif ($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 = CCrmContact::GetFieldCaption($k);
        }
        $entityData[$k]['caption'] = $caption;
    }
    if (isset($entityFields['~PHOTO'])) {
        $fileInfo = $file->ResizeImageGet($entityFields['~PHOTO'], array('width' => 34, 'height' => 34), BX_RESIZE_IMAGE_EXACT);
        $arResult['HEAD_IMAGE_URL'] = isset($fileInfo['src']) ? $fileInfo['src'] : '';
    } else {
        $arResult['HEAD_IMAGE_URL'] = '';
    }
} elseif ($entityTypeID === CCrmOwnerType::Company) {
    $entityContext['SIP_MANAGER_CONFIG'][CCrmOwnerType::CompanyName] = array('ENTITY_TYPE' => CCrmOwnerType::CompanyName, 'SERVICE_URL' => '/bitrix/components/bitrix/crm.company.show/ajax.php?' . bitrix_sessid_get());
    if ($enableDefaultConfig) {
        $config['left'] = 'COMPANY_TYPE,INDUSTRY';
        $config['center'] = 'PHONE,EMAIL,WEB';
        $config['right'] = 'ASSIGNED_BY_ID';