$arResult['BACK_URL'] = $arParams['PATH_TO_SM_CONFIG']; $arResult['FIELDS'] = array(); $arResult['FIELDS']['tab_deal_config'][] = array('id' => 'DEAL_DEFAULT_LIST_VIEW', 'name' => GetMessage('CRM_FIELD_DEAL_DEFAULT_LIST_VIEW'), 'items' => \Bitrix\Crm\Settings\DealSettings::getViewDescriptions(), 'type' => 'list', 'value' => \Bitrix\Crm\Settings\DealSettings::getDefaultListViewID(), 'required' => false); $arResult['FIELDS']['tab_deal_config'][] = array('id' => 'REFRESH_DEAL_CLOSEDATE', 'name' => GetMessage('CRM_FIELD_REFRESH_DEAL_CLOSEDATE'), 'type' => 'checkbox', 'value' => \Bitrix\Crm\Settings\DealSettings::isCloseDateSyncEnabled(), 'required' => false); $arResult['FIELDS']['tab_activity_config'][] = array('id' => 'CALENDAR_DISPLAY_COMPLETED_CALLS', 'name' => GetMessage('CRM_FIELD_DISPLAY_COMPLETED_CALLS_IN_CALENDAR'), 'type' => 'checkbox', 'value' => CCrmActivityCalendarSettings::GetValue(CCrmActivityCalendarSettings::DisplayCompletedCalls, true), 'required' => false); $arResult['FIELDS']['tab_activity_config'][] = array('id' => 'CALENDAR_DISPLAY_COMPLETED_MEETINGS', 'name' => GetMessage('CRM_FIELD_DISPLAY_COMPLETED_MEETINGS_IN_CALENDAR'), 'type' => 'checkbox', 'value' => CCrmActivityCalendarSettings::GetValue(CCrmActivityCalendarSettings::DisplayCompletedMeetings, true), 'required' => false); $arResult['FIELDS']['tab_activity_config'][] = array('id' => 'RECKON_ACTIVITYLESS_ITEMS_IN_COUNTERS', 'name' => GetMessage('CRM_FIELD_RECKON_ACTIVITYLESS_ITEMS_IN_COUNTERS'), 'type' => 'checkbox', 'value' => CCrmUserCounterSettings::GetValue(CCrmUserCounterSettings::ReckonActivitylessItems, true), 'required' => false); $arResult['FIELDS']['tab_outgoing_email'][] = array('id' => 'SERVICE_CODE_ALLOCATION', 'name' => GetMessage('CRM_FIELD_SERVICE_CODE_ALLOCATION'), 'items' => CCrmEMailCodeAllocation::GetAllDescriptions(), 'type' => 'list', 'value' => CCrmEMailCodeAllocation::GetCurrent(), 'required' => false); if (Bitrix\Crm\Integration\Bitrix24Email::isEnabled()) { 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>';