Ejemplo n.º 1
0
$arResult['ERRORS'] = array();
$arResult['MESSAGES'] = array();
$entityTypeID = isset($arParams['ENTITY_TYPE_ID']) ? intval($arParams['ENTITY_TYPE_ID']) : CCrmOwnerType::Undefined;
if ($entityTypeID === CCrmOwnerType::Undefined && isset($arParams['ENTITY_TYPE'])) {
    $entityTypeID = CCrmOwnerType::ResolveID($arParams['ENTITY_TYPE']);
}
if ($entityTypeID !== CCrmOwnerType::Contact && $entityTypeID !== CCrmOwnerType::Company && $entityTypeID !== CCrmOwnerType::Lead) {
    ShowError(GetMessage('CRM_DEDUPE_LIST_INVALID_ENTITY_TYPE', array('#TYPE_NAME#' => CCrmOwnerType::ResolveName($entityTypeID))));
    return;
}
$arResult['ENTITY_TYPE_ID'] = $entityTypeID;
$entityTypeName = $arResult['ENTITY_TYPE_NAME'] = \CCrmOwnerType::ResolveName($entityTypeID);
//TYPE INDEX INFO
$typeInfos = array();
$indexedTypes = $arResult['TYPES'] = Integrity\DuplicateIndexBuilder::getExistedTypes($entityTypeID, $userID);
$supportedTypes = $arResult['SUPPORTED_TYPES'] = Integrity\DuplicateIndexType::getSupportedTypes($entityTypeID);
$typeDescriptions = $arResult['TYPE_DESCRIPTIONS'] = Integrity\DuplicateIndexType::getAllDescriptions();
$selectedTypes = array();
$filterTypeID = isset($_GET['typeId']) ? (int) $_GET['typeId'] : Integrity\DuplicateIndexType::UNDEFINED;
$skippedTypeIDs = array();
foreach ($supportedTypes as $typeID) {
    $typeLayoutID = CCrmOwnerType::Undefined;
    if ($typeID === Integrity\DuplicateIndexType::ORGANIZATION) {
        $typeLayoutID = CCrmOwnerType::Company;
    } elseif ($typeID === Integrity\DuplicateIndexType::PERSON) {
        $typeLayoutID = CCrmOwnerType::Contact;
    }
    $groupName = '';
    if ($typeID === Integrity\DuplicateIndexType::PERSON || $typeID === Integrity\DuplicateIndexType::ORGANIZATION) {
        $groupName = 'denomination';
    } elseif ($typeID === Integrity\DuplicateIndexType::COMMUNICATION_PHONE || $typeID === Integrity\DuplicateIndexType::COMMUNICATION_EMAIL) {