diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index aebc82b14..f74a46e93 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -127,6 +127,10 @@ class UsersController < ApplicationController @issues_author_count = Issue.where("author_id =? and subject like ?", @user.id, "%#{@subject}%").count @issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count @issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count + + # 导出excel的issues + @excel_issues = @issues + @issue_count = @issues.count @limit = 10 @is_remote = true @@ -135,6 +139,10 @@ class UsersController < ApplicationController @issues = paginateHelper @issues, @limit respond_to do |format| format.html{render :layout => 'static_base'} + format.xls{ + filename = "我的_#{l(:label_issue_list_xls)}.xls" + send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } format.api format.js end diff --git a/app/views/users/_all_issue_list.html.erb b/app/views/users/_all_issue_list.html.erb index cc33fc95d..6ddb571aa 100644 --- a/app/views/users/_all_issue_list.html.erb +++ b/app/views/users/_all_issue_list.html.erb @@ -10,7 +10,8 @@
<%= l(:label_no_data) %>
<% else %>