Custom::postForm

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Custom
  4. postForm
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/provider/custom.php
  • Класс: Bitrix\Crm\Activity\Provider\Custom
  • Вызов: Custom::postForm
static function postForm(array &$activity, array $formData)
{
	/** @var \CMain $APPLICATION */
	/** @var \CUserTypeManager $USER_FIELD_MANAGER */
	global $APPLICATION, $USER_FIELD_MANAGER;

	$entityID = CustomType::prepareUserFieldEntityID(
		isset($activity['PROVIDER_TYPE_ID']) ? $activity['PROVIDER_TYPE_ID'] : 0
	);

	if($entityID === '')
	{
		return new Main\Result();
	}

	$result = new Main\Result();
	$fields = array();
	$USER_FIELD_MANAGER->editFormAddFields($entityID, $fields, array('FORM' => $formData));
	if(!$USER_FIELD_MANAGER->checkFields($entityID, $activity['ID'], $fields))
	{
		$e = $APPLICATION->getException();
		if($e instanceof \CAdminException)
		{
			/** @var \CAdminException $e */
			foreach($e->GetMessages() as $msg)
			{
				if(isset($msg['text']))
				{
					$result->addError(new Main\Error($msg['text']));
				}
			}
		}
		else
		{
			/** @var \CApplicationException $e */
			$result->addError(new Main\Error($e->GetString()));
		}
	}

	$activity['FM'] = $fields;
	return $result;
}

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