From f8fd3d79a0f0b36c8299dfda501e0f1d21542513 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 22 Sep 2016 17:40:58 +0800 Subject: [PATCH] =?UTF-8?q?issue=E5=88=97=E8=A1=A8=20=E6=96=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9A=84=E5=AF=BC=E5=87=BAexcel=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- app/controllers/issues_controller.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e449061f7..76808a392 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -701,7 +701,7 @@ class ApplicationController < ActionController::Base sheet1[count_row,2] = issue.subject sheet1[count_row,3] = issue.description sheet1[count_row,4] = issue_status_change(issue.status_id) - sheet1[count_row,5] = issue.assigned_to.show_name + sheet1[count_row,5] = issue.assigned_to.try(:show_name) sheet1[count_row,6] = issue_priority_change(issue.priority_id) sheet1[count_row,7] = issue.author.show_name sheet1[count_row,8] = issue.created_on diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 820b1d7ac..bdcef99c2 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -86,11 +86,7 @@ class IssuesController < ApplicationController # @issue_pages = Paginator.new @issue_count, @limit, params['page'] # params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 # @offset ||= @issue_pages.offset - @issues_filter = @query.issues - # (:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - # :order => 'issues.updated_on desc', - # :offset => @offset, - # :limit => @limit) + @issues_filter = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], :order => 'issues.updated_on desc') @limit = 10 @is_remote = true @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @@ -109,7 +105,7 @@ class IssuesController < ApplicationController format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" - send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) } end else