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>
|
2010-09-03 23:54:24 +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 %>
|
|
|
|
|
2010-10-28 01:01:26 +04:00
|
|
|
<% if @allowed_statuses.present? %>
|
2007-10-28 13:55:59 +03:00
|
|
|
<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| -%>
|
2010-09-03 23:54:24 +04:00
|
|
|
<li><%= context_menu_link s.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {:status_id => s}, :back_url => @back}, :method => :post,
|
|
|
|
:selected => (@issue && s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% end -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|
|
|
|
</li>
|
2010-09-03 23:54:24 +04:00
|
|
|
<% end %>
|
2008-08-26 14:34:26 +04:00
|
|
|
|
2009-12-02 22:07:27 +03:00
|
|
|
<% unless @trackers.nil? %>
|
2009-11-29 23:00:21 +03:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_tracker) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @trackers.each do |t| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link t.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'tracker_id' => t}, :back_url => @back}, :method => :post,
|
2009-11-29 23:00:21 +03:00
|
|
|
:selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2009-11-30 22:18:09 +03:00
|
|
|
<% end %>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
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| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link p.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'priority_id' => p}, :back_url => @back}, :method => :post,
|
2010-07-25 15:55:57 +04:00
|
|
|
:selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% end -%>
|
2007-10-28 13:55:59 +03:00
|
|
|
</ul>
|
|
|
|
</li>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
2010-10-08 07:09:51 +04:00
|
|
|
<% #TODO: allow editing versions when multiple projects %>
|
2009-12-06 13:28:20 +03:00
|
|
|
<% unless @project.nil? || @project.shared_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-12-06 13:28:20 +03:00
|
|
|
<% @project.shared_versions.open.sort.each do |v| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'fixed_version_id' => v}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
|
2008-06-19 00:15:51 +04:00
|
|
|
<% end -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'fixed_version_id' => 'none'}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
|
2008-06-19 00:15:51 +04:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2010-10-28 01:01:26 +04:00
|
|
|
<% if @assignables.present? -%>
|
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| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => u}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
|
2008-02-10 16:17:41 +03:00
|
|
|
<% end -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => 'none'}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
: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| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'category_id' => u}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
:selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
|
2008-07-28 22:00:30 +04:00
|
|
|
<% end -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'category_id' => 'none'}, :back_url => @back}, :method => :post,
|
2008-08-26 14:34:26 +04:00
|
|
|
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
|
2008-07-28 22:00:30 +04:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end -%>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
2010-10-08 07:09:51 +04:00
|
|
|
<% if Issue.use_field_for_done_ratio? %>
|
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| -%>
|
2010-03-01 23:54:55 +03:00
|
|
|
<li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :issue => {'done_ratio' => p}, :back_url => @back}, :method => :post,
|
2010-07-25 15:55:57 +04:00
|
|
|
:selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
2008-03-21 20:32:15 +03:00
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2009-12-11 21:48:34 +03:00
|
|
|
<% end %>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
2008-08-26 14:34:26 +04:00
|
|
|
<% if !@issue.nil? %>
|
2008-07-16 23:10:29 +04:00
|
|
|
<% if @can[:log_time] -%>
|
2010-11-16 22:49:08 +03:00
|
|
|
<li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'new', :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 %>
|
|
|
|
|
2009-12-05 01:46:12 +03:00
|
|
|
<% if @issue.present? %>
|
2009-12-06 15:52:03 +03:00
|
|
|
<li><%= context_menu_link l(:button_duplicate), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
|
|
|
|
:class => 'icon-duplicate', :disabled => !@can[:copy] %></li>
|
|
|
|
<% end %>
|
2010-08-11 18:42:10 +04:00
|
|
|
<li><%= context_menu_link l(:button_copy), new_issue_move_path(:ids => @issues.collect(&:id), :copy_options => {:copy => 't'}),
|
2009-12-05 01:46:12 +03:00
|
|
|
:class => 'icon-copy', :disabled => !@can[:move] %></li>
|
2010-08-11 18:42:10 +04:00
|
|
|
<li><%= context_menu_link l(:button_move), new_issue_move_path(:ids => @issues.collect(&:id)),
|
2008-02-10 16:17:41 +03:00
|
|
|
:class => 'icon-move', :disabled => !@can[:move] %></li>
|
2010-10-07 09:11:28 +04:00
|
|
|
<li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id), :back_url => @back},
|
2008-02-10 16:17:41 +03:00
|
|
|
: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>
|