]> source.dussan.org Git - redmine.git/commitdiff
Do not display items without valid selection in context menu when on different projec...
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 3 Sep 2010 21:43:07 +0000 (21:43 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 3 Sep 2010 21:43:07 +0000 (21:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4059 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/context_menus_controller.rb
app/views/context_menus/issues.html.erb

index e437a18dc25921484081458a0a00c895a213a9d3..5f4b02ca26761367f29dd638bee99f53e0771f5c 100644 (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)),
index efd8cde0ee49dff6c7007d024a9cdb71dd240660..94d4e802f3fcc59f956edc47cda2090b5bcee297 100644 (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},