Ability to search a project and its subprojects (#1264).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1439 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
94dbf641ff
commit
b0be3b95aa
29 files changed
+39
-2
No files matched your search
@@ -30,11 +30,13 @@ class SearchController < ApplicationController
|
||||
@titles_only = !params[:titles_only].nil?
|
||||
|
||||
projects_to_search =
|
||||
case params[:projects]
|
||||
case params[:scope]
|
||||
when 'all'
|
||||
nil
|
||||
when 'my_projects'
|
||||
User.current.memberships.collect(&:project)
|
||||
when 'subprojects'
|
||||
@project ? ([ @project ] + @project.active_children) : nil
|
||||
else
|
||||
@project
|
||||
end
|
||||
|
||||
@@ -39,7 +39,8 @@ module SearchHelper
|
||||
def project_select_tag
|
||||
options = [[l(:label_project_all), 'all']]
|
||||
options << [l(:label_my_projects), 'my_projects'] unless User.current.memberships.empty?
|
||||
options << [l(:label_and_its_subprojects, @project.name), 'subprojects'] unless @project.nil? || @project.active_children.empty?
|
||||
options << [@project.name, ''] unless @project.nil?
|
||||
select_tag('projects', options_for_select(options, params[:projects].to_s)) if options.size > 1
|
||||
select_tag('scope', options_for_select(options, params[:scope].to_s)) if options.size > 1
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user