• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/taskitem.php
  • Класс: CTaskItem
  • Вызов: CTaskItem::updateProjectDependence
public function updateProjectDependence($parentId, $linkType = DependenceTable::LINK_TYPE_FINISH_START)
{
	$exceptionInfo = array(
		'AUX' => array(
			'MESSAGE' => array(
				'FROM_TASK_ID' => $parentId,
				'TASK_ID' => $this->getId(),
				'LINK_TYPE' => $linkType
			)
		)
	);

	if($this->checkAccess(ActionDictionary::ACTION_TASK_DEADLINE))
	{
		$parentTask = CTaskItem::getInstanceFromPool($parentId, $this->executiveUserId);
		if($parentTask->checkAccess(ActionDictionary::ACTION_TASK_DEADLINE))
		{
			$result = DependenceTable::update(array(
				'TASK_ID' => $this->getId(),
				'DEPENDS_ON_ID' => $parentId,
			), array(
				'TYPE' => $linkType
			));
			if(!$result->isSuccess())
			{
				$exceptionInfo['ERROR'] = $result->getErrorMessages();
				throw new ActionFailedException(Loc::getMessage('TASK_CANT_UPDATE_LINK'), $exceptionInfo);
			}
			return;
		}
	}

	throw new ActionNotAllowedException(Loc::getMessage('TASK_CANT_UPDATE_LINK'), $exceptionInfo);
}