Commit af0cc628 authored by jplang's avatar jplang
Browse files

Search in project and its subprojects by default (#9909).

git-svn-id: https://svn.redmine.org/redmine/trunk@16641 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 81490c37
......@@ -346,6 +346,14 @@ module ApplicationHelper
end
end
# Returns the default scope for the quick search form
# Could be 'all', 'my_projects', 'subprojects' or nil (current project)
def default_search_project_scope
if @project && !@project.leaf?
'subprojects'
end
end
# Returns an array of projects that are displayed in the quick-jump box
def projects_for_jump_box(user=User.current)
if user.logged?
......
......@@ -75,6 +75,7 @@
<% if User.current.logged? || !Setting.login_required? %>
<div id="quick-search">
<%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
<%= hidden_field_tag 'scope', default_search_project_scope, :id => nil %>
<%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
<label for='q'>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment