summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-13 08:01:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-13 08:01:55 +0000
commitd09b08046343d5fcd6a15024fdc8f48e73c9d064 (patch)
tree81c02c16bc6c0426722fae22d6900458d62463aa /app
parent985634ef9e647fc48a07241924b9e2586e448cb4 (diff)
downloadredmine-d09b08046343d5fcd6a15024fdc8f48e73c9d064.tar.gz
redmine-d09b08046343d5fcd6a15024fdc8f48e73c9d064.zip
Merged r15202 (#22108).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15226 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/queries_helper.rb30
-rw-r--r--app/views/issues/index.html.erb6
2 files changed, 34 insertions, 2 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 9ad2540e4..6714562ba 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -243,4 +243,34 @@ module QueriesHelper
@query
end
end
+
+ # Returns the query definition as hidden field tags
+ def query_as_hidden_field_tags(query)
+ tags = hidden_field_tag("set_filter", "1", :id => nil)
+
+ if query.filters.present?
+ query.filters.each do |field, filter|
+ tags << hidden_field_tag("f[]", field, :id => nil)
+ tags << hidden_field_tag("op[#{field}]", filter[:operator], :id => nil)
+ filter[:values].each do |value|
+ tags << hidden_field_tag("v[#{field}][]", value, :id => nil)
+ end
+ end
+ end
+ if query.column_names.present?
+ query.column_names.each do |name|
+ tags << hidden_field_tag("c[]", name, :id => nil)
+ end
+ end
+ if query.totalable_names.present?
+ query.totalable_names.each do |name|
+ tags << hidden_field_tag("t[]", name, :id => nil)
+ end
+ end
+ if query.group_by.present?
+ tags << hidden_field_tag("group_by", query.group_by, :id => nil)
+ end
+
+ tags
+ end
end
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index 8310dc73e..7cc2811f9 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -76,8 +76,10 @@
<% end %>
<div id="csv-export-options" style="display:none;">
- <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 %>
+ <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) %>
+ <%= hidden_field_tag 'sort', params[:sort], :id => nil %>
<p>
<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>