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
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