Fix module namespaces

pull/6827/head
Michael Frister 11 years ago committed by Michael Frister
parent 2eaf168c26
commit fc112adc42
  1. 2
      lib/open_project/xls_export/filename_helper.rb
  2. 2
      lib/open_project/xls_export/filter_settings_helper.rb
  3. 7
      lib/open_project/xls_export/patches/issues_controller_patch.rb
  4. 3
      lib/open_project/xls_export/spreadsheet_builder.rb

@ -1,3 +1,4 @@
module OpenProject::XlsExport
class FilenameHelper class FilenameHelper
# Remove characters that could cause problems on popular OSses # Remove characters that could cause problems on popular OSses
# => A string that does not start with a space or dot and does not contain any of \/:*?"<>| # => A string that does not start with a space or dot and does not contain any of \/:*?"<>|
@ -5,3 +6,4 @@ class FilenameHelper
str.gsub(/^[ \.]/,"").gsub(/[\\\/:\*\?"<>|"]/, "_") str.gsub(/^[ \.]/,"").gsub(/[\\\/:\*\?"<>|"]/, "_")
end end
end end
end

@ -1,3 +1,4 @@
module OpenProject::XlsExport
class FilterSettingsHelper class FilterSettingsHelper
class << self class << self
def group_by_setting(query) def group_by_setting(query)
@ -25,3 +26,4 @@ class FilterSettingsHelper
end end
end end
end end
end

@ -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

@ -11,6 +11,8 @@ require 'spreadsheet'
# If a worksheet with an index larger than the number of worksheets is requested, # If a worksheet with an index larger than the number of worksheets is requested,
# a new worksheet is created. # a new worksheet is created.
# #
module OpenProject::XlsExport
class SpreadsheetBuilder class SpreadsheetBuilder
Worksheet = Struct.new(:sheet, :column_widths) unless defined? Worksheet Worksheet = Struct.new(:sheet, :column_widths) unless defined? Worksheet
@ -173,3 +175,4 @@ private
@sheet @sheet
end end
end end
end

Loading…
Cancel
Save