|
|
@ -2,7 +2,8 @@ |
|
|
|
#require_dependency 'xls_report/spreadsheet_builder' |
|
|
|
#require_dependency 'xls_report/spreadsheet_builder' |
|
|
|
#require_dependency 'additional_formats/filter_settings_helper' |
|
|
|
#require_dependency 'additional_formats/filter_settings_helper' |
|
|
|
|
|
|
|
|
|
|
|
module OpenProject::XlsExport::Patches |
|
|
|
module OpenProject::XlsExport |
|
|
|
|
|
|
|
module Patches |
|
|
|
module IssuesControllerPatch |
|
|
|
module IssuesControllerPatch |
|
|
|
def self.included(base) # :nodoc: |
|
|
|
def self.included(base) # :nodoc: |
|
|
|
base.send(:include, InstanceMethods) |
|
|
|
base.send(:include, InstanceMethods) |
|
|
@ -20,7 +21,7 @@ module OpenProject::XlsExport::Patches |
|
|
|
super do |format| |
|
|
|
super do |format| |
|
|
|
yield format |
|
|
|
yield format |
|
|
|
format.xls do |
|
|
|
format.xls do |
|
|
|
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], |
|
|
|
@issues = @query.issues(:include => [:assigned_to, :type, :priority, :category, :fixed_version], |
|
|
|
:order => sort_clause) |
|
|
|
:order => sort_clause) |
|
|
|
unless @issues.empty? |
|
|
|
unless @issues.empty? |
|
|
|
send_data(issues_to_xls, :type => "application/vnd.ms-excel", |
|
|
|
send_data(issues_to_xls, :type => "application/vnd.ms-excel", |
|
|
@ -36,6 +37,7 @@ module OpenProject::XlsExport::Patches |
|
|
|
# Convert an issues query with associated issues to xls using the queries columns as headers |
|
|
|
# Convert an issues query with associated issues to xls using the queries columns as headers |
|
|
|
def build_spreadsheet(project, issues, query) |
|
|
|
def build_spreadsheet(project, issues, query) |
|
|
|
columns = query.columns |
|
|
|
columns = query.columns |
|
|
|
|
|
|
|
|
|
|
|
sb = SpreadsheetBuilder.new |
|
|
|
sb = SpreadsheetBuilder.new |
|
|
|
project_name = (project.name if project) || "All Projects" |
|
|
|
project_name = (project.name if project) || "All Projects" |
|
|
|
sb.add_title("#{project_name} >> #{l(:label_issue_plural)} (#{format_date(Date.today)})") |
|
|
|
sb.add_title("#{project_name} >> #{l(:label_issue_plural)} (#{format_date(Date.today)})") |
|
|
@ -79,3 +81,4 @@ module OpenProject::XlsExport::Patches |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|