##// END OF EJS Templates
Allow bulk editing of parent issue (#5831)....
Jean-Philippe Lang -
r5104:ca5951b4f621
parent child
Show More
@@ -55,6 +55,14
55 55 </div>
56 56
57 57 <div class="splitcontentright">
58 <% if @project && User.current.allowed_to?(:manage_subtasks, @project) %>
59 <p>
60 <label><%= l(:field_parent_issue) %></label>
61 <%= text_field_tag 'issue[parent_issue_id]', '', :size => 10 %>
62 </p>
63 <div id="parent_issue_candidates" class="autocomplete"></div>
64 <%= javascript_tag "observeParentIssueField('#{auto_complete_issues_path(:project_id => @project) }')" %>
65 <% end %>
58 66 <p>
59 67 <label><%= l(:field_start_date) %></label>
60 68 <%= text_field_tag 'issue[start_date]', '', :size => 10 %><%= calendar_for('issue_start_date') %>
@@ -1091,6 +1091,8 class IssuesControllerTest < ActionController::TestCase
1091 1091 assert_response :success
1092 1092 assert_template 'bulk_edit'
1093 1093
1094 assert_tag :input, :attributes => {:name => 'issue[parent_issue_id]'}
1095
1094 1096 # Project specific custom field, date type
1095 1097 field = CustomField.find(9)
1096 1098 assert !field.is_for_all?
@@ -1108,6 +1110,9 class IssuesControllerTest < ActionController::TestCase
1108 1110 assert_response :success
1109 1111 assert_template 'bulk_edit'
1110 1112
1113 # Can not set issues from different projects as children of an issue
1114 assert_no_tag :input, :attributes => {:name => 'issue[parent_issue_id]'}
1115
1111 1116 # Project specific custom field, date type
1112 1117 field = CustomField.find(9)
1113 1118 assert !field.is_for_all?
@@ -1197,6 +1202,19 class IssuesControllerTest < ActionController::TestCase
1197 1202 issue = Issue.find(1)
1198 1203 assert issue.closed?
1199 1204 end
1205
1206 def test_bulk_update_parent_id
1207 @request.session[:user_id] = 2
1208 post :bulk_update, :ids => [1, 3],
1209 :notes => 'Bulk editing parent',
1210 :issue => {:priority_id => '', :assigned_to_id => '', :status_id => '', :parent_issue_id => '2'}
1211
1212 assert_response 302
1213 parent = Issue.find(2)
1214 assert_equal parent.id, Issue.find(1).parent_id
1215 assert_equal parent.id, Issue.find(3).parent_id
1216 assert_equal [1, 3], parent.children.collect(&:id).sort
1217 end
1200 1218
1201 1219 def test_bulk_update_custom_field
1202 1220 @request.session[:user_id] = 2
General Comments 0
You need to be logged in to leave comments. Login now