1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 01:11:12 +00:00

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
This commit is contained in:
Go MAEDA 2021-03-18 15:58:18 +00:00
parent 77e199e817
commit 280e95b825
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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>