Ability to search all projects or the projects the user belongs to (#791).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1435 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-05-18 16:15:22 +00:00
parent 1907c31138
commit 073818f8bc
14 changed files with 96 additions and 59 deletions
+5 -1
View File
@@ -46,7 +46,7 @@ class Project < ActiveRecord::Base
acts_as_tree :order => "name", :counter_cache => true
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
@@ -202,6 +202,10 @@ class Project < ActiveRecord::Base
@all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
end
def project
self
end
def <=>(project)
name.downcase <=> project.name.downcase
end