Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use RescheduleService in the ActivationService

Dombi Attila7e1d40cea01f
diff --git a/app/services/project_phases/activation_service.rb b/app/services/project_phases/activation_service.rb
index b0da97a277f..7aebe9f3053 100644
--- a/app/services/project_phases/activation_service.rb
+++ b/app/services/project_phases/activation_service.rb
@@ -47,13 +47,16 @@ module ProjectPhases
upsert(active:)
- if (phase = reschedule_from_phase)
- UpdateService.new(user:, model: phase).call
- else
- project.touch_and_save_journals
+ if (phase = reschedule_from_phase) && phase.date_range_set?
+ from = phase.active? ? Day.next_working(from: phase.finish_date).date : phase.start_date
- service_call
+ service_call = RescheduleService.new(user:, project:)
+ .call(phases: phase.following_phases, from:)
end
+
+ project.touch_and_save_journals
+
+ service_call
end
def upsert(active:)