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