diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 088ecac58..820b1d7ac 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -66,16 +66,16 @@ class IssuesController < ApplicationController @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' if @query.valid? - case params[:format] - when 'csv', 'pdf' - @limit = 10#Setting.issues_export_limit.to_i - when 'atom' - @limit = 10#Setting.feeds_limit.to_i - when 'xml', 'json' - @offset, @limit = api_offset_and_limit({:limit => 10}) - else - @limit = 10#per_page_option - end + # case params[:format] + # when 'csv', 'pdf' + # @limit = 10#Setting.issues_export_limit.to_i + # when 'atom' + # @limit = 10#Setting.feeds_limit.to_i + # when 'xml', 'json' + # @offset, @limit = api_offset_and_limit({:limit => 10}) + # else + # @limit = 10#per_page_option + # end @assign_to_id = params[:assigned_to_id] @author_id = params[:author_id] @priority_id = params[:priority_id] @@ -83,17 +83,23 @@ class IssuesController < ApplicationController @subject = params[:subject] @done_ratio = params[:done_ratio] @issue_count = @query.issue_count - @issue_pages = Paginator.new @issue_count, @limit, params['page'] - params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 + # @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) + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @offset ||= @issue_pages.offset - @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - :order => 'issues.updated_on desc', - :offset => @offset, - :limit => @limit) - if params[:set_filter] - @set_filter = params[:set_filter] - end - @issue_count_by_group = @query.issue_count_by_group + @issues = paginateHelper @issues_filter, @limit + # if params[:set_filter] + # @set_filter = params[:set_filter] + # end + # @issue_count_by_group = @query.issue_count_by_group respond_to do |format| format.js format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index defc36868..2dce0f37f 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -53,7 +53,6 @@ class VersionsController < ApplicationController @offset ||= @versions_pages.offset @versions = @versions.slice(@offset, @limit) #end by young - @issues_by_version = {} if @selected_tracker_ids.any? && @versions.any? @@ -81,6 +80,14 @@ class VersionsController < ApplicationController all } format.api + format.xls { + @issues = @version.fixed_issues.visible. + includes(:status, :tracker, :priority). + reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id"). + all + filename = "#{@version.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)) + } end end diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index f72113841..b6b91eed0 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -8,12 +8,12 @@ :year => params[:year], :months => params[:months]}, :method => :get, :id => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> -
"> - <%= l(:label_filter_plural) %> -
"> - <%= render :partial => 'queries/filters', :locals => {:query => @query} %> -
-
+ + + + + +