Do not use instance variable.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7897 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-23 18:32:21 +00:00
parent a756103b10
commit 2081730f42
1 changed files with 6 additions and 6 deletions

View File

@ -266,21 +266,21 @@ class Query < ActiveRecord::Base
if project
# project specific filters
categories = @project.issue_categories.all
categories = project.issue_categories.all
unless categories.empty?
@available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => categories.collect{|s| [s.name, s.id.to_s] } }
end
versions = @project.shared_versions.all
versions = project.shared_versions.all
unless versions.empty?
@available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => versions.sort.collect{|s| ["#{s.project.name} - #{s.name}", s.id.to_s] } }
end
unless @project.leaf?
subprojects = @project.descendants.visible.all
unless project.leaf?
subprojects = project.descendants.visible.all
unless subprojects.empty?
@available_filters["subproject_id"] = { :type => :list_subprojects, :order => 13, :values => subprojects.collect{|s| [s.name, s.id.to_s] } }
end
end
add_custom_fields_filters(@project.all_issue_custom_fields)
add_custom_fields_filters(project.all_issue_custom_fields)
else
# global filters for cross project issue list
system_shared_versions = Version.visible.find_all_by_sharing('system')
@ -460,7 +460,7 @@ class Query < ActiveRecord::Base
def project_statement
project_clauses = []
if project && !@project.descendants.active.empty?
if project && !project.descendants.active.empty?
ids = [project.id]
if has_filter?("subproject_id")
case operator_for("subproject_id")