• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/comments/viewed/group.php
  • Класс: BitrixTasksCommentsViewedGroup
  • Вызов: Group::resolveAction
public function resolveAction( ?int $groupId, ?string $role, string $type): string
{
	[$withGroupId, $withRole] = $this->prepare([
		'groupId' => $groupId,
		'roleId' => $role,
	]);

	if ($type === Enum::PROJECT_NAME)
	{
		if ($withGroupId && !$withRole)
		{
			return Group::ACTION_PROJECT_GROUP_ID_ROLE_ALL;
		}
		else if(!$withGroupId && !$withRole)
		{
			return Group::ACTION_PROJECT_GROUP_LIST_ROLE_ALL;
		}
	}
	else if( $type === Enum::SCRUM_NAME)
	{
		if ($withGroupId && !$withRole)
		{
			return Group::ACTION_SCRUM_GROUP_ID_ROLE_ALL;
		}
		else if(!$withGroupId && !$withRole)
		{
			return Group::ACTION_SCRUM_GROUP_LIST_ROLE_ALL;
		}
	}
	else if( $type === Enum::USER_NAME)
	{
		if ($withGroupId && $withRole)
		{
			return Group::ACTION_USER_GROUP_ID_ROLE_ID;
		}
		else if(!$withGroupId && $withRole)
		{
			return Group::ACTION_USER_GROUP_ALL_ROLE_ID;
		}
		else if($withGroupId && !$withRole)
		{
			return Group::ACTION_USER_GROUP_ID_ROLE_ALL;
		}
		else if(!$withGroupId && !$withRole)
		{
			return Group::ACTION_USER_GROUP_ALL_ROLE_ALL;
		}
	}

	return Group::ACTION_UNDEFINED;
}