diff options
author | Go MAEDA <maeda@farend.jp> | 2021-03-18 15:58:18 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-03-18 15:58:18 +0000 |
commit | 280e95b825d9adbcdb3d400e7eb5397f62e881e9 (patch) | |
tree | 4540af5f67a7ebc3785155e473560cd818fe6789 | |
parent | 77e199e817d841c65bab8405056ad4b71c19062e (diff) | |
download | redmine-280e95b825d9adbcdb3d400e7eb5397f62e881e9.tar.gz redmine-280e95b825d9adbcdb3d400e7eb5397f62e881e9.zip |
Allow selecting encoding when exporting permission reports as CSV (#13767).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@20824 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/roles_helper.rb | 2 | ||||
-rw-r--r-- | app/views/roles/permissions.html.erb | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/helpers/roles_helper.rb b/app/helpers/roles_helper.rb index 6c84138c4..f7f62ef19 100644 --- a/app/helpers/roles_helper.rb +++ b/app/helpers/roles_helper.rb @@ -21,7 +21,7 @@ module RolesHelper include ApplicationHelper def permissions_to_csv(roles, permissions) - Redmine::Export::CSV.generate do |csv| + Redmine::Export::CSV.generate(:encoding => params[:encoding]) do |csv| # csv header fields headers = [l(:field_cvs_module), l(:label_permissions)] + roles.collect(&:name) csv << headers diff --git a/app/views/roles/permissions.html.erb b/app/views/roles/permissions.html.erb index ffdf28b54..9f1c9dae2 100644 --- a/app/views/roles/permissions.html.erb +++ b/app/views/roles/permissions.html.erb @@ -86,5 +86,15 @@ <p><%= submit_tag l(:button_save) %></p> <% end %> <% other_formats_links do |f| %> - <%= f.link_to 'CSV' %> + <%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '330px'); return false;" %> <% end %> +<div id="csv-export-options" style="display: none;"> + <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3> + <%= form_tag(permissions_roles_path(:format => 'csv'), :method => :get, :id => 'csv-export-form') do %> + <%= export_csv_encoding_select_tag %> + <p class="buttons"> + <%= submit_tag l(:button_export), :name => nil, :onclick => 'hideModal(this);', :data => {:disable_with => false} %> + <%= link_to_function l(:button_cancel), 'hideModal(this);' %> + </p> + <% end %> +</div> |