Defect #1158 » fix_sprint_update_also_changes_children_v2.patch
lib/scrum/issue_patch.rb (.../branches/v0.13.2~5) (revision 45) | ||
---|---|---|
21 | 21 | |
22 | 22 |
before_save :update_position, :if => lambda {|issue| issue.sprint_id_changed? and issue.is_pbi?} |
23 | 23 | |
24 |
after_save :update_sprint_of_children, :if => lambda {|issue| issue.is_pbi? or issue.is_task?} |
|
25 |
|
|
24 | 26 |
def has_story_points? |
25 | 27 |
((!((custom_field_id = Scrum::Setting.story_points_custom_field_id).nil?)) and |
26 | 28 |
visible_custom_field_values.collect{|value| value.custom_field.id.to_s}.include?(custom_field_id)) |
... | ... | |
320 | 322 |
end |
321 | 323 |
end |
322 | 324 | |
325 |
def update_sprint_of_children |
|
326 |
self.children.each do |child| |
|
327 |
unless child.closed? |
|
328 |
if child.sprint != self.sprint |
|
329 |
child.init_journal(User.current) |
|
330 |
child.sprint = self.sprint |
|
331 |
child.save! |
|
332 |
end |
|
333 |
end |
|
334 |
end |
|
335 |
end |
|
336 |
|
|
323 | 337 |
def self.doer_or_reviewer_post_it_css_class(type) |
324 | 338 |
classes = ["post-it"] |
325 | 339 |
case type |
app/controllers/scrum_controller.rb (.../branches/v0.13.2~5) (revision 45) | ||
---|---|---|
382 | 382 |
issue.init_journal(User.current) |
383 | 383 |
issue.sprint = sprint |
384 | 384 |
issue.save! |
385 |
issue.children.each do |child| |
|
386 |
unless child.closed? |
|
387 |
move_issue_to_sprint(child, sprint) |
|
388 |
end |
|
389 |
end |
|
390 | 385 |
end |
391 | 386 | |
392 | 387 |
end |