• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/forum/task/topic.php
  • Класс: BitrixTasksIntegrationForumTaskTopic
  • Вызов: Topic::onBeforeAdd
static function onBeforeAdd($entityType, $entityId, $arPost, &$arTopic)
{
	// 'TK' is our entity type
	if ($entityType !== 'TK')
	{
		return;
	}

	if(!(CTaskAssert::isLaxIntegers($entityId) && ((int) $entityId >= 1)))
	{
		CTaskAssert::logError('[0xb6324222] Expected integer $entityId >= 1');
		return;
	}

	$taskId = (int) $entityId;

	$task = Task::getInstance($taskId);
	if($task["TITLE"]) // it means you can read the task
	{
		$arTopic["TITLE"] = $task["TITLE"];
		$arTopic["MESSAGE"] = trim($task["TITLE"]."n".$task["DESCRIPTION"]);
		$arTopic["AUTHOR_ID"] = $task["CREATED_BY"];
	}

	return true;
}