]> source.dussan.org Git - redmine.git/commitdiff
Hide 'Target version' filter if no version is defined.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 22 Jun 2008 15:20:59 +0000 (15:20 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 22 Jun 2008 15:20:59 +0000 (15:20 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1575 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index c19bb8d7e29f7a4f4d3def5dcfc8037a7e8780a7..77893bcf814378decaf4f9eecf7e1e4f899a1779 100644 (file)
@@ -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