- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/controllers/dod.php
- Класс: BitrixTasksScrumControllersDoD
- Вызов: DoD::isNecessaryAction
public function isNecessaryAction(int $groupId, int $taskId): bool
{
$userId = User::getId();
if (!Group::canReadGroupTasks($userId, $groupId))
{
return false;
}
$taskService = new TaskService($userId);
$task = current($taskService->getTasksInfo([$taskId]));
if (!$task)
{
return false;
}
$parentId = (int) $task['PARENT_ID'];
return $this->isTmpNecessary($groupId, $parentId);
if ($parentId)
{
$queryObject = TaskTable::getList([
'filter' => [
'ID' => $parentId,
'GROUP_ID' => $groupId,
],
'select' => ['ID'],
]);
if ($queryObject->fetch())
{
return false;
}
}
$type = $this->getItemType($taskId);
if (!$type->isEmpty())
{
if ($this->isNecessaryForTask($groupId, $userId, $type))
{
return true;
}
else
{
return false;
}
}
if ($this->isNecessaryForScrum($groupId, $userId))
{
return true;
}
return false;
}