Project

General



Profile

« Previous | Next » 

Revision 933

Added custom fields marked as "For all projects" to the csv export of the cross project issue list.

View differences:

trunk/app/helpers/issues_helper.rb
125 125
                  l(:field_created_on),
126 126
                  l(:field_updated_on)
127 127
                  ]
128
      # only export custom fields if project is given
129
      for custom_field in project.all_custom_fields
130
        headers << custom_field.name
131
      end if project
128
      # Export project custom fields if project is given
129
      # otherwise export custom fields marked as "For all projects"
130
      custom_fields = project.nil? ? IssueCustomField.for_all : project.all_custom_fields
131
      custom_fields.each {|f| headers << f.name}
132 132
      csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
133 133
      # csv lines
134 134
      issues.each do |issue|
......
148 148
                  l_datetime(issue.created_on),  
149 149
                  l_datetime(issue.updated_on)
150 150
                  ]
151
        for custom_field in project.all_custom_fields
152
          fields << (show_value issue.custom_value_for(custom_field))
153
        end if project
151
        custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
154 152
        csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
155 153
      end
156 154
    end

Also available in: Unified diff