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 }) %>
|
|
|
|
|
2012-12-22 14:00:00 +04:00
|
|
|
<% if @issue -%>
|
|
|
|
<li><%= context_menu_link l(:button_edit), edit_issue_path(@issue),
|
|
|
|
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
|
|
|
<% else %>
|
|
|
|
<li><%= context_menu_link l(:button_edit), bulk_edit_issues_path(:ids => @issue_ids),
|
|
|
|
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
|
|
|
<% end %>
|
2010-09-03 23:54:24 +04:00
|
|
|
|
2010-10-28 01:01:26 +04:00
|
|
|
<% if @allowed_statuses.present? %>
|
2011-09-18 05:59:12 +04:00
|
|
|
<li class="folder">
|
2012-02-10 00:25:01 +04:00
|
|
|
<a href="#" class="submenu"><%= l(:field_status) %></a>
|
2011-09-18 01:56:12 +04:00
|
|
|
<ul>
|
2012-02-09 23:34:56 +04:00
|
|
|
<% @allowed_statuses.each do |s| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link h(s.name), bulk_update_issues_path(:ids => @issue_ids, :issue => {:status_id => s}, :back_url => @back), :method => :post,
|
2012-02-09 23:34:56 +04:00
|
|
|
:selected => (@issue && s == @issue.status), :disabled => !@can[:update] %></li>
|
2011-09-18 01:56:12 +04:00
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2010-09-03 23:54:24 +04:00
|
|
|
<% end %>
|
2008-08-26 14:34:26 +04:00
|
|
|
|
2012-12-22 14:00:00 +04:00
|
|
|
<% if @trackers.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_tracker) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @trackers.each do |t| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link h(t.name), bulk_update_issues_path(:ids => @issue_ids, :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
|
|
|
|
2012-12-22 14:00:00 +04:00
|
|
|
<% if @safe_attributes.include?('priority_id') && @priorities.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_priority) %></a>
|
|
|
|
<ul>
|
|
|
|
<% @priorities.each do |p| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link h(p.name), bulk_update_issues_path(:ids => @issue_ids, :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>
|
2012-07-05 16:20:07 +04:00
|
|
|
<% end %>
|
2010-09-04 01:43:07 +04:00
|
|
|
|
2012-12-22 14:00:00 +04:00
|
|
|
<% if @safe_attributes.include?('fixed_version_id') && @versions.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_fixed_version) %></a>
|
|
|
|
<ul>
|
2012-07-08 17:19:46 +04:00
|
|
|
<% @versions.sort.each do |v| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link format_version_name(v), bulk_update_issues_path(:ids => @issue_ids, :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 -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :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 %>
|
2012-07-05 16:20:07 +04:00
|
|
|
|
|
|
|
<% if @safe_attributes.include?('assigned_to_id') && @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) %>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link "<< #{l(:label_me)} >>", bulk_update_issues_path(:ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back), :method => :post,
|
2012-01-21 15:11:13 +04:00
|
|
|
:disabled => !@can[:update] %></li>
|
|
|
|
<% end %>
|
2011-09-18 01:56:12 +04:00
|
|
|
<% @assignables.each do |u| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link h(u.name), bulk_update_issues_path(:ids => @issue_ids, :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 -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link l(:label_nobody), bulk_update_issues_path(:ids => @issue_ids, :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 %>
|
2012-07-05 16:20:07 +04:00
|
|
|
|
|
|
|
<% if @safe_attributes.include?('category_id') && @project && @project.issue_categories.any? -%>
|
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| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link h(u.name), bulk_update_issues_path(:ids => @issue_ids, :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 -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link l(:label_none), bulk_update_issues_path(:ids => @issue_ids, :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
|
|
|
|
2012-07-05 16:20:07 +04:00
|
|
|
<% if @safe_attributes.include?('done_ratio') && 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| -%>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link "#{p}%", bulk_update_issues_path(:ids => @issue_ids, :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
|
|
|
|
2012-02-09 22:22:11 +04:00
|
|
|
<% @options_by_custom_field.each do |field, options| %>
|
2012-12-22 13:35:35 +04:00
|
|
|
<li class="folder cf_<%= field.id %>">
|
2012-02-09 22:22:11 +04:00
|
|
|
<a href="#" class="submenu"><%= h(field.name) %></a>
|
|
|
|
<ul>
|
|
|
|
<% options.each do |text, value| %>
|
|
|
|
<li><%= bulk_update_custom_field_context_menu_link(field, text, value || text) %></li>
|
|
|
|
<% end %>
|
|
|
|
<% unless field.is_required? %>
|
2013-02-07 22:35:51 +04:00
|
|
|
<li><%= bulk_update_custom_field_context_menu_link(field, l(:label_none), '__none__') %></li>
|
2012-02-09 22:22:11 +04:00
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
|
2013-02-10 14:31:12 +04:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<li><%= watcher_link(@issues, User.current) %></li>
|
|
|
|
<% end %>
|
|
|
|
|
2012-12-22 14:00:00 +04:00
|
|
|
<% if @issue.present? %>
|
|
|
|
<% if @can[:log_time] -%>
|
|
|
|
<li><%= context_menu_link l(:button_log_time), new_issue_time_entry_path(@issue),
|
|
|
|
:class => 'icon-time-add' %></li>
|
|
|
|
<% end %>
|
|
|
|
<li><%= context_menu_link l(:button_copy), project_copy_issue_path(@project, @issue),
|
2012-01-08 15:16:54 +04:00
|
|
|
:class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
|
|
|
<% else %>
|
2012-12-22 14:00:00 +04:00
|
|
|
<li><%= context_menu_link l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
|
2012-01-08 15:16:54 +04:00
|
|
|
:class => 'icon-copy', :disabled => !@can[:move] %></li>
|
|
|
|
<% end %>
|
2012-07-08 17:31:22 +04:00
|
|
|
<li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back),
|
2012-07-07 18:36:49 +04:00
|
|
|
:method => :delete, :data => {: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>
|