summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-08-24 13:21:50 +0000
committerGo MAEDA <maeda@farend.jp>2022-08-24 13:21:50 +0000
commitf8033a069f99fd9947f05c2f4076bd8f0f575f98 (patch)
tree78d2330db21ecf052a618bf47324047183dc4fb6 /app/controllers
parent35b2d6a244803a4f0a767a5ff5bcb9137a1d60c4 (diff)
downloadredmine-f8033a069f99fd9947f05c2f4076bd8f0f575f98.tar.gz
redmine-f8033a069f99fd9947f05c2f4076bd8f0f575f98.zip
Use query name as the file name when exporting queries (#16207).
Patch by Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@21773 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/issues_controller.rb4
-rw-r--r--app/controllers/timelog_controller.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 5d67cd8cc..683dbc1e8 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -74,11 +74,11 @@ class IssuesController < ApplicationController
format.csv do
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
send_data(query_to_csv(@issues, @query, params[:csv]),
- :type => 'text/csv; header=present', :filename => 'issues.csv')
+ :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'issues')}.csv")
end
format.pdf do
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
- send_file_headers! :type => 'application/pdf', :filename => 'issues.pdf'
+ send_file_headers! :type => 'application/pdf', :filename => "#{filename_for_export(@query, 'issues')}.pdf"
end
end
else
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index c0570c304..d47687f1b 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -67,7 +67,7 @@ class TimelogController < ApplicationController
format.csv do
# Export all entries
@entries = scope.to_a
- send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'timelog.csv')
+ send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => "#{filename_for_export(@query, 'timelog')}.csv")
end
end
end