diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-27 17:42:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-27 17:42:04 +0000 |
commit | 413247ee5b1643dff7923687711c77a5d90d41f5 (patch) | |
tree | 3ab2e5d182fee99cbb145f1783732db5bb46e7bc /app/models/query.rb | |
parent | 70374d084e19dba21e83e8a360a62ff0168ff207 (diff) | |
download | redmine-413247ee5b1643dff7923687711c77a5d90d41f5.tar.gz redmine-413247ee5b1643dff7923687711c77a5d90d41f5.zip |
Added the ability to archive projects:
* Only administrators can archive/unarchive projects.
* Once archived, the project is visible on the admin project listing only. It doesn't show up anywhere else in the app. Subprojects are also archived.
* Archive/unarchive preserve everything on the project (issues, members, ...).
* A subproject can not be unarchived if its parent project is archived.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@549 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r-- | app/models/query.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 47468ba12..145ff851a 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -95,8 +95,8 @@ class Query < ActiveRecord::Base @available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } @available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } } @available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.sort.collect{|s| [s.name, s.id.to_s] } } - unless @project.children.empty? - @available_filters["subproject_id"] = { :type => :list_one_or_more, :order => 13, :values => @project.children.collect{|s| [s.name, s.id.to_s] } } + unless @project.active_children.empty? + @available_filters["subproject_id"] = { :type => :list_one_or_more, :order => 13, :values => @project.active_children.collect{|s| [s.name, s.id.to_s] } } end @project.all_custom_fields.select(&:is_filter?).each do |field| case field.field_format @@ -164,7 +164,7 @@ class Query < ActiveRecord::Base if operator_for("subproject_id") == "=" subproject_ids = values_for("subproject_id").each(&:to_i) else - subproject_ids = project.children.collect{|p| p.id} + subproject_ids = project.active_children.collect{|p| p.id} end sql << " AND #{Issue.table_name}.project_id IN (%d,%s)" % [project.id, subproject_ids.join(",")] if project else |