summaryrefslogtreecommitdiffstats
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-08-05 12:30:40 +0000
committerGo MAEDA <maeda@farend.jp>2018-08-05 12:30:40 +0000
commit83939be2b52c07cbb0d4dc6f784b979c10cc4229 (patch)
tree281e118c9b751c54787b601b96663b4fc919bee6 /app/controllers/users_controller.rb
parenteee1c36b4b7f0cee23ebc5d3848fa2b606f603c8 (diff)
downloadredmine-83939be2b52c07cbb0d4dc6f784b979c10cc4229.tar.gz
redmine-83939be2b52c07cbb0d4dc6f784b979c10cc4229.zip
Export users list to CSV (#5957).
Contriubted by Mizuki ISHIKAWA and Yuki Kita. git-svn-id: http://svn.redmine.org/redmine/trunk@17463 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 04d9a78ad..aed4cd83f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -28,6 +28,7 @@ class UsersController < ApplicationController
include SortHelper
helper :custom_fields
include CustomFieldsHelper
+ include UsersHelper
helper :principal_memberships
helper :activities
include ActivitiesHelper
@@ -61,6 +62,9 @@ class UsersController < ApplicationController
@groups = Group.givable.sort
render :layout => !request.xhr?
}
+ format.csv {
+ send_data(users_to_csv(scope.order(sort_clause)), :type => 'text/csv; header=present', :filename => 'users.csv')
+ }
format.api
end
end