Precede-Follow relation should move following issues earlier when rescheduling issue earlier (#4590).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10878 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+8
-3
@@ -869,9 +869,10 @@ class Issue < ActiveRecord::Base
|
||||
(start_date && due_date) ? working_days(start_date, due_date) : 0
|
||||
end
|
||||
|
||||
def soonest_start
|
||||
def soonest_start(reload=false)
|
||||
@soonest_start = nil if reload
|
||||
@soonest_start ||= (
|
||||
relations_to.collect{|relation| relation.successor_soonest_start} +
|
||||
relations_to(reload).collect{|relation| relation.successor_soonest_start} +
|
||||
ancestors.collect(&:soonest_start)
|
||||
).compact.max
|
||||
end
|
||||
@@ -890,7 +891,11 @@ class Issue < ActiveRecord::Base
|
||||
def reschedule_on!(date)
|
||||
return if date.nil?
|
||||
if leaf?
|
||||
if start_date.nil? || start_date < date
|
||||
if start_date.nil? || start_date != date
|
||||
if start_date && start_date > date
|
||||
# Issue can not be moved earlier than its soonest start date
|
||||
date = [soonest_start(true), date].compact.max
|
||||
end
|
||||
reschedule_on(date)
|
||||
begin
|
||||
save
|
||||
|
||||
Reference in New Issue
Block a user