Files
openproject/modules/backlogs/app/controllers/rb_taskboards_controller.rb
T
Alexander Brandon Coles 44b434e328 [#73798] Remove scrum_projects feature flag
Make Backlogs use the sprint-based behavior unconditionally and
remove the old feature-flagged branches from controllers, routes,
representers, and supporting helpers.

Update the affected Backlogs specs and PDF export expectations to
match the permanent sprint model and keep list reordering stable when
moving work packages between backlog and sprint scopes.

https://community.openproject.org/wp/73798
2026-04-17 09:47:10 +01:00

63 lines
2.1 KiB
Ruby

# frozen_string_literal: true
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++
class RbTaskboardsController < RbApplicationController
menu_item :backlogs
helper :taskboards
def show
if @sprint.is_a?(Agile::Sprint)
@board = @sprint.task_board_for(@project)
return redirect_to(project_work_package_board_path(@project, @board)) if @board
render_404
else
@statuses = Type.find(Task.type).statuses
@story_ids = @sprint.stories(@project).map(&:id)
@last_updated = Task.children_of(@story_ids)
.order(Arel.sql("updated_at DESC"))
.first
end
end
private
def load_sprint_and_project
@project = Project.visible.find(params[:project_id])
return unless (@sprint_id = params.delete(:sprint_id))
@sprint = Agile::Sprint.for_project(@project).visible.find_by(id: @sprint_id) ||
Sprint.visible.apply_to(@project).find(@sprint_id)
end
end