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? -%>
|
2011-09-18 01:56:12 +04: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 %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id)},
|
|
|
|
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
2010-09-03 23:54:24 +04:00
|
|
|
<% end %>
|
|
|
|
|
2010-10-28 01:01:26 +04:00
|
|
|
<% if @allowed_statuses.present? %>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu" onclick="return false;"><%= l(:field_status) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @statuses.each do |s| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link h(s.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {:status_id => s}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2010-09-03 23:54:24 +04:00
|
|
|
<% end %>
|
2008-08-26 14:34:26 +04:00
|
|
|
|
2011-09-18 01:56:12 +04:00
|
|
|
<% unless @trackers.nil? %>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_tracker) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @trackers.each do |t| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link h(t.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'tracker_id' => t}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_priority) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @priorities.each do |p| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link h(p.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'priority_id' => p}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
|
|
|
<% end -%>
|
|
|
|
</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 %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<% unless @project.nil? || @project.shared_versions.open.empty? -%>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @project.shared_versions.open.sort.each do |v| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'fixed_version_id' => v}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
|
|
|
|
<% end -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'fixed_version_id' => 'none'}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if @assignables.present? -%>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
|
|
|
|
<ul>
|
2012-01-21 15:11:13 +04:00
|
|
|
<% if @assignables.include?(User.current) %>
|
|
|
|
<li><%= context_menu_link "<< #{l(:label_me)} >>", {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => User.current}, :back_url => @back}, :method => :post,
|
|
|
|
:disabled => !@can[:update] %></li>
|
|
|
|
<% end %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<% @assignables.each do |u| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => u}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
|
|
|
|
<% end -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'assigned_to_id' => 'none'}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% unless @project.nil? || @project.issue_categories.empty? -%>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2011-09-18 01:56:12 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_category) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @project.issue_categories.each do |u| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'category_id' => u}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
|
|
|
|
<% end -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'category_id' => 'none'}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
|
|
|
|
</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? %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<li class="folder">
|
|
|
|
<a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
|
|
|
|
<ul>
|
|
|
|
<% (0..10).map{|x|x*10}.each do |p| -%>
|
2011-12-14 23:06:23 +04:00
|
|
|
<li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_update', :ids => @issues.collect(&:id), :issue => {'done_ratio' => p}, :back_url => @back}, :method => :post,
|
2011-09-18 01:56:12 +04:00
|
|
|
:selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
|
|
|
<% 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? %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<% if @can[:log_time] -%>
|
|
|
|
<li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue},
|
|
|
|
:class => 'icon-time-add' %></li>
|
|
|
|
<% end %>
|
|
|
|
<% 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? %>
|
2012-01-08 15:16:54 +04:00
|
|
|
<li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
|
|
|
|
:class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
|
|
|
<% else %>
|
2012-01-07 21:27:47 +04:00
|
|
|
<li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), :copy => '1'},
|
2012-01-08 15:16:54 +04:00
|
|
|
:class => 'icon-copy', :disabled => !@can[:move] %></li>
|
|
|
|
<% end %>
|
2011-12-10 13:10:51 +04:00
|
|
|
<li><%= context_menu_link l(:button_delete), issues_path(:ids => @issues.collect(&:id), :back_url => @back),
|
|
|
|
:method => :delete, :confirm => issues_destroy_confirmation_message(@issues), :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>
|