Project

General

Profile

Patch #29830 » 0001-fix-Issue-CSV-export-options-checkboxes-have-no-effe.patch

Tobias Stenzel, 2018-10-22 22:21

View differences:

app/helpers/queries_helper.rb
end
# Returns the query definition as hidden field tags
def query_as_hidden_field_tags(query)
# columns in ignored_column_names are skipped (names as symbols)
def query_as_hidden_field_tags(query, ignored_column_names = [])
tags = hidden_field_tag("set_filter", "1", :id => nil)
if query.filters.present?
......
tags << hidden_field_tag("f[]", "", :id => nil)
end
query.columns.each do |column|
next if ignored_column_names.include?(column.name)
tags << hidden_field_tag("c[]", column.name, :id => nil)
end
if query.totalable_names.present?
app/views/issues/index.html.erb
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(_project_issues_path(@project, :format => 'csv'), :method => :get, :id => 'csv-export-form') do %>
<%= query_as_hidden_field_tags(@query) %>
<%= query_as_hidden_field_tags(@query, [:description, :last_notes]) %>
<p>
<label><%= radio_button_tag 'c[]', '', true %> <%= l(:description_selected_columns) %></label><br />
<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
(1-1/2)