Merge pull request #8 from finnlabs/feature/rails3_fix_autoload

Feature/rails3 fix autoload
pull/6827/head
Christian Rijke 12 years ago
commit cec497add5
  1. 2
      app/models/cost_query.rb
  2. 1
      app/models/cost_query/filter/base.rb
  3. 2
      app/models/cost_query/filter/status_id.rb
  4. 1
      app/models/cost_query/group_by/base.rb
  5. 3
      app/models/entry.rb
  6. 1
      app/views/cost_reports/index.html.erb
  7. 12
      lib/open_project/reporting/engine.rb
  8. 0
      lib/widget/cost_types.rb
  9. 2
      lib/widget/entry_table.rb
  10. 5
      lib/widget/settings_patch.rb
  11. 2
      lib/widget/simple_table.rb
  12. 0
      lib/widget/sortable_init.rb

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

@ -0,0 +1 @@
class CostQuery::Filter::Base < Report::Filter::Base; end

@ -1,3 +1,5 @@
#we have to require this here because the operators would not be defined otherwise
require_dependency 'cost_query/operator'
class CostQuery::Filter::StatusId < CostQuery::Filter::Base
available_operators 'c', 'o'
join_table Issue, IssueStatus => [Issue, :status]

@ -0,0 +1 @@
class CostQuery::GroupBy::Base < Report::GroupBy::Base; end

@ -1,6 +1,3 @@
require_dependency "time_entry"
require_dependency "cost_entry"
module Entry
[TimeEntry, CostEntry].each { |e| e.send :include, self }

@ -10,7 +10,6 @@
<h2 id="ur_caption">
<%= render_widget Widget::Controls::QueryName, @query, :can_rename => allowed_to?(:rename, @query, current_user) %>
</h2>
<%= render_widget Widget::Settings, @query, :cost_types => @cost_types, :selected_type_id => @unit_id %>
<div id="result-table" class="autoscroll">

@ -1,6 +1,3 @@
require 'openproject_costs'
require 'reporting_engine'
module OpenProject::Reporting
class Engine < ::Rails::Engine
engine_name :openproject_reporting
@ -38,12 +35,9 @@ module OpenProject::Reporting
end
config.to_prepare do
require_dependency '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'
require_dependency 'report/walker'
require_dependency 'report/transformer'
require_dependency 'widget/settings_patch'
unless Redmine::Plugin.registered_plugins.include?(:openproject_reporting)
Redmine::Plugin.register :openproject_reporting do
name 'Reporting Plugin'

@ -1,5 +1,3 @@
require 'open_project/reporting/widgets/sortable_init'
class Widget::Table::EntryTable < Widget::Table
Fields = [:spent_on, :user_id, :activity_id, :issue_id, :comments, :project_id]

@ -1,4 +1,9 @@
#explicitly require what will be patched to be loaded from the ReportingEngine
require_dependency 'widget/settings'
class Widget::Settings < Widget::Base
#make sure this patch gets unloaded as it does not fit
#the standard rails path
unloadable
@@settings_to_render.insert -2, :cost_types

@ -1,5 +1,3 @@
require 'open_project/reporting/widgets/sortable_init'
class Widget::Table::SimpleTable < Widget::Table
simple_table self
Loading…
Cancel
Save