CBP::makeRestActivityDescription

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBP
  4. makeRestActivityDescription
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/runtime.php
  • Класс: CBP
  • Вызов: CBP::makeRestActivityDescription
private function makeRestActivityDescription($activity, $lang = false, $documentType = null)
{
	if ($lang === false)
		$lang = LANGUAGE_ID;

	$code = static::REST_ACTIVITY_PREFIX.$activity['INTERNAL_CODE'];
	$result = array(
		'NAME' => '['.RestActivityTable::getLocalization($activity['APP_NAME'], $lang).'] '
			.RestActivityTable::getLocalization($activity['NAME'], $lang),
		'DESCRIPTION' => RestActivityTable::getLocalization($activity['DESCRIPTION'], $lang),
		'TYPE' => 'activity',
		'CLASS' => $code,
		'JSCLASS' => 'BizProcActivity',
		'CATEGORY' => array(
			'ID' => 'rest',
		),
		'RETURN' => array(),
		//compatibility
		'PATH_TO_ACTIVITY' => ''
	);

	if (
		isset($activity['FILTER']) && is_array($activity['FILTER'])
		&& !$this->checkActivityFilter($activity['FILTER'], $documentType)
	)
		$result['EXCLUDED'] = true;

	if (!empty($activity['RETURN_PROPERTIES']))
	{
		foreach ($activity['RETURN_PROPERTIES'] as $name => $property)
		{
			$result['RETURN'][$name] = array(
				'NAME' => RestActivityTable::getLocalization($property['NAME'], $lang),
				'TYPE' => isset($property['TYPE']) ? $property['TYPE'] : BitrixBizprocFieldType::STRING
			);
		}
	}
	if ($activity['USE_SUBSCRIPTION'] != 'N')
		$result['RETURN']['IsTimeout'] = array(
			'NAME' => GetMessage('BPRA_IS_TIMEOUT'),
			'TYPE' => BitrixBizprocFieldType::INT
		);

	return $result;
}

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