2007-10-28 13:55:59 +03:00
|
|
|
<ul>
|
2009-03-21 03:01:48 +03:00
|
|
|
<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
|
|
|
|
|
2008-02-10 16:17:41 +03:00
|
|
|
<% if !@issue.nil? -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
|
|
|
|
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu" onclick="return false;"><%= l(:field_status) %></a>
|
|
|
|
<ul>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% @statuses.each do |s| -%>
|
2008-05-25 19:09:42 +04:00
|
|
|
<li><%= context_menu_link s.name, {:controller => 'issues', :action => 'edit', :id => @issue, :issue => {:status_id => s}, :back_to => @back}, :method => :post,
|
2008-02-10 16:17:41 +03:00
|
|
|
:selected => (s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
|
|
|
|
<% end -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|
|
|
|
</li>
|
2008-08-26 14:34:26 +04:00
|
|
|
<% else %>
|
|
|
|
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id)},
|
|
|
|
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
|
|
|
<% end %>
|
|
|
|
|
2007-10-28 13:55:59 +03:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_priority) %></a>
|
|
|
|
<ul>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% @priorities.each do |p| -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link p.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'priority_id' => p, :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && p == @issue.priority), :disabled => !@can[:edit] %></li>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% end -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|
|
|
|
</li>
|
2009-11-08 16:03:41 +03:00
|
|
|
<% unless @project.nil? || @project.versions.open.empty? -%>
|
2008-06-19 00:15:51 +04:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
|
|
|
|
<ul>
|
2009-11-08 16:03:41 +03:00
|
|
|
<% @project.versions.open.sort.each do |v| -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
|
2008-06-19 00:15:51 +04:00
|
|
|
<% end -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => 'none', :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
|
2008-06-19 00:15:51 +04:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2008-08-26 14:34:26 +04:00
|
|
|
<% unless @assignables.nil? || @assignables.empty? -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
|
|
|
|
<ul>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% @assignables.each do |u| -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => u, :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% end -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => 'none', :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|
|
|
|
</li>
|
2008-08-26 14:34:26 +04:00
|
|
|
<% end %>
|
|
|
|
<% unless @project.nil? || @project.issue_categories.empty? -%>
|
2008-07-28 22:00:30 +04:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_category) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @project.issue_categories.each do |u| -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => u, :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
|
2008-07-28 22:00:30 +04:00
|
|
|
<% end -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => 'none', :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
|
2008-07-28 22:00:30 +04:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end -%>
|
2008-03-21 20:32:15 +03:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
|
|
|
|
<ul>
|
|
|
|
<% (0..10).map{|x|x*10}.each do |p| -%>
|
2008-08-26 14:34:26 +04:00
|
|
|
<li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'done_ratio' => p, :back_to => @back}, :method => :post,
|
|
|
|
:selected => (@issue && p == @issue.done_ratio), :disabled => !@can[:edit] %></li>
|
2008-03-21 20:32:15 +03:00
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2008-08-26 14:34:26 +04:00
|
|
|
|
|
|
|
<% if !@issue.nil? %>
|
|
|
|
<li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
|
|
|
|
:class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
2008-07-16 23:10:29 +04:00
|
|
|
<% if @can[:log_time] -%>
|
|
|
|
<li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue},
|
2009-01-30 20:50:28 +03:00
|
|
|
:class => 'icon-time-add' %></li>
|
2008-07-16 23:10:29 +04:00
|
|
|
<% end %>
|
2009-02-13 01:14:22 +03:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<li><%= watcher_link(@issue, User.current) %></li>
|
|
|
|
<% end %>
|
2008-08-26 14:34:26 +04:00
|
|
|
<% end %>
|
|
|
|
|
2008-02-10 16:17:41 +03:00
|
|
|
<li><%= context_menu_link l(:button_move), {:controller => 'issues', :action => 'move', :ids => @issues.collect(&:id)},
|
|
|
|
:class => 'icon-move', :disabled => !@can[:move] %></li>
|
|
|
|
<li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id)},
|
|
|
|
:method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li>
|
2009-03-21 03:01:48 +03:00
|
|
|
|
|
|
|
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|