Commit a9f5a17c authored by Jean-Baptiste Barth's avatar Jean-Baptiste Barth

Do not display items without valid selection in context menu when on different projects. #4998

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4059 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c799d03e
......@@ -13,8 +13,8 @@ class ContextMenusController < ApplicationController
memo & s
end
end
projects = @issues.collect(&:project).compact.uniq
@project = projects.first if projects.size == 1
@projects = @issues.collect(&:project).compact.uniq
@project = @projects.first if @projects.size == 1
@can = {:edit => (@project && User.current.allowed_to?(:edit_issues, @project)),
:log_time => (@project && User.current.allowed_to?(:log_time, @project)),
......
......@@ -32,6 +32,8 @@
</ul>
</li>
<% end %>
<% if @projects.size == 1 %>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_priority) %></a>
<ul>
......@@ -41,6 +43,8 @@
<% end -%>
</ul>
</li>
<% end %>
<% unless @project.nil? || @project.shared_versions.open.empty? -%>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
......@@ -80,7 +84,8 @@
</ul>
</li>
<% end -%>
<% if Issue.use_field_for_done_ratio? %>
<% if Issue.use_field_for_done_ratio? && @projects.size == 1 %>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
<ul>
......@@ -91,6 +96,7 @@
</ul>
</li>
<% end %>
<% if !@issue.nil? %>
<% if @can[:log_time] -%>
<li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment