From b2018dfa8a3af13e7c7ffe9dddad5ab478273e43 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Nov 2009 16:20:33 +0000 Subject: [PATCH] Adds a setting for new projects default modules (#1797). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3068 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 2 +- app/views/settings/_projects.rhtml | 10 ++++++++++ config/locales/bg.yml | 1 + config/locales/bs.yml | 1 + config/locales/ca.yml | 1 + config/locales/cs.yml | 1 + config/locales/da.yml | 1 + config/locales/de.yml | 1 + config/locales/el.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/fi.yml | 1 + config/locales/fr.yml | 1 + config/locales/gl.yml | 1 + config/locales/he.yml | 1 + config/locales/hu.yml | 1 + config/locales/it.yml | 1 + config/locales/ja.yml | 1 + config/locales/ko.yml | 1 + config/locales/lt.yml | 1 + config/locales/nl.yml | 1 + config/locales/no.yml | 1 + config/locales/pl.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/pt.yml | 1 + config/locales/ro.yml | 1 + config/locales/ru.yml | 1 + config/locales/sk.yml | 1 + config/locales/sl.yml | 1 + config/locales/sr.yml | 1 + config/locales/sv.yml | 1 + config/locales/th.yml | 1 + config/locales/tr.yml | 1 + config/locales/uk.yml | 1 + config/locales/vi.yml | 1 + config/locales/zh-TW.yml | 1 + config/locales/zh.yml | 1 + config/settings.yml | 11 +++++++++++ public/stylesheets/application.css | 2 +- 39 files changed, 58 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8a6d16f20..1e80a7132 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -71,7 +71,7 @@ class ProjectsController < ApplicationController @project.identifier = Project.next_identifier if Setting.sequential_project_identifiers? @project.trackers = Tracker.all @project.is_public = Setting.default_projects_public? - @project.enabled_module_names = Redmine::AccessControl.available_project_modules + @project.enabled_module_names = Setting.default_projects_modules else @project.enabled_module_names = params[:enabled_modules] if @project.save diff --git a/app/views/settings/_projects.rhtml b/app/views/settings/_projects.rhtml index 704905af2..9e94ed141 100644 --- a/app/views/settings/_projects.rhtml +++ b/app/views/settings/_projects.rhtml @@ -6,6 +6,16 @@ <%= check_box_tag 'settings[default_projects_public]', 1, Setting.default_projects_public? %>

+

+<%= hidden_field_tag 'settings[default_projects_modules][]', '' %> +<% Redmine::AccessControl.available_project_modules.each do |m| %> + +<% end %> +

+

<%= hidden_field_tag 'settings[sequential_project_identifiers]', 0 %> <%= check_box_tag 'settings[sequential_project_identifiers]', 1, Setting.sequential_project_identifiers? %> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 69662dbab..bd0243a54 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -833,3 +833,4 @@ bg: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 716df4385..b2d29ddf0 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -857,3 +857,4 @@ bs: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 966df9a8f..12a212001 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -836,3 +836,4 @@ ca: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/cs.yml b/config/locales/cs.yml index c1533f62b..af8b16eb2 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -839,3 +839,4 @@ cs: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/da.yml b/config/locales/da.yml index 4d433f44c..4028ad2d5 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -859,3 +859,4 @@ da: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/de.yml b/config/locales/de.yml index 425bcb575..dfe22ae88 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -859,3 +859,4 @@ de: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/el.yml b/config/locales/el.yml index 032fa1cac..ed31de7ba 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -839,3 +839,4 @@ el: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/en.yml b/config/locales/en.yml index 5bd70a420..0000e427e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -312,6 +312,7 @@ en: setting_openid: Allow OpenID login and registration setting_password_min_length: Minimum password length setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_default_projects_modules: Default enabled modules for new projects permission_add_project: Create project permission_edit_project: Edit project diff --git a/config/locales/es.yml b/config/locales/es.yml index d03088d5c..2f8a764f1 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -880,3 +880,4 @@ es: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/fi.yml b/config/locales/fi.yml index acdee65a0..3745f6cfd 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -869,3 +869,4 @@ fi: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/fr.yml b/config/locales/fr.yml index aaa858af5..4a32fc373 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -334,6 +334,7 @@ fr: setting_openid: "Autoriser l'authentification et l'enregistrement OpenID" setting_password_min_length: Longueur minimum des mots de passe setting_new_project_user_role_id: Rôle donné à un utilisateur non-administrateur qui crée un projet + setting_default_projects_modules: Modules activés par défaut pour les nouveaux projets permission_add_project: Créer un projet permission_edit_project: Modifier le projet diff --git a/config/locales/gl.yml b/config/locales/gl.yml index e6f260ae6..99154d397 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -859,3 +859,4 @@ gl: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/he.yml b/config/locales/he.yml index 16d6800df..d9096865e 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -843,3 +843,4 @@ he: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 1c9f7f0cf..c68395616 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -864,3 +864,4 @@ error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/it.yml b/config/locales/it.yml index 74132a60a..781ad30e3 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -846,3 +846,4 @@ it: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1cdb14f8e..4f9ab13dd 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -868,3 +868,4 @@ ja: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/ko.yml b/config/locales/ko.yml index a5b08607d..ec2330e42 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -899,3 +899,4 @@ ko: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 67e65a570..269f73381 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -869,3 +869,4 @@ lt: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 191738fd0..9ef2162be 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -821,3 +821,4 @@ nl: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/no.yml b/config/locales/no.yml index 6fa2be0fe..4c1f326ff 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -834,3 +834,4 @@ error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 104a568a8..12649ac39 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -862,3 +862,4 @@ pl: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 10d43a66c..88fa840d0 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -865,3 +865,4 @@ pt-BR: error_can_not_reopen_issue_on_closed_version: Uma tarefa atribuída a uma versão fechada não pode ser reaberta label_user_anonymous: Anônimo button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/pt.yml b/config/locales/pt.yml index c0133116c..3e5bd81a3 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -851,3 +851,4 @@ pt: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 9a97febd5..c3d1e116b 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -836,3 +836,4 @@ ro: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 84f06e8fb..1f0d01c11 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -947,3 +947,4 @@ ru: error_can_not_reopen_issue_on_closed_version: Задача, назначенная к закрытой версии, не сможет быть открыта снова label_user_anonymous: Аноним button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 8f79cb367..cd19e91b0 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -838,3 +838,4 @@ sk: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 9ebcb6c40..5f3db50c6 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -835,3 +835,4 @@ sl: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/sr.yml b/config/locales/sr.yml index dbd0c316e..38d501e4c 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -854,3 +854,4 @@ error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 807db8db4..d82d22099 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -887,3 +887,4 @@ sv: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/th.yml b/config/locales/th.yml index 3ca9c46f9..c4474ccce 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -836,3 +836,4 @@ th: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 01e284391..0ae8c544f 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -866,3 +866,4 @@ tr: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/uk.yml b/config/locales/uk.yml index f7f2a66fc..93b372266 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -835,3 +835,4 @@ uk: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/vi.yml b/config/locales/vi.yml index b12cba75b..28c7ab690 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -898,3 +898,4 @@ vi: error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 494e5c808..c63674fd1 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -930,3 +930,4 @@ enumeration_activities: 活動 (時間追蹤) enumeration_system_activity: 系統活動 button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f1c772fc1..ecd1408df 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -863,3 +863,4 @@ zh: enumeration_activities: 活动(时间跟踪) enumeration_system_activity: 系统活动 button_move_and_follow: Move and follow + setting_default_projects_modules: Default enabled modules for new projects diff --git a/config/settings.yml b/config/settings.yml index e0950c510..f529d0201 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -131,6 +131,17 @@ display_subprojects_issues: default: 1 default_projects_public: default: 1 +default_projects_modules: + serialized: true + default: + - issue_tracking + - time_tracking + - news + - documents + - files + - wiki + - repository + - boards # Role given to a non-admin user who creates a project new_project_user_role_id: format: int diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 5042c1282..cf344900f 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -325,7 +325,7 @@ width: 270px; .tabular label.block{ font-weight: normal; -margin-left: 0px; +margin-left: 0px !important; text-align: left; float: none; display: block;