summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb17
-rw-r--r--app/helpers/queries_helper.rb2
-rw-r--r--app/views/issues/index.html.erb1
-rw-r--r--app/views/projects/_list.html.erb1
-rw-r--r--app/views/reports/_details.html.erb1
-rw-r--r--app/views/roles/permissions.html.erb1
-rw-r--r--app/views/timelog/index.html.erb1
-rw-r--r--app/views/timelog/report.html.erb1
-rw-r--r--app/views/users/index.html.erb1
9 files changed, 25 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 3177d0eb7..a1d989e25 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1805,6 +1805,23 @@ module ApplicationHelper
end
end
+ def export_csv_separator_select_tag
+ options = [[l(:label_comma_char), ','], [l(:label_semi_colon_char), ';']]
+ # Add the separator from translations if it is missing
+ general_csv_separator = l(:general_csv_separator)
+ unless options.index { |option| option.last == general_csv_separator }
+ options << Array.new(2, general_csv_separator)
+ end
+ content_tag(:p) do
+ concat(
+ content_tag(:label) do
+ concat l(:label_fields_separator) + ' '
+ concat select_tag('field_separator', options_for_select(options, general_csv_separator))
+ end
+ )
+ end
+ end
+
# Returns an array of error messages for bulk edited items (issues, time entries)
def bulk_edit_error_messages(items)
messages = {}
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 662e22ee8..b90f86457 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -323,7 +323,7 @@ module QueriesHelper
def query_to_csv(items, query, options={})
columns = query.columns
- Redmine::Export::CSV.generate(:encoding => params[:encoding]) do |csv|
+ Redmine::Export::CSV.generate(encoding: params[:encoding], field_separator: params[:field_separator]) do |csv|
# csv header fields
csv << columns.map {|c| c.caption.to_s}
# csv lines
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index 3e0d0cfe8..997a64e55 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -59,6 +59,7 @@
</fieldset>
<% end %>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_select_tag %>
<% if @issue_count > Setting.issues_export_limit.to_i %>
<p class="icon icon-warning">
<%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %>
diff --git a/app/views/projects/_list.html.erb b/app/views/projects/_list.html.erb
index 4c592247c..1bc8d4687 100644
--- a/app/views/projects/_list.html.erb
+++ b/app/views/projects/_list.html.erb
@@ -66,6 +66,7 @@
<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
</p>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_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);" %>
diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb
index 0bfb0f8f2..ab660bc16 100644
--- a/app/views/reports/_details.html.erb
+++ b/app/views/reports/_details.html.erb
@@ -32,6 +32,7 @@
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(project_issues_report_details_path(@project, :detail => params[:detail], :format => 'csv'), :method => :get, :id => 'csv-export-form') do %>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_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);' %>
diff --git a/app/views/roles/permissions.html.erb b/app/views/roles/permissions.html.erb
index d91dd933d..b70e2109b 100644
--- a/app/views/roles/permissions.html.erb
+++ b/app/views/roles/permissions.html.erb
@@ -92,6 +92,7 @@
<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 %>
+ <%= export_csv_separator_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);' %>
diff --git a/app/views/timelog/index.html.erb b/app/views/timelog/index.html.erb
index e957b41b3..a045e4743 100644
--- a/app/views/timelog/index.html.erb
+++ b/app/views/timelog/index.html.erb
@@ -52,6 +52,7 @@
</fieldset>
<% end %>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_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);" %>
diff --git a/app/views/timelog/report.html.erb b/app/views/timelog/report.html.erb
index ee6f0f83b..e0e80cd0e 100644
--- a/app/views/timelog/report.html.erb
+++ b/app/views/timelog/report.html.erb
@@ -72,6 +72,7 @@
<div id="csv-export-options" style="display: none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_select_tag %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :id => 'csv-export-button' %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => 'hideModal(this);', :type => 'button' %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index f5c8a1cd1..d609bfd78 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -45,6 +45,7 @@
</fieldset>
<% end %>
<%= export_csv_encoding_select_tag %>
+ <%= export_csv_separator_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);" %>