• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/util/scheduler.php
  • Класс: BitrixTasksUtilScheduler
  • Вызов: Scheduler::updateRelated
protected function updateRelated($fromTaskId)
{
	if(is_array($this->relations[$fromTaskId]))
	{
		foreach($this->relations[$fromTaskId] as &$relation)
		{
			if($relation['PROCESSED_BY'] == $this->processId) // already been here
			{
				continue;
			}

			$toTaskId = 	$relation['TASK_ID'];
			$toTask = 		$this->taskPool[$toTaskId];

			$endDate = $toTask->getEndDatePlan();
			if(!$endDate) // somehow there are no end date, get out of here asap
			{
				continue;
			}

			$startDate = $this->getMinDate($relation);
			$startDate = clone $startDate;

			$duration = $toTask->calculateDuration();

			$endDate = clone $startDate;
			$endDate->addSecond($duration);

			// set task dates here
			$toTask->setStartDatePlanUserTimeGmt($startDate->toStringGmt());
			$toTask->setEndDatePlanUserTimeGmt($endDate->toStringGmt());

			$this->correctWorkTime($toTaskId, $startDate, $endDate, $duration);

			// update $relation lag
			$this->updateLag($relation);
			$relation['PROCESSED_BY'] = $this->processId;

			$this->updateRelated($toTaskId);
		}
		unset($relation);
	}
}