# along with this program; if not, write to the Free Software\r
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
\r
+require 'csv'\r
+\r
class ProjectsController < ApplicationController\r
layout 'base'\r
before_filter :find_project, :authorize, :except => [ :index, :list, :add ]\r
render :action => 'list_issues' and return unless @query.valid?\r
\r
@issues = Issue.find :all, :order => sort_clause,\r
- :include => [ :author, :status, :tracker, :project, :custom_values ],\r
- :conditions => @query.statement \r
+ :include => [ :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],\r
+ :conditions => @query.statement\r
\r
ic = Iconv.new('ISO-8859-1', 'UTF-8') \r
export = StringIO.new\r
CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|\r
# csv header fields\r
- headers = [ "#", l(:field_status), l(:field_tracker), l(:field_subject), l(:field_author), l(:field_created_on), l(:field_updated_on) ]\r
+ headers = [ "#", l(:field_status), \r
+ l(:field_tracker),\r
+ l(:field_priority),\r
+ l(:field_subject),\r
+ l(:field_author),\r
+ l(:field_start_date),\r
+ l(:field_due_date),\r
+ l(:field_done_ratio),\r
+ l(:field_created_on),\r
+ l(:field_updated_on)\r
+ ]\r
for custom_field in @project.all_custom_fields\r
headers << custom_field.name\r
end \r
csv << headers.collect {|c| ic.iconv(c) }\r
# csv lines\r
@issues.each do |issue|\r
- fields = [issue.id, issue.status.name, issue.tracker.name, issue.subject, issue.author.display_name, l_datetime(issue.created_on), l_datetime(issue.updated_on)]\r
+ fields = [issue.id, issue.status.name, \r
+ issue.tracker.name, \r
+ issue.priority.name,\r
+ issue.subject, \r
+ issue.author.display_name,\r
+ issue.start_date ? l_date(issue.start_date) : nil,\r
+ issue.due_date ? l_date(issue.due_date) : nil,\r
+ issue.done_ratio,\r
+ l_datetime(issue.created_on), \r
+ l_datetime(issue.updated_on)\r
+ ]\r
for custom_field in @project.all_custom_fields\r
fields << (show_value issue.custom_value_for(custom_field))\r
end\r