TaskAttachmentHandler::getUserField

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskAttachmentHandler
  4. getUserField
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replica/taskattachmenthandler.php
  • Класс: BitrixTasksReplicaTaskAttachmentHandler
  • Вызов: TaskAttachmentHandler::getUserField
static function getUserField($taskId)
{
	$result = array();

	$taskList = CTasks::getList(
		array(),
		array(
			"=ID" => $taskId,
		),
		array("ID", "UF_TASK_WEBDAV_FILES"),
		array('bGetZombie' => true)
	);
	$taskInfo = $taskList->fetch();
	if ($taskInfo && $taskInfo["UF_TASK_WEBDAV_FILES"] && BitrixMainLoader::includeModule('disk'))
	{
		foreach ($taskInfo["UF_TASK_WEBDAV_FILES"] as $attachId)
		{
			$attachedObject = BitrixDiskAttachedObject::getById($attachId, array('OBJECT'));
			if ($attachedObject && $attachedObject->getFile())
			{
				$result[$attachId] = $attachedObject;
			}
		}
	}

	return $result;
}

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