<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
</p>
<p>
- <label><%= check_box_tag 'c[]', 'description', @query.has_column?(:description) %> <%= l(:field_description) %></label>
- <label><%= check_box_tag 'c[]', 'last_notes', @query.has_column?(:last_notes) %> <%= l(:label_last_notes) %></label>
+ <% @query.available_block_columns.each do |column| %>
+ <label><%= check_box_tag 'c[]', column.name, @query.has_column?(column) %> <%= column.caption %></label>
+ <% end %>
</p>
<%= export_csv_encoding_select_tag %>
<% if @issue_count > Setting.issues_export_limit.to_i %>
<label><%= radio_button_tag 'c[]', '', true %> <%= l(:description_selected_columns) %></label><br />
<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
</p>
+ <p>
+ <% @query.available_block_columns.each do |column| %>
+ <label><%= check_box_tag 'c[]', column.name, @query.has_column?(:column) %> <%= column.caption %></label>
+ <% end %>
+ </p>
<%= export_csv_encoding_select_tag %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %>
assert_select '#csv-export-form input[name=?][value=?]', 'f[]', ''
end
+ def test_index_should_show_block_columns_in_csv_export_form
+ field = IssueCustomField.
+ create!(
+ :name => 'Long text', :field_format => 'text',
+ :full_width_layout => '1',
+ :tracker_ids => [1], :is_for_all => true
+ )
+ get :index
+
+ assert_response :success
+ assert_select '#csv-export-form' do
+ assert_select 'input[value=?]', 'description'
+ assert_select 'input[value=?]', 'last_notes'
+ assert_select 'input[value=?]', "cf_#{field.id}"
+ end
+ end
+
def test_index_csv
get(:index, :params => {:format => 'csv'})
assert_response :success