• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/controllers/dod.php
  • Класс: BitrixTasksScrumControllersDoD
  • Вызов: DoD::getChecklistAction
public function getChecklistAction(int $typeId): ?Component
{
	$userId = User::getId();

	$typeService = new TypeService();
	$entityService = new EntityService();

	$type = $typeService->getType($typeId);
	if ($type->isEmpty())
	{
		$this->errorCollection->setError(
			new Error(
				Loc::getMessage('TASKS_SDC_ERROR_TYPE_NOT_FOUND'),
				self::ERROR_COULD_NOT_SAVE_SETTINGS
			)
		);

		return null;
	}

	$entity = $entityService->getEntityById($type->getEntityId());
	if (!Group::canReadGroupTasks($userId, $entity->getGroupId()))
	{
		$this->errorCollection->setError(
			new Error(
				Loc::getMessage('TASKS_SDC_ERROR_ACCESS_DENIED'),
				self::ERROR_ACCESS_DENIED
			)
		);

		return null;
	}

	$definitionOfDoneService = new DefinitionOfDoneService($userId);

	$items = $definitionOfDoneService->getTypeItems($typeId);

	return $definitionOfDoneService->getComponent($typeId, 'SCRUM_ENTITY', $items);
}