getEntityUFList(); foreach($userUFList as $FIELD_NAME => $uf) { if( !isset($uf['SHOW_IN_LIST']) || $uf['SHOW_IN_LIST'] !== 'Y' || !isset($uf['EDIT_IN_LIST']) || $uf['EDIT_IN_LIST'] !== 'Y' ) { continue; } $type = $uf['USER_TYPE']['BASE_TYPE']; if (in_array($uf['USER_TYPE']['USER_TYPE_ID'], ['enumeration', 'iblock_section', 'iblock_element'])) { $type = 'list'; } else if ($uf['USER_TYPE']['USER_TYPE_ID'] == 'boolean') { $type = 'list'; //Default value must be placed at first position. $defaultValue = ( isset($uf['SETTINGS']['DEFAULT_VALUE']) ? (int)$uf['SETTINGS']['DEFAULT_VALUE'] : 0 ); } elseif ($uf['USER_TYPE']['BASE_TYPE'] == 'datetime') { $type = 'date'; } elseif ( $uf['USER_TYPE']['USER_TYPE_ID'] == 'crm_status' && Loader::includeModule('crm') ) { $type = 'list'; } elseif(mb_substr($uf['USER_TYPE']['USER_TYPE_ID'], 0, 5) === 'rest_') { // skip REST type fields here continue; } if($type === 'string') { $type = 'text'; } elseif( $type === 'int' || $type === 'double' ) { //HACK: \CMainUIGrid::prepareEditable does not recognize 'number' type $type = 'int'; } $gridHeaders[$FIELD_NAME] = array( 'id' => $FIELD_NAME, 'name' => htmlspecialcharsbx($uf['LIST_COLUMN_LABEL'] <> '' ? $uf['LIST_COLUMN_LABEL'] : $FIELD_NAME), 'sort' => $uf['MULTIPLE'] == 'N' ? $FIELD_NAME : false, 'default' => false, 'editable' => false, 'type' => $type ); if ($import) { $gridHeaders[$FIELD_NAME]['mandatory'] = ( $uf['MANDATORY'] === 'Y' ? 'Y' : 'N' ); } } } }