diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 0eec8dbc8..1f8cdd275 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -50,7 +50,7 @@ class AdminController < ApplicationController cycle = params[:cycle] g = Gitlab.client users_results = [] - User.first(13).each do |user| + User.all.each do |user| unless user.mail.nil? user_mail = user.mail user.projects.where("gpid is not null").each do |project| diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d2a712f32..bd6c67f58 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -73,35 +73,16 @@ class RepositoriesController < ApplicationController def export_rep_static # 管理员界面导出所有项目 - if params[:cycle] == "admin_week" || params[:cycle] == "admin_month" || params[:cycle] == "admin_all" - if User.current.admin? - @project = Project.find(params[:id]) - gpid = @project.gpid - rev = params[:rev] - cycle = params[:cycle] - cycle_name = (params[:cycle] == "admin_week" ? "每周" : (params[:cycle] == "admin_month" ? "每月" : "所有")) - respond_to do |format| - format.html - format.xls{ - filename = "#{l(:label_user_rep_xls)}_#{l(:cycle_name)}_.xls" - send_data(admin_export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) - } - end - else - render_403 - end - else - @project = Project.find(params[:id]) - gpid = @project.gpid - rev = params[:rev] - cycle = params[:cycle] - respond_to do |format| - format.html - format.xls{ - filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls" - send_data(export_rep_xls(gpid, :rev => rev, :cycle => cycle), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) - } - end + @project = Project.find(params[:id]) + gpid = @project.gpid + rev = params[:rev] + cycle = params[:cycle] + respond_to do |format| + format.html + format.xls{ + filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls" + send_data(export_rep_xls(gpid, :rev => rev, :cycle => cycle), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f97696b67..adb5870bb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -93,7 +93,7 @@ module ApplicationHelper end xls_report = StringIO.new book = Spreadsheet::Workbook.new - sheet1 = book.create_worksheet :name => "版本库" + sheet1 = book.create_worksheet :name => l(:project_module_repository) blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])