TaskFieldHandler::prepareDurationPlanFields

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskFieldHandler
  4. prepareDurationPlanFields
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/handler/taskfieldhandler.php
  • Класс: BitrixTasksControlHandlerTaskFieldHandler
  • Вызов: TaskFieldHandler::prepareDurationPlanFields
public function prepareDurationPlanFields(): self
{
	$type = '';
	if (array_key_exists('DURATION_TYPE', $this->fields))
	{
		$type = (string) $this->fields['DURATION_TYPE'];
	}

	if (
		$this->taskId
		&& empty($type)
	)
	{
		$type = $this->taskData['DURATION_TYPE'];
	}

	$durationPlan = false;
	if (isset($this->fields['DURATION_PLAN_SECONDS']))
	{
		$durationPlan = $this->fields['DURATION_PLAN_SECONDS'];
	}
	elseif (isset($this->fields['DURATION_PLAN']))
	{
		$durationPlan = $this->convertDurationToSeconds((int) $this->fields['DURATION_PLAN'], $type);
	}

	if ($durationPlan !== false)
	{
		$this->fields['DURATION_PLAN'] = $durationPlan;
		unset($this->fields['DURATION_PLAN_SECONDS']);
	}

	return $this;
}

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