]> source.dussan.org Git - redmine.git/commitdiff
Adds tracker update to context menu and bulk edit form (#2405).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Nov 2009 20:00:21 +0000 (20:00 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Nov 2009 20:00:21 +0000 (20:00 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3109 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
app/views/issues/bulk_edit.rhtml
app/views/issues/context_menu.rhtml

index 02be772a2a39242bf3899018f5f3a0bdb81020bf..cf54db445a51ba248ddf5c5117429b0289622b6e 100644 (file)
@@ -234,6 +234,7 @@ class IssuesController < ApplicationController
   # 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])
@@ -244,6 +245,7 @@ class IssuesController < ApplicationController
       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'
@@ -421,6 +423,7 @@ class IssuesController < ApplicationController
       @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']
index 10a5bb5a29ce17e378ee09bd8429e455391ca47e..de82e18cec1aa42385eb6142226adcac3f7bab85 100644 (file)
@@ -8,10 +8,14 @@
 <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) %>: 
index 073f12bd6faa423a0c9595b628706dcaadae9836..3e22a17c94271eb7c770203499dab183e4c52ca9 100644 (file)
                :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>