Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
}
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
- format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
+ format.csv { send_data(query_to_csv(@issues, @query, params[:csv]), :type => 'text/csv; header=present', :filename => 'issues.csv') }
format.pdf { send_file_headers! :type => 'application/pdf', :filename => 'issues.pdf' }
end
else
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %>
<p>
- <label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br />
- <label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label>
+ <label><%= radio_button_tag 'csv[columns]', '', true %> <%= l(:description_selected_columns) %></label><br />
+ <label><%= radio_button_tag 'csv[columns]', 'all' %> <%= l(:description_all_columns) %></label>
</p>
<p>
- <label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
+ <label><%= check_box_tag 'csv[description]', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
</p>
<% if @issue_count > Setting.issues_export_limit.to_i %>
<p class="icon icon-warning">
Issue.generate!(:description => 'test_index_csv_with_description')
with_settings :default_language => 'en' do
- get :index, :format => 'csv', :description => '1'
+ get :index, :format => 'csv', :csv => {:description => '1'}
assert_response :success
assert_not_nil assigns(:issues)
end
end
def test_index_csv_with_all_columns
- get :index, :format => 'csv', :columns => 'all'
+ get :index, :format => 'csv', :csv => {:columns => 'all'}
assert_response :success
assert_not_nil assigns(:issues)
assert_equal 'text/csv; header=present', @response.content_type
issue.custom_field_values = {1 => ['MySQL', 'Oracle']}
issue.save!
- get :index, :format => 'csv', :columns => 'all'
+ get :index, :format => 'csv', :csv => {:columns => 'all'}
assert_response :success
lines = @response.body.chomp.split("\n")
assert lines.detect {|line| line.include?('"MySQL, Oracle"')}
issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {field.id => '185.6'})
with_settings :default_language => 'fr' do
- get :index, :format => 'csv', :columns => 'all'
+ get :index, :format => 'csv', :csv => {:columns => 'all'}
assert_response :success
issue_line = response.body.chomp.split("\n").map {|line| line.split(';')}.detect {|line| line[0]==issue.id.to_s}
assert_include '185,60', issue_line
end
with_settings :default_language => 'en' do
- get :index, :format => 'csv', :columns => 'all'
+ get :index, :format => 'csv', :csv => {:columns => 'all'}
assert_response :success
issue_line = response.body.chomp.split("\n").map {|line| line.split(',')}.detect {|line| line[0]==issue.id.to_s}
assert_include '185.60', issue_line