summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/search_controller.rb4
-rw-r--r--app/helpers/search_helper.rb3
-rw-r--r--lang/bg.yml1
-rw-r--r--lang/cs.yml1
-rw-r--r--lang/da.yml1
-rw-r--r--lang/de.yml1
-rw-r--r--lang/en.yml1
-rw-r--r--lang/es.yml1
-rw-r--r--lang/fi.yml1
-rw-r--r--lang/fr.yml1
-rw-r--r--lang/he.yml1
-rw-r--r--lang/it.yml1
-rw-r--r--lang/ja.yml1
-rw-r--r--lang/ko.yml1
-rw-r--r--lang/lt.yml1
-rw-r--r--lang/nl.yml1
-rw-r--r--lang/no.yml1
-rw-r--r--lang/pl.yml1
-rw-r--r--lang/pt-br.yml1
-rw-r--r--lang/pt.yml1
-rw-r--r--lang/ro.yml1
-rw-r--r--lang/ru.yml1
-rw-r--r--lang/sr.yml1
-rw-r--r--lang/sv.yml1
-rw-r--r--lang/th.yml1
-rw-r--r--lang/uk.yml1
-rw-r--r--lang/zh-tw.yml1
-rw-r--r--lang/zh.yml1
-rw-r--r--test/functional/search_controller_test.rb8
29 files changed, 39 insertions, 2 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index d93c63808..d4ef01bf8 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -30,11 +30,13 @@ class SearchController < ApplicationController
@titles_only = !params[:titles_only].nil?
projects_to_search =
- case params[:projects]
+ case params[:scope]
when 'all'
nil
when 'my_projects'
User.current.memberships.collect(&:project)
+ when 'subprojects'
+ @project ? ([ @project ] + @project.active_children) : nil
else
@project
end
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 6b5a2cede..d6a2fb949 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -39,7 +39,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.active_children.empty?
options << [@project.name, ''] unless @project.nil?
- select_tag('projects', options_for_select(options, params[:projects].to_s)) if options.size > 1
+ select_tag('scope', options_for_select(options, params[:scope].to_s)) if options.size > 1
end
end
diff --git a/lang/bg.yml b/lang/bg.yml
index b341d989f..224177d94 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: Новите проекти са публичн
error_scm_annotate: "Обектът не съществува или не може да бъде анотиран."
label_planning: Планиране
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/cs.yml b/lang/cs.yml
index 250c602c2..2126553fc 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -623,3 +623,4 @@ enumeration_activities: Aktivity (sledování času)
error_scm_annotate: "Položka neexistuje nebo nemůže být komentována."
label_planning: Plánování
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/da.yml b/lang/da.yml
index ff2ed982d..3b5ca07d3 100644
--- a/lang/da.yml
+++ b/lang/da.yml
@@ -620,3 +620,4 @@ setting_default_projects_public: Nye projekter er offentlige som default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planlægning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/de.yml b/lang/de.yml
index 77184cf88..273bad277 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -619,3 +619,4 @@ enumeration_issue_priorities: Ticket-Prioritäten
enumeration_doc_categories: Dokumentenkategorien
enumeration_activities: Aktivitäten (Zeiterfassung)
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/en.yml b/lang/en.yml
index e39aec301..892a63a1b 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -291,6 +291,7 @@ label_auth_source: Authentication mode
label_auth_source_new: New authentication mode
label_auth_source_plural: Authentication modes
label_subproject_plural: Subprojects
+label_and_its_subprojects: %s and its subprojects
label_min_max_length: Min - Max length
label_list: List
label_date: Date
diff --git a/lang/es.yml b/lang/es.yml
index c6eef021a..26009d716 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -621,3 +621,4 @@ setting_default_projects_public: Los proyectos nuevos son públicos por defecto
error_scm_annotate: "No existe la entrada o no ha podido ser anotada"
label_planning: Planificación
text_subprojects_destroy_warning: 'Sus subprojectos: %s también se eliminarán'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/fi.yml b/lang/fi.yml
index 1a614a16c..908ef1283 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -618,3 +618,4 @@ label_overall_activity: Kokonaishistoria
error_scm_annotate: "Merkintää ei ole tai siihen ei voi lisätä selityksiä."
label_planning: Suunnittelu
text_subprojects_destroy_warning: 'Tämän alaprojekti(t): %s tullaan myös poistamaan.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/fr.yml b/lang/fr.yml
index cbdda4f3d..8827edd5e 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -291,6 +291,7 @@ label_auth_source: Mode d'authentification
label_auth_source_new: Nouveau mode d'authentification
label_auth_source_plural: Modes d'authentification
label_subproject_plural: Sous-projets
+label_and_its_subprojects: %s et ses sous-projets
label_min_max_length: Longueurs mini - maxi
label_list: Liste
label_date: Date
diff --git a/lang/he.yml b/lang/he.yml
index a611c8c39..71bc5e5b3 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: פרויקטים חדשים הינם פומבי
error_scm_annotate: "הכניסה לא קיימת או שלא ניתן לתאר אותה."
label_planning: תכנון
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/it.yml b/lang/it.yml
index 3d1dea09e..1771e1bda 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/ja.yml b/lang/ja.yml
index 680d29836..84f27a2eb 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -619,3 +619,4 @@ setting_default_projects_public: デフォルトで新しいプロジェクト
error_scm_annotate: "エントリが存在しない、もしくはアノテートできません。"
label_planning: 計画
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/ko.yml b/lang/ko.yml
index 4281f3881..ee94c4025 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/lt.yml b/lang/lt.yml
index df7cd960b..a58835186 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -619,3 +619,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/nl.yml b/lang/nl.yml
index e487a7a6d..01755137a 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -619,3 +619,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/no.yml b/lang/no.yml
index ccfa5c99f..388e51dd7 100644
--- a/lang/no.yml
+++ b/lang/no.yml
@@ -619,3 +619,4 @@ default_activity_development: Utvikling
enumeration_issue_priorities: Sakssprioriteringer
enumeration_doc_categories: Dokument-kategorier
enumeration_activities: Aktiviteter (tidssporing)
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/pl.yml b/lang/pl.yml
index cf101811a..bc65b6253 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: Nowe projekty są domyślnie publiczne
error_scm_annotate: "Wpis nie istnieje lub nie można do niego dodawać adnotacji."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 9facd8d19..b1f8d2055 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/pt.yml b/lang/pt.yml
index 6f51c8ed2..9d0586775 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/ro.yml b/lang/ro.yml
index 59edfeb70..01127f5c5 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -618,3 +618,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/ru.yml b/lang/ru.yml
index f69009847..4f0a4bb7b 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -622,3 +622,4 @@ setting_default_projects_public: Новые проекты являются пу
error_scm_annotate: "Данные отсутствуют или не могут быть подписаны."
label_planning: Планирование
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/sr.yml b/lang/sr.yml
index d9869c362..263bd1187 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -619,3 +619,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/sv.yml b/lang/sv.yml
index c0f691230..5b0c57acf 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -619,3 +619,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/th.yml b/lang/th.yml
index 2c506c664..643ee01c6 100644
--- a/lang/th.yml
+++ b/lang/th.yml
@@ -621,3 +621,4 @@ default_activity_development: พัฒนา
enumeration_issue_priorities: ความสำคัญของปัญหา
enumeration_doc_categories: ประเภทเอกสาร
enumeration_activities: กิจกรรม (ใช้ในการติดตามเวลา)
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/uk.yml b/lang/uk.yml
index a52a05603..e61fc5b38 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -620,3 +620,4 @@ setting_default_projects_public: New projects are public by default
error_scm_annotate: "The entry does not exist or can not be annotated."
label_planning: Planning
text_subprojects_destroy_warning: 'Its subproject(s): %s will be also deleted.'
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index d91c9708d..b52446917 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -619,3 +619,4 @@ default_activity_development: 開發
enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
+label_and_its_subprojects: %s and its subprojects
diff --git a/lang/zh.yml b/lang/zh.yml
index c8b809764..808dd1b39 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -619,3 +619,4 @@ default_activity_development: 开发
enumeration_issue_priorities: 问题优先级
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
+label_and_its_subprojects: %s and its subprojects
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index b02f07793..1c505620b 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -37,6 +37,14 @@ class SearchControllerTest < Test::Unit::TestCase
assert assigns(:results).include?(Changeset.find(101))
end
+ def test_search_project_and_subprojects
+ get :index, :id => 1, :q => 'recipe subproject', :scope => 'subprojects', :submit => 'Search'
+ assert_response :success
+ assert_template 'index'
+ assert assigns(:results).include?(Issue.find(1))
+ assert assigns(:results).include?(Issue.find(5))
+ end
+
def test_search_without_searchable_custom_fields
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"