mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
Search in project and its subprojects by default (#9909).
git-svn-id: http://svn.redmine.org/redmine/trunk@16641 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
eb2d649e7e
commit
744fc25c8b
@ -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) %>:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user