コード例 #1
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
        }
    }
}
global $USER_FIELD_MANAGER;
$CCrmFieldMulti = new CCrmFieldMulti();
$CCrmUserType = new CCrmUserType($USER_FIELD_MANAGER, CCrmLead::$sUFEntityID);
$addressLabels = EntityAddress::getShortLabels();
$arResult['HEADERS'] = array(array('id' => 'ID', 'name' => 'ID'), array('id' => 'TITLE', 'name' => GetMessage('CRM_COLUMN_TITLE')), array('id' => 'NAME', 'name' => GetMessage('CRM_COLUMN_NAME')), array('id' => 'LAST_NAME', 'name' => GetMessage('CRM_COLUMN_LAST_NAME')), array('id' => 'SECOND_NAME', 'name' => GetMessage('CRM_COLUMN_SECOND_NAME')), array('id' => 'FULL_NAME', 'name' => GetMessage('CRM_COLUMN_FULL_NAME')), array('id' => 'BIRTHDATE', 'name' => GetMessage('CRM_COLUMN_BIRTHDATE')), array('id' => 'FULL_ADDRESS', 'name' => EntityAddress::getFullAddressLabel()), array('id' => 'ADDRESS', 'name' => $addressLabels['ADDRESS']), array('id' => 'ADDRESS_2', 'name' => $addressLabels['ADDRESS_2']), array('id' => 'ADDRESS_CITY', 'name' => $addressLabels['CITY']), array('id' => 'ADDRESS_REGION', 'name' => $addressLabels['REGION']), array('id' => 'ADDRESS_PROVINCE', 'name' => $addressLabels['PROVINCE']), array('id' => 'ADDRESS_POSTAL_CODE', 'name' => $addressLabels['POSTAL_CODE']), array('id' => 'ADDRESS_COUNTRY', 'name' => $addressLabels['COUNTRY']));
$CCrmFieldMulti->ListAddHeaders($arResult['HEADERS']);
$arResult['HEADERS'] = array_merge($arResult['HEADERS'], array(array('id' => 'COMPANY_TITLE', 'name' => GetMessage('CRM_COLUMN_COMPANY_TITLE')), array('id' => 'POST', 'name' => GetMessage('CRM_COLUMN_POST')), array('id' => 'COMMENTS', 'name' => GetMessage('CRM_COLUMN_COMMENTS')), array('id' => 'STATUS_ID', 'name' => GetMessage('CRM_COLUMN_STATUS')), array('id' => 'STATUS_DESCRIPTION', 'name' => GetMessage('CRM_COLUMN_STATUS_DESCRIPTION')), array('id' => 'PRODUCT_ID', 'name' => GetMessage('CRM_COLUMN_PRODUCT_ID')), array('id' => 'PRODUCT_PRICE', 'name' => GetMessage('CRM_COLUMN_PRODUCT_PRICE')), array('id' => 'PRODUCT_QUANTITY', 'name' => GetMessage('CRM_COLUMN_PRODUCT_QUANTITY')), array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_COLUMN_OPPORTUNITY')), array('id' => 'CURRENCY_ID', 'name' => GetMessage('CRM_COLUMN_CURRENCY_ID')), array('id' => 'SOURCE_ID', 'name' => GetMessage('CRM_COLUMN_SOURCE')), array('id' => 'SOURCE_DESCRIPTION', 'name' => GetMessage('CRM_COLUMN_SOURCE_DESCRIPTION')), array('id' => 'OPENED', 'name' => GetMessage('CRM_COLUMN_OPENED')), array('id' => 'ASSIGNED_BY_ID', 'name' => GetMessage('CRM_COLUMN_ASSIGNED_BY_ID'))));
$CCrmUserType->ListAddHeaders($arResult['HEADERS'], true);
$arRequireFields = array();
$arRequireFields['TITLE'] = GetMessage('CRM_COLUMN_TITLE');
$arParams['PATH_TO_LEAD_LIST'] = CrmCheckPath('PATH_TO_LEAD_LIST', $arParams['PATH_TO_LEAD_LIST'], $APPLICATION->GetCurPage());
$arParams['PATH_TO_LEAD_IMPORT'] = CrmCheckPath('PATH_TO_LEAD_IMPORT', $arParams['PATH_TO_LEAD_IMPORT'], $APPLICATION->GetCurPage() . '?import');
$userNameFormats = \Bitrix\Crm\Format\PersonNameFormatter::getAllDescriptions();
//Download sample
$filename = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/components/bitrix/crm.lead.import/sample.csv';
if (isset($_REQUEST['getSample']) && $_REQUEST['getSample'] == 'csv') {
    $APPLICATION->RestartBuffer();
    Header("Content-Type: application/force-download");
    Header("Content-Type: application/octet-stream");
    Header("Content-Type: application/download");
    Header("Content-Disposition: attachment;filename=lead.csv");
    Header("Content-Transfer-Encoding: binary");
    // add UTF-8 BOM marker
    if (defined('BX_UTF') && BX_UTF) {
        echo chr(239) . chr(187) . chr(191);
    }
    $statusList = CCrmStatus::GetStatusListEx('STATUS');
    $sourceList = CCrmStatus::GetStatusListEx('SOURCE');
コード例 #2
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
$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>';