summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-10-19 11:43:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-10-19 11:43:23 +0000
commit95188f26c3f47f110c6d928e5df0b108802032b3 (patch)
tree87c6eb46833289a4d8cfbe921060b34c75393949 /app
parent45f039187df03e8925cb0d08ccc1838c9ea2d5c2 (diff)
downloadredmine-95188f26c3f47f110c6d928e5df0b108802032b3.tar.gz
redmine-95188f26c3f47f110c6d928e5df0b108802032b3.zip
Set default columns for the projects list (#29482).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18766 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb2
-rw-r--r--app/models/project_query.rb2
-rw-r--r--app/views/settings/_projects.html.erb8
3 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index b9bda6b43..2e4fc5303 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -274,6 +274,6 @@ class ProjectsController < ApplicationController
end
def retrieve_project_query
- retrieve_query(ProjectQuery, false)
+ retrieve_query(ProjectQuery, false, :defaults => @default_columns_names)
end
end
diff --git a/app/models/project_query.rb b/app/models/project_query.rb
index ecf3e687b..c0e0e92e7 100644
--- a/app/models/project_query.rb
+++ b/app/models/project_query.rb
@@ -69,7 +69,7 @@ class ProjectQuery < Query
end
def default_columns_names
- @default_columns_names ||= [:name, :identifier, :short_description]
+ @default_columns_names = Setting.project_list_defaults.symbolize_keys[:column_names].map(&:to_sym)
end
def default_sort_criteria
diff --git a/app/views/settings/_projects.html.erb b/app/views/settings/_projects.html.erb
index fd9ea1b76..230e2803e 100644
--- a/app/views/settings/_projects.html.erb
+++ b/app/views/settings/_projects.html.erb
@@ -16,5 +16,13 @@
:blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %></p>
</div>
+<fieldset class="box">
+ <legend><%= l(:setting_project_list_defaults) %></legend>
+ <% query = ProjectQuery.new(Setting.project_list_defaults) %>
+ <%= render_query_columns_selection(query,
+ :name => 'settings[project_list_defaults][column_names]') %>
+</fieldset>
+
+
<%= submit_tag l(:button_save) %>
<% end %>