• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/item/task.php
  • Класс: BitrixTasksItemTask
  • Вызов: Task::processSchedulerBefore
private function processSchedulerBefore()
{
	$shiftResult = null;
	if((string) $this['START_DATE_PLAN'] != '' || (string) $this['END_DATE_PLAN'] != '')
	{
		$scheduler = BitrixTasksProcessorTaskScheduler::getInstance($this->getUserId());
		$shiftResult = $scheduler->processEntity(0, $this->getData('~'), array(
			'MODE' => 'BEFORE_ATTACH',
		));
		if($shiftResult->isSuccess())
		{
			$shiftData = $shiftResult->getImpactById(0);
			if($shiftData)
			{
				// will be saved...
				$this['START_DATE_PLAN'] = $shiftData['START_DATE_PLAN'];
				$this['END_DATE_PLAN'] = $shiftData['END_DATE_PLAN'];
				$this['DURATION_PLAN_SECONDS'] = $shiftData['DURATION_PLAN_SECONDS'];
			}

			$this->getTransitionState()->setValue('PROCESSOR.SCHEDULER.RESULT', $shiftResult);
		}
	}
}