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
This commit is contained in:
Jean-Philippe Lang 2008-03-06 08:32:56 +00:00
parent e951d84584
commit 533994e5ea
27 changed files with 43 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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é

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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