##// END OF EJS Templates
Merged r4292 from trunk....
Eric Davis -
r4216:1ee7954f44d6
parent child
Show More
@@ -18,6 +18,7 class IssueMovesController < ApplicationController
18 18 @issues.each do |issue|
19 19 issue.reload
20 20 issue.init_journal(User.current)
21 issue.current_journal.notes = @notes if @notes.present?
21 22 call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
22 23 if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
23 24 moved_issues << r
@@ -50,6 +51,8 class IssueMovesController < ApplicationController
50 51 @target_project ||= @project
51 52 @trackers = @target_project.trackers
52 53 @available_statuses = Workflow.available_statuses(@project)
54 @notes = params[:notes]
55 @notes ||= ''
53 56 end
54 57
55 58 def extract_changed_attributes_for_move(params)
@@ -48,6 +48,11
48 48 <%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %>
49 49 </p>
50 50
51 <fieldset><legend><%= l(:field_notes) %></legend>
52 <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
53 <%= wikitoolbar_for 'notes' %>
54 </fieldset>
55
51 56 <%= call_hook(:view_issues_move_bottom, :issues => @issues, :target_project => @target_project, :copy => !!@copy) %>
52 57 </div>
53 58
@@ -41,8 +41,11 class IssueMovesControllerTest < ActionController::TestCase
41 41 end
42 42
43 43 context "#create via bulk move" do
44 should "allow changing the issue priority" do
44 setup do
45 45 @request.session[:user_id] = 2
46 end
47
48 should "allow changing the issue priority" do
46 49 post :create, :ids => [1, 2], :priority_id => 6
47 50
48 51 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
@@ -51,6 +54,15 class IssueMovesControllerTest < ActionController::TestCase
51 54
52 55 end
53 56
57 should "allow adding a note when moving" do
58 post :create, :ids => [1, 2], :notes => 'Moving two issues'
59
60 assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
61 assert_equal 'Moving two issues', Issue.find(1).journals.last.notes
62 assert_equal 'Moving two issues', Issue.find(2).journals.last.notes
63
64 end
65
54 66 end
55 67
56 68 def test_bulk_copy_to_another_project
General Comments 0
You need to be logged in to leave comments. Login now