summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-11-15 21:58:39 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-11-15 21:58:39 +0000
commit70f8ca64dd9337e40b551e0ab876273a742a7551 (patch)
tree3a2c84965bcdf63d8c75aadd39612fb743e012a2 /app/controllers
parent9def0fa3d06cebf49e306d9eadfcc97745087a9e (diff)
downloadredmine-70f8ca64dd9337e40b551e0ab876273a742a7551.tar.gz
redmine-70f8ca64dd9337e40b551e0ab876273a742a7551.zip
You can configure default project queries in the following places (#35795):
* App-level: Administration > Projects > Default query (Projects list defaults section) * User-level: My account > Default project query git-svn-id: http://svn.redmine.org/redmine/trunk@21281 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 36f0261f9..6ec522dd5 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -51,6 +51,7 @@ class ProjectsController < ApplicationController
return
end
+ retrieve_default_query
retrieve_project_query
scope = project_scope
@@ -323,4 +324,19 @@ class ProjectsController < ApplicationController
def retrieve_project_query
retrieve_query(ProjectQuery, false, :defaults => @default_columns_names)
end
+
+ def retrieve_default_query
+ return if params[:query_id].present?
+ return if api_request?
+ return if params[:set_filter] && (params.key?(:op) || params.key?(:f))
+
+ if params[:without_default].present?
+ params[:set_filter] = 1
+ return
+ end
+
+ if default_query = ProjectQuery.default
+ params[:query_id] = default_query.id
+ end
+ end
end