From: Jean-Philippe Lang Date: Wed, 3 Apr 2013 16:48:28 +0000 (+0000) Subject: Fixed that CSV Export of Spent Time ignores filters and columns selection (#13618). X-Git-Tag: 2.4.0~485 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=25209273d33de5d690b0c89b4a462b979bfd4324;p=redmine.git Fixed that CSV Export of Spent Time ignores filters and columns selection (#13618). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11696 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 592bba42a..2de6b0c90 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -29,6 +29,30 @@ module QueriesHelper end end + def query_filters_hidden_tags(query) + tags = ''.html_safe + query.filters.each do |field, options| + tags << hidden_field_tag("f[]", field, :id => nil) + tags << hidden_field_tag("op[#{field}]", options[:operator], :id => nil) + options[:values].each do |value| + tags << hidden_field_tag("v[#{field}][]", value, :id => nil) + end + end + tags + end + + def query_columns_hidden_tags(query) + tags = ''.html_safe + query.columns.each do |column| + tags << hidden_field_tag("c[]", column.name, :id => nil) + end + tags + end + + def query_hidden_tags(query) + query_filters_hidden_tags(query) + query_columns_hidden_tags(query) + end + def available_block_columns_tags(query) tags = ''.html_safe query.available_block_columns.each do |column| diff --git a/app/views/timelog/index.html.erb b/app/views/timelog/index.html.erb index 35ddf8121..fa0c20ff3 100644 --- a/app/views/timelog/index.html.erb +++ b/app/views/timelog/index.html.erb @@ -27,7 +27,8 @@