summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-06 08:32:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-06 08:32:56 +0000
commit533994e5ea00d8273298becd612f8615fba76c0c (patch)
treee8f9fe41e5184e92d096038cbb117b34d192d53e
parente951d8458413f02ba613163df862d1a352ed3692 (diff)
downloadredmine-533994e5ea00d8273298becd612f8615fba76c0c.tar.gz
redmine-533994e5ea00d8273298becd612f8615fba76c0c.zip
Adds an application setting to choose whether or not subprojects issues should be displayed by default on the issue list, calendar and gantt (r1178). Default is true.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1198 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/models/query.rb19
-rw-r--r--app/views/settings/_issues.rhtml3
-rw-r--r--config/settings.yml2
-rw-r--r--lang/bg.yml1
-rw-r--r--lang/cs.yml1
-rw-r--r--lang/de.yml1
-rw-r--r--lang/en.yml1
-rw-r--r--lang/es.yml1
-rw-r--r--lang/fi.yml1
-rw-r--r--lang/fr.yml1
-rw-r--r--lang/he.yml1
-rw-r--r--lang/it.yml1
-rw-r--r--lang/ja.yml1
-rw-r--r--lang/ko.yml1
-rw-r--r--lang/lt.yml1
-rw-r--r--lang/nl.yml1
-rw-r--r--lang/pl.yml1
-rw-r--r--lang/pt-br.yml1
-rw-r--r--lang/pt.yml1
-rw-r--r--lang/ro.yml1
-rw-r--r--lang/ru.yml1
-rw-r--r--lang/sr.yml1
-rw-r--r--lang/sv.yml1
-rw-r--r--lang/uk.yml1
-rw-r--r--lang/zh-tw.yml1
-rw-r--r--lang/zh.yml1
27 files changed, 43 insertions, 8 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index b9758c810..af5960399 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -302,7 +302,7 @@ class ProjectsController < ApplicationController
@year ||= Date.today.year
@month ||= Date.today.month
@calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :month)
- @with_subprojects = params[:with_subprojects].nil? ? true : (params[:with_subprojects] == '1')
+ @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
events = []
@project.issues_with_subprojects(@with_subprojects) do
events += Issue.find(:all,
@@ -345,7 +345,7 @@ class ProjectsController < ApplicationController
@date_from = Date.civil(@year_from, @month_from, 1)
@date_to = (@date_from >> @months) - 1
- @with_subprojects = params[:with_subprojects].nil? ? true : (params[:with_subprojects] == '1')
+ @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
@events = []
@project.issues_with_subprojects(@with_subprojects) do
diff --git a/app/models/query.rb b/app/models/query.rb
index 73828f739..665280ac2 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -261,12 +261,19 @@ class Query < ActiveRecord::Base
clause = ''
if project && !@project.active_children.empty?
ids = [project.id]
- if has_filter?("subproject_id") && operator_for("subproject_id") == "="
- # include the selected subprojects
- ids += values_for("subproject_id").each(&:to_i)
- else
- # include all the subprojects unless 'none' is selected
- ids += project.active_children.collect{|p| p.id} unless has_filter?("subproject_id") && operator_for("subproject_id") == "!*"
+ if has_filter?("subproject_id")
+ case operator_for("subproject_id")
+ when '='
+ # include the selected subprojects
+ ids += values_for("subproject_id").each(&:to_i)
+ when '!*'
+ # main project only
+ else
+ # all subprojects
+ ids += project.active_children.collect{|p| p.id}
+ end
+ elsif Setting.display_subprojects_issues?
+ ids += project.active_children.collect{|p| p.id}
end
clause << "#{Issue.table_name}.project_id IN (%s)" % ids.join(',')
elsif project
diff --git a/app/views/settings/_issues.rhtml b/app/views/settings/_issues.rhtml
index 36c604fd9..bbd7356fd 100644
--- a/app/views/settings/_issues.rhtml
+++ b/app/views/settings/_issues.rhtml
@@ -4,6 +4,9 @@
<p><label><%= l(:setting_cross_project_issue_relations) %></label>
<%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %></p>
+<p><label><%= l(:setting_display_subprojects_issues) %></label>
+<%= check_box_tag 'settings[display_subprojects_issues]', 1, Setting.display_subprojects_issues? %><%= hidden_field_tag 'settings[display_subprojects_issues]', 0 %></p>
+
<p><label><%= l(:setting_issues_export_limit) %></label>
<%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %></p>
</div>
diff --git a/config/settings.yml b/config/settings.yml
index bb8c1f603..59f4f0437 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -101,6 +101,8 @@ issue_list_default_columns:
- subject
- assigned_to
- updated_on
+display_subprojects_issues:
+ default: 1
# encodings used to convert repository files content to UTF-8
# multiple values accepted, comma separated
repositories_encodings:
diff --git a/lang/bg.yml b/lang/bg.yml
index 11e18b849..7e65a9d2a 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/cs.yml b/lang/cs.yml
index ccf93fb9c..95e597c7e 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/de.yml b/lang/de.yml
index bdbe549c2..09e23f4f3 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/en.yml b/lang/en.yml
index 0445834fe..be7e1eb74 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -208,6 +208,7 @@ setting_protocol: Protocol
setting_per_page_options: Objects per page options
setting_user_format: Users display format
setting_activity_days_default: Days displayed on project activity
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
project_module_issue_tracking: Issue tracking
project_module_time_tracking: Time tracking
diff --git a/lang/es.yml b/lang/es.yml
index d137054d9..fe8a419d6 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -615,3 +615,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/fi.yml b/lang/fi.yml
index b2ad672f4..9b45263d2 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -616,3 +616,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/fr.yml b/lang/fr.yml
index b992ceff2..3370ba71b 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -208,6 +208,7 @@ setting_protocol: Protocole
setting_per_page_options: Options d'objets affichés par page
setting_user_format: Format d'affichage des utilisateurs
setting_activity_days_default: Nombre de jours affichés sur l'activité des projets
+setting_display_subprojects_issues: Afficher par défaut les demandes des sous-projets sur les projets principaux
project_module_issue_tracking: Suivi des demandes
project_module_time_tracking: Suivi du temps passé
diff --git a/lang/he.yml b/lang/he.yml
index 66a493bbb..b8cb9d4b6 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/it.yml b/lang/it.yml
index c47729c50..3a07a2f98 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/ja.yml b/lang/ja.yml
index 37392dd7e..84fa5e6df 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/ko.yml b/lang/ko.yml
index 5685d063a..9e5f5a7ce 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/lt.yml b/lang/lt.yml
index c783f5768..5440d6af9 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/nl.yml b/lang/nl.yml
index 6d650456d..43d781180 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/pl.yml b/lang/pl.yml
index bf8f3f1ba..7368a5a66 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 9ddd6f94b..e3b50bdb4 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/pt.yml b/lang/pt.yml
index 63972d042..034da0db9 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/ro.yml b/lang/ro.yml
index 9d374af53..52011ff76 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -612,3 +612,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/ru.yml b/lang/ru.yml
index d5b67f964..400e48448 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -616,3 +616,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/sr.yml b/lang/sr.yml
index edef5f7f5..c48a4e63f 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/sv.yml b/lang/sv.yml
index f3940759b..125e2dcc7 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/uk.yml b/lang/uk.yml
index d8e4a7a66..155370576 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -614,3 +614,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index eb1a5e305..7cc11c611 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default
diff --git a/lang/zh.yml b/lang/zh.yml
index e7d790938..0b17b4ff9 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -613,3 +613,4 @@ label_chronological_order: In chronological order
field_comments_sorting: Afficher les commentaires
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+setting_display_subprojects_issues: Display subprojects issues on main projects by default