• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/taskitem.php
  • Класс: CTaskItem
  • Вызов: CTaskItem::addFile
public function addFile(array $fileParameters)
{
	if ( ! $this->checkAccess(ActionDictionary::ACTION_TASK_EDIT) )
	{
		throw new TasksException('Access denied', TasksException::TE_ACTION_NOT_ALLOWED);
	}

	$attachmentId = (int) Attachment::add($this->getId(), $fileParameters, array(
		'USER_ID' => $GLOBALS['USER']->GetId(),
		'ENTITY_ID' => UserField::getTargetEntityId(),
		'FIELD_NAME' => 'UF_TASK_WEBDAV_FILES'
	));

	// drop cache
	$this->markCacheAsDirty();

	return $attachmentId;
}