summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-22 15:20:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-22 15:20:59 +0000
commitb025b63111089a5048f4fef5af30c98c0de26b8a (patch)
tree5bd3a7140207bb3d673f48be022d74c9e513fede /app/models/query.rb
parentb14aa23c8cf2cb35b863cbd41fc6c0d1286161aa (diff)
downloadredmine-b025b63111089a5048f4fef5af30c98c0de26b8a.tar.gz
redmine-b025b63111089a5048f4fef5af30c98c0de26b8a.zip
Hide 'Target version' filter if no version is defined.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1575 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index c19bb8d7e..77893bcf8 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -168,7 +168,9 @@ class Query < ActiveRecord::Base
if project
# project specific filters
@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.versions.empty?
+ @available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.sort.collect{|s| [s.name, s.id.to_s] } }
+ end
unless @project.active_children.empty?
@available_filters["subproject_id"] = { :type => :list_subprojects, :order => 13, :values => @project.active_children.collect{|s| [s.name, s.id.to_s] } }
end