diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index cfef2f200..59d05b754 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class ReportsController < ApplicationController - menu_item :issues + menu_item :reports before_action :find_project, :authorize, :find_issue_statuses def issue_report diff --git a/lib/redmine.rb b/lib/redmine.rb index 6e7d10974..fe752c25c 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -278,6 +278,7 @@ Redmine::MenuManager.map :project_menu do |menu| menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, :if => Proc.new { |p| p.shared_versions.any? } menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural + menu.push :reports, { :controller => 'reports', :action => 'issue_report' }, :param => :id, :caption => :label_report_plural, :parent => :issues menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :if => Proc.new { |p| Setting.new_item_menu_tab == '1' && Issue.allowed_target_trackers(p).any? }, diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index dcdd0fa23..8e5f58b2b 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -218,7 +218,8 @@ module Redmine item.url end caption = item.caption(project) - return [caption, url, (current_menu_item == item.name)] + child_item_names = item.children.collect{|c|c.name} + return [caption, url, (current_menu_item == item.name || child_item_names.include?(current_menu_item))] end # See MenuItem#allowed?