summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-27 17:04:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-27 17:04:13 +0000
commitc383486d711d12a2a9e716bedf3a444e140c00d6 (patch)
tree6b4720681d463f5c98aee092c8a4c58de5e742ac
parent508b0bbb8edf1423160021db6a4844a0d957c476 (diff)
downloadredmine-c383486d711d12a2a9e716bedf3a444e140c00d6.tar.gz
redmine-c383486d711d12a2a9e716bedf3a444e140c00d6.zip
Added custom fields marked as "For all projects" to the csv export of the cross project issue list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@933 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/issues_helper.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index f9a88f6dd..4727fdf96 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -125,10 +125,10 @@ module IssuesHelper
l(:field_created_on),
l(:field_updated_on)
]
- # only export custom fields if project is given
- for custom_field in project.all_custom_fields
- headers << custom_field.name
- end if project
+ # Export project custom fields if project is given
+ # otherwise export custom fields marked as "For all projects"
+ custom_fields = project.nil? ? IssueCustomField.for_all : project.all_custom_fields
+ custom_fields.each {|f| headers << f.name}
csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
# csv lines
issues.each do |issue|
@@ -148,9 +148,7 @@ module IssuesHelper
l_datetime(issue.created_on),
l_datetime(issue.updated_on)
]
- for custom_field in project.all_custom_fields
- fields << (show_value issue.custom_value_for(custom_field))
- end if project
+ custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
end
end