Merge pull request #1 from finnlabs/feature/rails3_reportingengine_to_engine

Feature/rails3 reportingengine to engine
pull/6827/head
Christian Rijke 12 years ago
commit 8a27c22d2b
  1. 16
      app/helpers/reporting_helper.rb
  2. 2
      app/models/cost_query.rb
  3. 7
      lib/open_project/reporting/engine.rb
  4. 5
      lib/open_project/reporting/widgets.rb
  5. 2
      openproject-reporting.gemspec

@ -8,14 +8,14 @@ module ReportingHelper
# Extends the definition in ApplicationHelper, to allow passing Dates as well
# This is the definitions that is hit by the views and widgets
def l(*values)
return values.first if values.size == 1 and values.first.respond_to? :to_str
if [Date, DateTime, Time].include? values.first.class
::I18n.l values.first
else
ApplicationHelper.l(*values)
end
end
#def l(*values)
# return values.first if values.size == 1 and values.first.respond_to? :to_str
# if [Date, DateTime, Time].include? values.first.class
# ::I18n.l values.first
# else
# ApplicationHelper.l(*values)
# end
#end
# ##
# # For a given CostQuery::Filter filter, return an array of hashes, that contain

@ -1,4 +1,4 @@
require 'reporting_engine/report'
require 'open_project/reporting_engine/report'
class CostQuery < Report
def_delegators :result, :real_costs

@ -1,4 +1,5 @@
require 'openproject_costs'
require 'openproject-reportingengine'
module OpenProject::Reporting
class Engine < ::Rails::Engine
@ -37,7 +38,11 @@ module OpenProject::Reporting
end
config.to_prepare do
require_dependency 'open_project/reporting/widgets.rb'
require_dependency 'open_project/reporting_engine/widget.rb'
require_dependency 'open_project/reporting/widgets/simple_table'
require_dependency 'open_project/reporting/widgets/entry_table'
require_dependency 'open_project/reporting/widgets/cost_types'
require_dependency 'open_project/reporting/widgets/settings'
unless Redmine::Plugin.registered_plugins.include?(:openproject_reporting)
Redmine::Plugin.register :openproject_reporting do

@ -1,5 +0,0 @@
require 'reporting_engine/widget.rb'
require 'open_project/reporting/widgets/simple_table'
require 'open_project/reporting/widgets/entry_table'
require 'open_project/reporting/widgets/cost_types'
require 'open_project/reporting/widgets/settings'

@ -18,7 +18,7 @@ Gem::Specification.new do |s|
# FIXME
# s.test_files = Dir["spec/**/*"]
s.add_dependency "reporting_engine", "~> 0.0.1"
s.add_dependency "openproject-reportingengine", "~> 0.0.1"
s.add_dependency "openproject_costs", "> 4.0.0"
s.add_development_dependency "factory_girl_rails", "~> 4.0"

Loading…
Cancel
Save