From 744fc25c8bf6012411ffbef3c64361d6f2d425ed Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 7 Jun 2017 20:50:17 +0000 Subject: [PATCH] Search in project and its subprojects by default (#9909). git-svn-id: http://svn.redmine.org/redmine/trunk@16641 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 8 ++++++++ app/views/layouts/base.html.erb | 1 + 2 files changed, 9 insertions(+) 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? %>