diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb old mode 100644 new mode 100755 index 4b35cd8..ce0fb9c --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -48,10 +48,10 @@ class SearchController < ApplicationController nil when 'my_projects' User.current.projects - when 'subprojects' - @project ? (@project.self_and_descendants.active.to_a) : nil - else + when 'project' @project + else + @project ? (@project.self_and_descendants.active.to_a) : nil end @object_types = Redmine::Search.available_search_types.dup diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb old mode 100644 new mode 100755 index 2554cf9..84a4f92 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -46,8 +46,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.descendants.active.empty? - options << [@project.name, ''] unless @project.nil? + options << [l(:label_and_its_subprojects, @project.name), ''] unless @project.nil? || @project.descendants.active.empty? + options << [@project.name, 'project'] unless @project.nil? label_tag("scope", l(:description_project_scope), :class => "hidden-for-sighted") + select_tag('scope', options_for_select(options, params[:scope].to_s)) if options.size > 1 end @@ -63,7 +63,7 @@ module SearchHelper :all_words => params[:all_words], :scope => params[:scope], t => 1) end ('