From 23a1ef543fcf40af6b48a5cf1f164d8e82e3d419 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 8 Jul 2012 13:19:46 +0000 Subject: [PATCH] Show shared versions when editing issues from different projects with the context menu (#11345). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9961 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/context_menus_controller.rb | 1 + app/views/context_menus/issues.html.erb | 5 ++--- test/functional/context_menus_controller_test.rb | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb index f371b2e04..329c0d0c1 100644 --- a/app/controllers/context_menus_controller.rb +++ b/app/controllers/context_menus_controller.rb @@ -48,6 +48,7 @@ class ContextMenusController < ApplicationController @assignables = @projects.map(&:assignable_users).reduce(:&) @trackers = @projects.map(&:trackers).reduce(:&) end + @versions = @projects.map {|p| p.shared_versions.open}.reduce(:&) @priorities = IssuePriority.active.reverse @back = back_url diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index f90cbf0e5..f029ca408 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -45,12 +45,11 @@ <% end %> - <% #TODO: allow editing versions when multiple projects %> - <% if @safe_attributes.include?('fixed_version_id') && @project && @project.shared_versions.open.any? -%> + <% if @safe_attributes.include?('fixed_version_id') && @versions.any? -%>
  • <%= l(:field_fixed_version) %>