Ability to add private comments from the issue bulk edit page (#22368).

git-svn-id: http://svn.redmine.org/redmine/trunk@17744 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2018-12-16 07:00:11 +00:00
parent 27c2d2e8f9
commit fee009f04f
2 changed files with 24 additions and 0 deletions

View File

@@ -194,6 +194,13 @@
<legend><%= l(:field_notes) %></legend>
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'notes' %>
<% if @safe_attributes.include?('private_notes') %>
<label class="inline">
<%= check_box_tag 'issue[private_notes]', 1, false %>
<%= l(:field_private_notes) %>
</label>
<% end %>
</fieldset>
</div>

View File

@@ -5819,6 +5819,23 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
assert_equal 'Moving two issues', Issue.find(1).journals.sort_by(&:id).last.notes
assert_equal 'Moving two issues', Issue.find(2).journals.sort_by(&:id).last.notes
assert_equal false, Issue.find(1).journals.sort_by(&:id).last.private_notes
assert_equal false, Issue.find(2).journals.sort_by(&:id).last.private_notes
end
def test_bulk_update_with_private_notes
@request.session[:user_id] = 2
post :bulk_update, :params => {
:ids => [1, 2],
:notes => 'Moving two issues',
:issue => {:private_notes => 'true'}
}
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
assert_equal 'Moving two issues', Issue.find(1).journals.sort_by(&:id).last.notes
assert_equal 'Moving two issues', Issue.find(2).journals.sort_by(&:id).last.notes
assert_equal true, Issue.find(1).journals.sort_by(&:id).last.private_notes
assert_equal true, Issue.find(2).journals.sort_by(&:id).last.private_notes
end
def test_bulk_update_parent_id