• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/handler/taskfieldhandler.php
  • Класс: BitrixTasksControlHandlerTaskFieldHandler
  • Вызов: TaskFieldHandler::preparePriority
public function preparePriority(): self
{
	$validValues = array_values(Priority::getAll());

	if (
		$this->taskId
		&& !array_key_exists('PRIORITY', $this->fields)
	)
	{
		return $this;
	}

	if (
		!$this->taskId
		&& !array_key_exists('PRIORITY', $this->fields)
	)
	{
		$this->fields['PRIORITY'] = Priority::AVERAGE;
	}

	$this->fields['PRIORITY'] = (int) $this->fields['PRIORITY'];
	if (!in_array($this->fields['PRIORITY'], $validValues))
	{
		$this->fields['PRIORITY'] = Priority::AVERAGE;
	}

	return $this;
}