Chris@1296
|
1 <ul>
|
Chris@1296
|
2 <%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
|
Chris@1296
|
3
|
Chris@1296
|
4 <% if !@issue.nil? -%>
|
Chris@1296
|
5 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
|
Chris@1296
|
6 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
Chris@1296
|
7 <% else %>
|
Chris@1296
|
8 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issue_ids},
|
Chris@1296
|
9 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
|
Chris@1296
|
10 <% end %>
|
Chris@1296
|
11
|
Chris@1296
|
12 <% if @allowed_statuses.present? %>
|
Chris@1296
|
13 <li class="folder">
|
Chris@1296
|
14 <a href="#" class="submenu"><%= l(:field_status) %></a>
|
Chris@1296
|
15 <ul>
|
Chris@1296
|
16 <% @allowed_statuses.each do |s| -%>
|
Chris@1296
|
17 <li><%= context_menu_link h(s.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {:status_id => s}, :back_url => @back}, :method => :post,
|
Chris@1296
|
18 :selected => (@issue && s == @issue.status), :disabled => !@can[:update] %></li>
|
Chris@1296
|
19 <% end -%>
|
Chris@1296
|
20 </ul>
|
Chris@1296
|
21 </li>
|
Chris@1296
|
22 <% end %>
|
Chris@1296
|
23
|
Chris@1296
|
24 <% unless @trackers.nil? %>
|
Chris@1296
|
25 <li class="folder">
|
Chris@1296
|
26 <a href="#" class="submenu"><%= l(:field_tracker) %></a>
|
Chris@1296
|
27 <ul>
|
Chris@1296
|
28 <% @trackers.each do |t| -%>
|
Chris@1296
|
29 <li><%= context_menu_link h(t.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'tracker_id' => t}, :back_url => @back}, :method => :post,
|
Chris@1296
|
30 :selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
|
Chris@1296
|
31 <% end -%>
|
Chris@1296
|
32 </ul>
|
Chris@1296
|
33 </li>
|
Chris@1296
|
34 <% end %>
|
Chris@1296
|
35
|
Chris@1296
|
36 <% if @safe_attributes.include?('priority_id') -%>
|
Chris@1296
|
37 <li class="folder">
|
Chris@1296
|
38 <a href="#" class="submenu"><%= l(:field_priority) %></a>
|
Chris@1296
|
39 <ul>
|
Chris@1296
|
40 <% @priorities.each do |p| -%>
|
Chris@1296
|
41 <li><%= context_menu_link h(p.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'priority_id' => p}, :back_url => @back}, :method => :post,
|
Chris@1296
|
42 :selected => (@issue && p == @issue.priority), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
Chris@1296
|
43 <% end -%>
|
Chris@1296
|
44 </ul>
|
Chris@1296
|
45 </li>
|
Chris@1296
|
46 <% end %>
|
Chris@1296
|
47
|
Chris@1296
|
48 <% if @safe_attributes.include?('fixed_version_id') && @versions.any? -%>
|
Chris@1296
|
49 <li class="folder">
|
Chris@1296
|
50 <a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
|
Chris@1296
|
51 <ul>
|
Chris@1296
|
52 <% @versions.sort.each do |v| -%>
|
Chris@1296
|
53 <li><%= context_menu_link format_version_name(v), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'fixed_version_id' => v}, :back_url => @back}, :method => :post,
|
Chris@1296
|
54 :selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
|
Chris@1296
|
55 <% end -%>
|
Chris@1296
|
56 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'fixed_version_id' => 'none'}, :back_url => @back}, :method => :post,
|
Chris@1296
|
57 :selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
|
Chris@1296
|
58 </ul>
|
Chris@1296
|
59 </li>
|
Chris@1296
|
60 <% end %>
|
Chris@1296
|
61
|
Chris@1296
|
62 <% if @safe_attributes.include?('assigned_to_id') && @assignables.present? -%>
|
Chris@1296
|
63 <li class="folder">
|
Chris@1296
|
64 <a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
|
Chris@1296
|
65 <ul>
|
Chris@1296
|
66 <% if @assignables.include?(User.current) %>
|
Chris@1296
|
67 <li><%= context_menu_link "<< #{l(:label_me)} >>", {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => User.current}, :back_url => @back}, :method => :post,
|
Chris@1296
|
68 :disabled => !@can[:update] %></li>
|
Chris@1296
|
69 <% end %>
|
Chris@1296
|
70 <% @assignables.each do |u| -%>
|
Chris@1296
|
71 <li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => u}, :back_url => @back}, :method => :post,
|
Chris@1296
|
72 :selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
|
Chris@1296
|
73 <% end -%>
|
Chris@1296
|
74 <li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'assigned_to_id' => 'none'}, :back_url => @back}, :method => :post,
|
Chris@1296
|
75 :selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li>
|
Chris@1296
|
76 </ul>
|
Chris@1296
|
77 </li>
|
Chris@1296
|
78 <% end %>
|
Chris@1296
|
79
|
Chris@1296
|
80 <% if @safe_attributes.include?('category_id') && @project && @project.issue_categories.any? -%>
|
Chris@1296
|
81 <li class="folder">
|
Chris@1296
|
82 <a href="#" class="submenu"><%= l(:field_category) %></a>
|
Chris@1296
|
83 <ul>
|
Chris@1296
|
84 <% @project.issue_categories.each do |u| -%>
|
Chris@1296
|
85 <li><%= context_menu_link h(u.name), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'category_id' => u}, :back_url => @back}, :method => :post,
|
Chris@1296
|
86 :selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
|
Chris@1296
|
87 <% end -%>
|
Chris@1296
|
88 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'category_id' => 'none'}, :back_url => @back}, :method => :post,
|
Chris@1296
|
89 :selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
|
Chris@1296
|
90 </ul>
|
Chris@1296
|
91 </li>
|
Chris@1296
|
92 <% end -%>
|
Chris@1296
|
93
|
Chris@1296
|
94 <% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
|
Chris@1296
|
95 <li class="folder">
|
Chris@1296
|
96 <a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
|
Chris@1296
|
97 <ul>
|
Chris@1296
|
98 <% (0..10).map{|x|x*10}.each do |p| -%>
|
Chris@1296
|
99 <li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_update', :ids => @issue_ids, :issue => {'done_ratio' => p}, :back_url => @back}, :method => :post,
|
Chris@1296
|
100 :selected => (@issue && p == @issue.done_ratio), :disabled => (!@can[:edit] || @issues.detect {|i| !i.leaf?}) %></li>
|
Chris@1296
|
101 <% end -%>
|
Chris@1296
|
102 </ul>
|
Chris@1296
|
103 </li>
|
Chris@1296
|
104 <% end %>
|
Chris@1296
|
105
|
Chris@1296
|
106 <% @options_by_custom_field.each do |field, options| %>
|
Chris@1296
|
107 <li class="folder">
|
Chris@1296
|
108 <a href="#" class="submenu"><%= h(field.name) %></a>
|
Chris@1296
|
109 <ul>
|
Chris@1296
|
110 <% options.each do |text, value| %>
|
Chris@1296
|
111 <li><%= bulk_update_custom_field_context_menu_link(field, text, value || text) %></li>
|
Chris@1296
|
112 <% end %>
|
Chris@1296
|
113 <% unless field.is_required? %>
|
Chris@1296
|
114 <li><%= bulk_update_custom_field_context_menu_link(field, l(:label_none), '__none__') %></li>
|
Chris@1296
|
115 <% end %>
|
Chris@1296
|
116 </ul>
|
Chris@1296
|
117 </li>
|
Chris@1296
|
118 <% end %>
|
Chris@1296
|
119
|
Chris@1296
|
120 <% if !@issue.nil? %>
|
Chris@1296
|
121 <% if @can[:log_time] -%>
|
Chris@1296
|
122 <li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue},
|
Chris@1296
|
123 :class => 'icon-time-add' %></li>
|
Chris@1296
|
124 <% end %>
|
Chris@1296
|
125 <% if User.current.logged? %>
|
Chris@1296
|
126 <li><%= watcher_link(@issue, User.current) %></li>
|
Chris@1296
|
127 <% end %>
|
Chris@1296
|
128 <% end %>
|
Chris@1296
|
129
|
Chris@1296
|
130 <% if @issue.present? %>
|
Chris@1296
|
131 <li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
|
Chris@1296
|
132 :class => 'icon-copy', :disabled => !@can[:copy] %></li>
|
Chris@1296
|
133 <% else %>
|
Chris@1296
|
134 <li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'bulk_edit', :ids => @issue_ids, :copy => '1'},
|
Chris@1296
|
135 :class => 'icon-copy', :disabled => !@can[:move] %></li>
|
Chris@1296
|
136 <% end %>
|
Chris@1296
|
137 <li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back),
|
Chris@1296
|
138 :method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon-del', :disabled => !@can[:delete] %></li>
|
Chris@1296
|
139
|
Chris@1296
|
140 <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
|
Chris@1296
|
141 </ul>
|