• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/config.php
  • Класс: BitrixVoximplantConfigTable
  • Вызов: ConfigTable::getMap
static function getMap()
{
	return array(
		'ID' => new EntityIntegerField('ID', array(
			'primary' => true,
			'autocomplete' => true,
		)),
		'PORTAL_MODE' => new EntityStringField('PORTAL_MODE', array(
			'size' => 50,
			'default_value' => 'RENT',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'SEARCH_ID' => new EntityStringField('SEARCH_ID', array(
			'size' => 255,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_SEARCH_ID_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 255));},
		)),
		'PHONE_NAME' => new EntityStringField('PHONE_NAME', array(
			'size' => static::MAX_LENGTH_NAME,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_PHONE_NAME_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, static::MAX_LENGTH_NAME));},
		)),
		'PHONE_COUNTRY_CODE' => new EntityStringField('PHONE_COUNTRY_CODE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_PHONE_COUNTRY_CODE_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'PHONE_VERIFIED' => new EntityBooleanField('PHONE_VERIFIED', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_PHONE_VERIFIED_FIELD'),
			'default_value' => 'Y',
		)),
		'CRM' => new EntityBooleanField('CRM', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_FIELD'),
			'default_value' => 'Y',
		)),
		'CRM_RULE' => new EntityStringField('CRM_RULE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_RULE_FIELD'),
			'default_value' => 'queue',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'CRM_CREATE' => new EntityStringField('CRM_CREATE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_CREATE_FIELD'),
			'default_value' => 'lead',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'CRM_CREATE_CALL_TYPE' => new EntityStringField('CRM_CREATE_CALL_TYPE', array(
			'size' => 30,
			'default_value' => 'all',
			'validation' => function (){ return array(new EntityValidatorLength(null, 30));},
		)),
		'CRM_SOURCE' => new EntityStringField('CRM_SOURCE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_SOURCE_FIELD'),
			'default_value' => 'CALL',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'CRM_FORWARD' => new EntityBooleanField('CRM_FORWARD', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_FORWARD_FIELD'),
			'default_value' => 'Y',
		)),
		'CRM_TRANSFER_CHANGE' => new EntityBooleanField('CRM_TRANSFER_CHANGE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_CRM_TRANSFER_CHANGE_FIELD'),
			'default_value' => 'Y',
		)),
		'IVR' => new EntityBooleanField('IVR', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_DIRECT_CODE_FIELD'),
			'default_value' => 'Y',
		)),
		'QUEUE_ID' => new EntityIntegerField('QUEUE_ID'),
		'IVR_ID' => new EntityIntegerField('IVR_ID'),
		'DIRECT_CODE' => new EntityBooleanField('DIRECT_CODE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_DIRECT_CODE_FIELD'),
			'default_value' => 'Y',
		)),
		'DIRECT_CODE_RULE' => new EntityStringField('DIRECT_CODE_RULE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_DIRECT_CODE_RULE_FIELD'),
			'default_value' => 'voicemail',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'RECORDING' => new EntityBooleanField('RECORDING', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_RECORDING_FIELD'),
			'default_value' => 'N',
		)),
		'RECORDING_TIME' => new EntityIntegerField('RECORDING_TIME', array(
			'data_type' => 'integer',
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_RECORDING_TIME_FIELD'),
		)),
		'RECORDING_NOTICE' => new EntityBooleanField('RECORDING_NOTICE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_RECORDING_NOTICE_FIELD'),
			'default_value' => 'N',
		)),
		'RECORDING_STEREO' => new EntityBooleanField('RECORDING_STEREO', [
			'values' => ['N', 'Y'],
			'default_value' => 'N',
		]),
		'FORWARD_LINE' => new EntityStringField('FORWARD_LINE', array(
			'default_value' => 'default',
			'size' => 255,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_FORWARD_LINE_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 255));},
		)),
		'VOICEMAIL' => new EntityBooleanField('VOICEMAIL', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_VOICEMAIL_FIELD'),
			'default_value' => 'Y',
		)),
		'VOTE' => new EntityBooleanField('VOTE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_VOTE_FIELD'),
			'default_value' => 'N',
		)),
		'MELODY_LANG' => new EntityStringField('MELODY_LANG', array(
			'size' => 2,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_LANG_FIELD'),
			'default_value' => 'EN',
			'validation' => function (){ return array(new EntityValidatorLength(null, 2));},
		)),
		'MELODY_WELCOME' => new EntityIntegerField('MELODY_WELCOME', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_WELCOME_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_WELCOME_ENABLE' => new EntityBooleanField('MELODY_WELCOME_ENABLE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_WELCOME_ENABLE_FIELD'),
			'default_value' => 'Y',
		)),
		'MELODY_WAIT' => new EntityIntegerField('MELODY_WAIT', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_WAIT_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_ENQUEUE' => new EntityIntegerField('MELODY_ENQUEUE', array(
			'default_value' => '0',
		)),
		'MELODY_HOLD' => new EntityIntegerField('MELODY_HOLD', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_HOLD_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_RECORDING' => new EntityIntegerField('MELODY_RECORDING', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_RECORDING_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_VOTE' => new EntityIntegerField('MELODY_VOTE', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_VOTE_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_VOTE_END' => new EntityIntegerField('MELODY_VOTE_END', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_VOTE_END_FIELD'),
			'default_value' => '0',
		)),
		'MELODY_VOICEMAIL' => new EntityIntegerField('MELODY_VOICEMAIL', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_MELODY_VOICEMAIL_FIELD'),
			'default_value' => '0',
		)),
		'TIMEMAN' => new EntityBooleanField('TIMEMAN', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_TIMEMAN_FIELD'),
			'default_value' => 'N',
		)),
		'WORKTIME_ENABLE' => new EntityBooleanField('WORKTIME_ENABLE', array(
			'values' => array('N', 'Y'),
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_ENABLE_FIELD'),
			'default_value' => 'N',
		)),
		'WORKTIME_FROM' => new EntityStringField('WORKTIME_FROM', array(
			'size' => 5,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_FROM_FIELD'),
			'default_value' => '9',
			'validation' => function (){ return array(new EntityValidatorLength(null, 5));},
		)),
		'WORKTIME_TO' => new EntityStringField('WORKTIME_TO', array(
			'size' => 5,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_TO_FIELD'),
			'default_value' => '18.30',
			'validation' => function (){ return array(new EntityValidatorLength(null, 5));},
		)),
		'WORKTIME_TIMEZONE' => new EntityStringField('WORKTIME_TIMEZONE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_TIMEZONE_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'WORKTIME_HOLIDAYS' => new EntityStringField('WORKTIME_HOLIDAYS', array(
			'size' => 2000,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_HOLIDAYS_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 2000));},
		)),
		'WORKTIME_DAYOFF' => new EntityStringField('WORKTIME_DAYOFF', array(
			'size' => 20,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_DAYOFF_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 20));},
		)),
		'WORKTIME_DAYOFF_RULE' => new EntityStringField('WORKTIME_DAYOFF_RULE', array(
			'size' => 50,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_DAYOFF_RULE_FIELD'),
			'default_value' => 'voicemail',
			'validation' => function (){ return array(new EntityValidatorLength(null, 50));},
		)),
		'WORKTIME_DAYOFF_NUMBER' => new EntityStringField('WORKTIME_DAYOFF_NUMBER', array(
			'size' => 20,
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_DAYOFF_NUMBER_FIELD'),
			'validation' => function (){ return array(new EntityValidatorLength(null, 20));},
		)),
		'WORKTIME_DAYOFF_MELODY' => new EntityIntegerField('WORKTIME_DAYOFF_MELODY', array(
			'title' => Loc::getMessage('INCOMING_CONFIG_ENTITY_WORKTIME_DAYOFF_MELODY_FIELD'),
			'default_value' => '0',
		)),
		'USE_SIP_TO' => new EntityBooleanField('USE_SIP_TO', array(
			'values' => array('N', 'Y'),
			'default_value' => 'N'
		)),
		'WAIT_CRM' => new EntityIntegerField('WAIT_CRM'),
		'WAIT_DIRECT' => new EntityIntegerField('WAIT_DIRECT'),
		'TRANSCRIBE' => new EntityBooleanField('TRANSCRIBE', array(
			'values' => array('N', 'Y'),
			'default_value' => 'N'
		)),
		'TRANSCRIBE_LANG' => new EntityStringField('TRANSCRIBE_LANG'),
		'TRANSCRIBE_PROVIDER' => new EntityStringField('TRANSCRIBE_PROVIDER'),
		'CALLBACK_REDIAL' => new EntityStringField('CALLBACK_REDIAL'),
		'CALLBACK_REDIAL_ATTEMPTS' => new EntityIntegerField('CALLBACK_REDIAL_ATTEMPTS'),
		'CALLBACK_REDIAL_PERIOD' => new EntityIntegerField('CALLBACK_REDIAL_PERIOD'),
		'LINE_PREFIX' => new EntityStringField('LINE_PREFIX'),
		'CAN_BE_SELECTED' => new EntityBooleanField('CAN_BE_SELECTED', array(
			'values' => array('N', 'Y'),
			'default_value' => 'N'
		)),
		'BACKUP_NUMBER' => new EntityStringField('BACKUP_NUMBER'),
		'BACKUP_LINE' => new EntityStringField('BACKUP_LINE'),
		'REDIRECT_WITH_CLIENT_NUMBER' => new EntityBooleanField('REDIRECT_WITH_CLIENT_NUMBER', array(
			'values' => ['N', 'Y']
		)),
		'QUEUE' => new EntityReferenceField(
			'QUEUE',
			'BitrixVoximplantModelQueue',
			array('=this.QUEUE_ID' => 'ref.ID'),
			array('join_type' => 'LEFT')
		),
		'SIP_CONFIG' => new EntityReferenceField(
			'SIP_CONFIG',
			'BitrixVoximplantSip',
			array('=this.ID' => 'ref.CONFIG_ID'),
			array('join_type' => 'LEFT')
		),
		'NUMBER' => new EntityReferenceField(
			'NUMBER',
			'BitrixVoximplantModelNumber',
			array('=this.ID' => 'ref.CONFIG_ID', '=this.PORTAL_MODE' => new BitrixMainDBSqlExpression('?', CVoxImplantConfig::MODE_RENT)),
			array('join_type' => 'LEFT')
		),
		'GROUP_NUMBER' => new EntityReferenceField(
			'NUMBER',
			'BitrixVoximplantModelNumber',
			array('=this.ID' => 'ref.CONFIG_ID', '=this.PORTAL_MODE' => new BitrixMainDBSqlExpression('?', CVoxImplantConfig::MODE_GROUP)),
			array('join_type' => 'LEFT')
		),
		'CALLER_ID' => new EntityReferenceField(
			'CALLER_ID',
			'BitrixVoximplantModelCallerId',
			array('=this.ID' => 'ref.CONFIG_ID'),
			array('join_type' => 'LEFT')
		),
		'CNT' => new EntityExpressionField('CNT', 'COUNT(*)'),
		'HAS_NUMBER' => new EntityExpressionField(
			'HAS_NUMBER',
			'CASE WHEN EXISTS (SELECT ID from b_voximplant_number WHERE CONFIG_ID = %s) THEN "Y" ELSE "N" END', ['ID']
		),
		'HAS_SIP_CONNECTION' => new EntityExpressionField(
			'HAS_SIP_CONNECTION',
			'CASE WHEN EXISTS (SELECT ID from b_voximplant_sip WHERE CONFIG_ID = %s) THEN "Y" ELSE "N" END', ['ID']
		),
		'HAS_CALLER_ID' => new EntityExpressionField(
			'HAS_CALLER_ID',
			'CASE WHEN EXISTS (SELECT ID from b_voximplant_caller_id WHERE CONFIG_ID = %s) THEN "Y" ELSE "N" END', ['ID']
		),
	);
}