public static function format(array $fields, array $options = null)
 {
     return parent::formatLines(self::prepareLines($fields, $options), $options);
 }
Exemple #2
0
    if (Bitrix\Crm\Integration\Bitrix24Email::allowDisableSignature()) {
        $arResult['FIELDS']['tab_outgoing_email'][] = array('id' => 'ENABLE_B24_EMAIL_SIGNATURE', 'name' => GetMessage('CRM_FIELD_ENABLE_B24_EMAIL_SIGNATURE'), 'type' => 'checkbox', 'value' => Bitrix\Crm\Integration\Bitrix24Email::isSignatureEnabled(), 'required' => false);
    } else {
        $arResult['FIELDS']['tab_outgoing_email'][] = array('id' => 'ENABLE_B24_EMAIL_SIGNATURE', 'name' => GetMessage('CRM_FIELD_ENABLE_B24_EMAIL_SIGNATURE'), 'type' => 'label', 'value' => Bitrix\Crm\Integration\Bitrix24Email::getSignatureExplanation(), 'required' => false);
    }
}
$arResult['FIELDS']['tab_format'][] = array('id' => 'PERSON_NAME_FORMAT_ID', 'name' => GetMessage('CRM_FIELD_PERSON_NAME_FORMAT'), 'type' => 'list', 'items' => \Bitrix\Crm\Format\PersonNameFormatter::getAllDescriptions(), 'value' => \Bitrix\Crm\Format\PersonNameFormatter::getFormatID(), 'required' => false);
$arResult['FIELDS']['tab_format'][] = array('id' => 'CALLTO_FORMAT', 'name' => GetMessage('CRM_FIELD_CALLTO_FORMAT'), 'type' => 'list', 'items' => CCrmCallToUrl::GetAllDescriptions(), 'value' => CCrmCallToUrl::GetFormat(CCrmCallToUrl::Bitrix), 'required' => false);
$calltoSettings = CCrmCallToUrl::GetCustomSettings();
$arResult['FIELDS']['tab_format'][] = array('id' => 'CALLTO_URL_TEMPLATE', 'name' => GetMessage('CRM_FIELD_CALLTO_URL_TEMPLATE'), 'type' => 'text', 'value' => isset($calltoSettings['URL_TEMPLATE']) ? $calltoSettings['URL_TEMPLATE'] : 'callto:[phone]', 'required' => false);
$arResult['FIELDS']['tab_format'][] = array('id' => 'CALLTO_CLICK_HANDLER', 'name' => GetMessage('CRM_FIELD_CALLTO_CLICK_HANDLER'), 'type' => 'textarea', 'value' => isset($calltoSettings['CLICK_HANDLER']) ? $calltoSettings['CLICK_HANDLER'] : '', 'required' => false);
$arResult['FIELDS']['tab_format'][] = array('id' => 'CALLTO_NORMALIZE_NUMBER', 'name' => GetMessage('CRM_FIELD_CALLTO_NORMALIZE_NUMBER'), 'type' => 'checkbox', 'value' => isset($calltoSettings['NORMALIZE_NUMBER']) ? $calltoSettings['NORMALIZE_NUMBER'] === 'Y' : true, 'required' => false);
$arResult['FIELDS']['tab_format'][] = array('id' => 'section_address_format', 'name' => GetMessage('CRM_SECTION_ADDRESS_FORMAT'), 'type' => 'section');
$curAddrFormatID = \Bitrix\Crm\Format\EntityAddressFormatter::getFormatID();
$addrFormatDescrs = \Bitrix\Crm\Format\EntityAddressFormatter::getAllDescriptions();
$arResult['ADDR_FORMAT_INFOS'] = \Bitrix\Crm\Format\EntityAddressFormatter::getAllExamples();
$arResult['ADDR_FORMAT_CONTROL_PREFIX'] = 'addr_format_';
$addrFormatControls = array();
foreach ($addrFormatDescrs as $addrFormatID => $addrFormatDescr) {
    $isChecked = $addrFormatID === $curAddrFormatID;
    $addrFormatControlID = $arResult['ADDR_FORMAT_CONTROL_PREFIX'] . $addrFormatID;
    $addrFormatControls[] = '<input type="radio" class="crm-dup-control-type-radio" id="' . $addrFormatControlID . '" name="ENTITY_ADDRESS_FORMAT_ID" value="' . $addrFormatID . '"' . ($isChecked ? ' checked="checked"' : '') . '/><label class="crm-dup-control-type-label" for="' . $addrFormatControlID . '">' . htmlspecialcharsbx($addrFormatDescr) . '</label>';
}
$arResult['FIELDS']['tab_format'][] = array('id' => 'ENTITY_ADDRESS_FORMAT', 'type' => 'custom', 'value' => '<div class="crm-dup-control-type-radio-title">' . GetMessage('CRM_FIELD_ENTITY_ADDRESS_FORMAT') . ':</div>' . '<div class="crm-dup-control-type-radio-wrap">' . implode('', $addrFormatControls) . '</div>', 'colspan' => true);
$arResult['ADDR_FORMAT_DESCR_ID'] = 'addr_format_descr';
$arResult['FIELDS']['tab_format'][] = array('id' => 'ENTITY_ADDRESS_FORMAT_DESCR', 'type' => 'custom', 'value' => '<div class="crm-dup-control-type-info" id="' . $arResult['ADDR_FORMAT_DESCR_ID'] . '">' . $arResult['ADDR_FORMAT_INFOS'][$curAddrFormatID] . '</div>', 'colspan' => true);
ob_start();
$APPLICATION->IncludeComponent('bitrix:crm.config.invoice.number', '', array(), '');
$sVal = ob_get_contents();
ob_end_clean();
$arResult['FIELDS']['tab_inv_nums'][] = array('id' => 'INVOICE_NUMBERS_FORMAT', 'name' => GetMessage('CRM_INVOICE_NUMBERS_FORMAT'), 'type' => 'custom', 'colspan' => true, 'value' => $sVal, 'required' => false);