]> source.dussan.org Git - redmine.git/commitdiff
Merged r15290 (#5156).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Apr 2016 05:53:40 +0000 (05:53 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Apr 2016 05:53:40 +0000 (05:53 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15308 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/bulk_edit.html.erb
test/functional/issues_controller_test.rb

index b4ec3d542ad0f65e2baf48931d264ff0bd512129..db77431fa6a9cb18bc8d86c6f4fb2e6b8b831d82 100644 (file)
 </p>
 <% end %>
 
+<% if @safe_attributes.include?('estimated_hours') %>
+<p>
+  <label for='issue_estimated_hours'><%= l(:field_estimated_hours) %></label>
+  <%= text_field_tag 'issue[estimated_hours]', '', :value => @issue_params[:estimated_hours], :size => 10 %>
+  <label class="inline"><%= check_box_tag 'issue[estimated_hours]', 'none', (@issue_params[:estimated_hours] == 'none'), :id => nil, :data => {:disables => '#issue_estimated_hours'} %><%= l(:button_clear) %></label>
+</p>
+<% end %>
+
 <% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %>
 <p>
   <label for='issue_done_ratio'><%= l(:field_done_ratio) %></label>
index 5c77e52b118b94ca9f677d91fcda8c3cc879838e..92ee15c21414801d8293b9e863ed6c0aa3b2052e 100644 (file)
@@ -4000,6 +4000,15 @@ class IssuesControllerTest < ActionController::TestCase
     assert_equal [1, 3], parent.children.collect(&:id).sort
   end
 
+  def test_bulk_update_estimated_hours
+    @request.session[:user_id] = 2
+    post :bulk_update, :ids => [1, 2], :issue => {:estimated_hours => 4.25}
+
+    assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+    assert_equal 4.25, Issue.find(1).estimated_hours
+    assert_equal 4.25, Issue.find(2).estimated_hours
+  end
+
   def test_bulk_update_custom_field
     @request.session[:user_id] = 2
     # update issues priority