@@ -18,6 +18,7 class IssueMovesController < ApplicationController | |||||
18 | @issues.each do |issue| |
|
18 | @issues.each do |issue| | |
19 | issue.reload |
|
19 | issue.reload | |
20 | issue.init_journal(User.current) |
|
20 | issue.init_journal(User.current) | |
|
21 | issue.current_journal.notes = @notes if @notes.present? | |||
21 | call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy }) |
|
22 | call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy }) | |
22 | if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)}) |
|
23 | if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)}) | |
23 | moved_issues << r |
|
24 | moved_issues << r | |
@@ -50,6 +51,8 class IssueMovesController < ApplicationController | |||||
50 | @target_project ||= @project |
|
51 | @target_project ||= @project | |
51 | @trackers = @target_project.trackers |
|
52 | @trackers = @target_project.trackers | |
52 | @available_statuses = Workflow.available_statuses(@project) |
|
53 | @available_statuses = Workflow.available_statuses(@project) | |
|
54 | @notes = params[:notes] | |||
|
55 | @notes ||= '' | |||
53 | end |
|
56 | end | |
54 |
|
57 | |||
55 | def extract_changed_attributes_for_move(params) |
|
58 | def extract_changed_attributes_for_move(params) |
@@ -48,6 +48,11 | |||||
48 | <%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %> |
|
48 | <%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %> | |
49 | </p> |
|
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 | <%= call_hook(:view_issues_move_bottom, :issues => @issues, :target_project => @target_project, :copy => !!@copy) %> |
|
56 | <%= call_hook(:view_issues_move_bottom, :issues => @issues, :target_project => @target_project, :copy => !!@copy) %> | |
52 | </div> |
|
57 | </div> | |
53 |
|
58 |
@@ -41,8 +41,11 class IssueMovesControllerTest < ActionController::TestCase | |||||
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | context "#create via bulk move" do |
|
43 | context "#create via bulk move" do | |
44 | should "allow changing the issue priority" do |
|
44 | setup do | |
45 | @request.session[:user_id] = 2 |
|
45 | @request.session[:user_id] = 2 | |
|
46 | end | |||
|
47 | ||||
|
48 | should "allow changing the issue priority" do | |||
46 | post :create, :ids => [1, 2], :priority_id => 6 |
|
49 | post :create, :ids => [1, 2], :priority_id => 6 | |
47 |
|
50 | |||
48 | assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook' |
|
51 | assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook' | |
@@ -50,6 +53,15 class IssueMovesControllerTest < ActionController::TestCase | |||||
50 | assert_equal 6, Issue.find(2).priority_id |
|
53 | assert_equal 6, Issue.find(2).priority_id | |
51 |
|
54 | |||
52 | end |
|
55 | end | |
|
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 | |||
53 |
|
65 | |||
54 | end |
|
66 | end | |
55 |
|
67 |
General Comments 0
You need to be logged in to leave comments.
Login now