Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove some unsused code.

Pavel Balashovbf34f20d4a98
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d211dd2bbe3..51466ac18b6 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -105,12 +105,6 @@ class ProjectsController < ApplicationController
render_404
end
- def redirect_work_packages_or_overview
- return if redirect_to_project_menu_item(@project, :work_packages)
-
- redirect_to project_overview_path(@project)
- end
-
def hide_project_in_layout
@project = nil
end
diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb
index 4f3d378ecf7..0ebae08d86e 100644
--- a/lib/redmine/menu_manager.rb
+++ b/lib/redmine/menu_manager.rb
@@ -30,23 +30,13 @@ module Redmine::MenuManager
def self.map(menu_name, &menu_builder)
@menu_builder_queues ||= {}
current_queue = @menu_builder_queues[menu_name.to_sym] ||= []
-
- if menu_builder
- current_queue.push menu_builder
- else
- MapDeferrer.new current_queue
- end
+ current_queue.push menu_builder
end
def self.loose(menu_name, &menu_builder)
@temp_menu_builder_queues ||= {}
current_queue = @temp_menu_builder_queues[menu_name.to_sym] ||= []
-
- if menu_builder
- current_queue.push menu_builder
- else
- MapDeferrer.new current_queue
- end
+ current_queue.push menu_builder
end
def self.items(menu_name)
diff --git a/lib/redmine/menu_manager/mapper.rb b/lib/redmine/menu_manager/mapper.rb
index 2fd710d8c54..195e09b67e1 100644
--- a/lib/redmine/menu_manager/mapper.rb
+++ b/lib/redmine/menu_manager/mapper.rb
@@ -33,8 +33,6 @@ class Redmine::MenuManager::Mapper
@menu_items = items[menu]
end
- @@last_items_count = Hash.new { |h, k| h[k] = 0 }
-
# Adds an item at the end of the menu. Available options:
# * param: the parameter name that is used for the project id (default is :project_id)
# * if: a Proc that is called before rendering the item, the item is displayed only if it returns true
@@ -117,15 +115,3 @@ class Redmine::MenuManager::Mapper
end
end
end
-
-class Redmine::MenuManager::MapDeferrer
- def initialize(menu_builder_queue)
- @menu_builder_queue = menu_builder_queue
- end
-
- %i[push delete exists? find position_of].each do |method|
- define_method method do |*args|
- defer(method, *args)
- end
- end
-end