]> source.dussan.org Git - redmine.git/commitdiff
Merged r3917 from trunk.
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 04:31:24 +0000 (04:31 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 04:31:24 +0000 (04:31 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3967 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index d73dfebfe81ba2b2ad9439637b01a98b7eb7f47f..4f6f975cdd75c992e070511607e8754183157551 100644 (file)
@@ -264,15 +264,9 @@ class IssuesController < ApplicationController
       moved_issues = []
       @issues.each do |issue|
         issue.reload
-        changed_attributes = {}
-        [:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
-          unless params[valid_attribute].blank?
-            changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
-          end 
-        end
         issue.init_journal(User.current)
         call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
-        if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => changed_attributes})
+        if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
           moved_issues << r
         else
           unsaved_issue_ids << issue.id
@@ -485,4 +479,14 @@ private
       return false
     end
   end
+
+  def extract_changed_attributes_for_move(params)
+    changed_attributes = {}
+    [:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
+      unless params[valid_attribute].blank?
+        changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
+      end
+    end
+    changed_attributes
+  end
 end