CCrmActivityRestProxy::getFieldsInfo

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmActivityRestProxy
  4. getFieldsInfo
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmActivityRestProxy
  • Вызов: CCrmActivityRestProxy::getFieldsInfo
protected function getFieldsInfo()
{
	if(!$this->FIELDS_INFO)
	{
		$this->FIELDS_INFO = CCrmActivity::GetFieldsInfo();
		$this->FIELDS_INFO['BINDINGS'] = array(
			'TYPE' => 'crm_activity_binding',
			'ATTRIBUTES' => array(CCrmFieldInfoAttr::Multiple, CCrmFieldInfoAttr::ReadOnly)
		);

		foreach ($this->FIELDS_INFO as $code=>&$field)
		{
			$field['CAPTION'] = \Bitrix\Crm\ActivityTable::getFieldCaption($code);
		}

		$this->FIELDS_INFO['COMMUNICATIONS'] = array(
			'TYPE' => 'crm_activity_communication',
			'ATTRIBUTES' => array(CCrmFieldInfoAttr::Multiple, CCrmFieldInfoAttr::Required),
			'CAPTION' => Loc::getMessage('CRM_REST_ACTIVITY_FIELD_COMMUNICATIONS')
		);

		$storageTypeID =  CCrmActivity::GetDefaultStorageTypeID();
		if($storageTypeID === StorageType::Disk)
		{
			$this->FIELDS_INFO['FILES'] = array(
				'TYPE' => 'diskfile',
				'ALIAS' => 'WEBDAV_ELEMENTS',
				'ATTRIBUTES' => array(CCrmFieldInfoAttr::Multiple),
				'CAPTION' => Loc::getMessage('CRM_REST_ACTIVITY_FIELD_FILES')
			);
			$this->FIELDS_INFO['WEBDAV_ELEMENTS'] = array(
				'TYPE' => 'diskfile',
				'ATTRIBUTES' => array(CCrmFieldInfoAttr::Deprecated, CCrmFieldInfoAttr::Multiple),
				'CAPTION' => Loc::getMessage('CRM_REST_ACTIVITY_FIELD_WEBDAV_ELEMENTS')
			);
		}
		else
		{
			$this->FIELDS_INFO['WEBDAV_ELEMENTS'] = array(
				'TYPE' => 'webdav',
				'ATTRIBUTES' => array(CCrmFieldInfoAttr::Multiple),
				'CAPTION' => Loc::getMessage('CRM_REST_ACTIVITY_FIELD_WEBDAV_ELEMENTS')
			);
		}

		$this->FIELDS_INFO['IS_INCOMING_CHANNEL'] = [
			'TYPE' => 'char',
			'ATTRIBUTES' => [CCrmFieldInfoAttr::ReadOnly]
		];
	}
	return $this->FIELDS_INFO;
}

Добавить комментарий