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
This commit is contained in:
Jean-Baptiste Barth 2010-09-03 21:43:07 +00:00
parent c799d03ece
commit a9f5a17c67
2 changed files with 9 additions and 3 deletions

View File

@ -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)),

View File

@ -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},