# Bulk edit a set of issues
def bulk_edit
if request.post?
+ tracker = params[:tracker_id].blank? ? nil : @project.trackers.find_by_id(params[:tracker_id])
status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id])
priority = params[:priority_id].blank? ? nil : IssuePriority.find_by_id(params[:priority_id])
assigned_to = (params[:assigned_to_id].blank? || params[:assigned_to_id] == 'none') ? nil : User.find_by_id(params[:assigned_to_id])
unsaved_issue_ids = []
@issues.each do |issue|
journal = issue.init_journal(User.current, params[:notes])
+ issue.tracker = tracker if tracker
issue.priority = priority if priority
issue.assigned_to = assigned_to if assigned_to || params[:assigned_to_id] == 'none'
issue.category = category if category || params[:category_id] == 'none'
@assignables << @issue.assigned_to if @issue && @issue.assigned_to && !@assignables.include?(@issue.assigned_to)
end
+ @trackers = @project.trackers
@priorities = IssuePriority.all.reverse
@statuses = IssueStatus.find(:all, :order => 'position')
@back = params[:back_url] || request.env['HTTP_REFERER']
<fieldset>
<legend><%= l(:label_change_properties) %></legend>
<p>
+<label><%= l(:field_tracker) %>:
+<%= select_tag('tracker_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@project.trackers, :id, :name)) %></label>
<% if @available_statuses.any? %>
<label><%= l(:field_status) %>:
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@available_statuses, :id, :name)) %></label>
<% end %>
+</p>
+<p>
<label><%= l(:field_priority) %>:
<%= select_tag('priority_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(IssuePriority.all, :id, :name)) %></label>
<label><%= l(:field_category) %>:
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
<% end %>
+ <li class="folder">
+ <a href="#" class="submenu"><%= l(:field_tracker) %></a>
+ <ul>
+ <% @trackers.each do |t| -%>
+ <li><%= context_menu_link t.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'tracker_id' => t, :back_to => @back}, :method => :post,
+ :selected => (@issue && t == @issue.tracker), :disabled => !@can[:edit] %></li>
+ <% end -%>
+ </ul>
+ </li>
<li class="folder">
<a href="#" class="submenu"><%= l(:field_priority) %></a>
<ul>