From: Jean-Philippe Lang Date: Wed, 7 Jun 2017 20:50:17 +0000 (+0000) Subject: Search in project and its subprojects by default (#9909). X-Git-Tag: 3.4.0~61 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=744fc25c8bf6012411ffbef3c64361d6f2d425ed;p=redmine.git Search in project and its subprojects by default (#9909). git-svn-id: http://svn.redmine.org/redmine/trunk@16641 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 616356a07..4915cddad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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? diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 126d86b41..4cdefbd47 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -75,6 +75,7 @@ <% if User.current.logged? || !Setting.login_required? %>