...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/attribute/fieldattributemanager.php
- Класс: Bitrix\Crm\Attribute\FieldAttributeManager
- Вызов: FieldAttributeManager::saveEntityConfiguration
static function saveEntityConfiguration(array $config, $fieldName, $entityTypeID, $entityScope) { if($fieldName === '') { return; } $typeID = isset($config['typeId']) ? (int)$config['typeId'] : FieldAttributeType::REQUIRED; self::removeEntityConfiguration($typeID, $fieldName, $entityTypeID, $entityScope); $groups = isset($config['groups']) && is_array($config['groups']) ? $config['groups'] : array(); if(empty($groups)) { return; } foreach($groups as $group) { $phaseGroupTypeID = isset($group['phaseGroupTypeId']) ? (int)$group['phaseGroupTypeId'] : FieldAttributePhaseGroupType::UNDEFINED; if(!FieldAttributePhaseGroupType::isDefined($phaseGroupTypeID)) { continue; } if($phaseGroupTypeID === FieldAttributePhaseGroupType::ALL) { Entity\FieldAttributeTable::add( array( 'ENTITY_TYPE_ID' => $entityTypeID, 'ENTITY_SCOPE' => $entityScope, 'TYPE_ID' => $typeID, 'FIELD_NAME' => $fieldName, 'CREATED_TIME' => new Main\Type\DateTime(), 'START_PHASE' => '', 'FINISH_PHASE' => '', 'PHASE_GROUP_TYPE_ID' => FieldAttributePhaseGroupType::ALL, 'IS_CUSTOM_FIELD' => (mb_strpos($fieldName, 'UF_') === 0) ? 'Y' : 'N' ) ); break; } $items = isset($group['items']) && is_array($group['items']) ? $group['items'] : array(); foreach($items as $item) { $startPhaseID = isset($item['startPhaseId']) ? $item['startPhaseId'] : ''; $finishPhaseID = isset($item['finishPhaseId']) ? $item['finishPhaseId'] : ''; if($startPhaseID === '' || $finishPhaseID === '') { continue; } Entity\FieldAttributeTable::add( array( 'ENTITY_TYPE_ID' => $entityTypeID, 'ENTITY_SCOPE' => $entityScope, 'TYPE_ID' => $typeID, 'FIELD_NAME' => $fieldName, 'CREATED_TIME' => new Main\Type\DateTime(), 'START_PHASE' => $startPhaseID, 'FINISH_PHASE' => $finishPhaseID, 'PHASE_GROUP_TYPE_ID' => $phaseGroupTypeID, 'IS_CUSTOM_FIELD' => (mb_strpos($fieldName, 'UF_') === 0) ? 'Y' : 'N' ) ); } } }