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

Add the gantt module to all newly created projects

Henriette Darge8cfe39d9d43c
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index ba6b0452197..7950669f818 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -298,7 +298,7 @@ module Settings
allowed: -> { Redmine::I18n.all_languages }
},
default_projects_modules: {
- default: %w[calendar board_view work_package_tracking news costs wiki],
+ default: %w[calendar board_view work_package_tracking gantt news costs wiki],
allowed: -> { OpenProject::AccessControl.available_project_modules.map(&:to_s) }
},
default_projects_public: {
diff --git a/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
new file mode 100644
index 00000000000..53dc268ee37
--- /dev/null
+++ b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
@@ -0,0 +1,11 @@
+class AddGanttModuleToDefaultModules < ActiveRecord::Migration[7.0]
+ def up
+ unless Setting.default_projects_modules.include?('gantt')
+ Setting.default_projects_modules = Setting.default_projects_modules + ['gantt']
+ end
+ end
+
+ def down
+ # Nothing to do
+ end
+end