pull/6827/head
jwollert 14 years ago
commit c17550ab1f
  1. 5
      app/models/cost_query/filter.rb
  2. 3
      app/models/cost_query/filter/base.rb
  3. 25
      app/models/cost_query/filter/custom_field.rb
  4. 1
      app/models/cost_query/group_by.rb
  5. 3
      app/models/cost_query/group_by/base.rb
  6. 7
      app/models/cost_query/group_by/custom_field.rb
  7. 2
      app/models/cost_query/operator.rb
  8. 5
      app/models/cost_query/query_utils.rb
  9. 2
      app/models/cost_query/sql_statement.rb
  10. 4
      app/models/cost_query/table.rb

@ -1,8 +1,6 @@
require "set" require "set"
class CostQuery::Filter < Report::Filter class CostQuery::Filter < Report::Filter
require_dependency 'cost_query/filter/base'
def self.all def self.all
@all ||= super + Set[ @all ||= super + Set[
CostQuery::Filter::ActivityId, CostQuery::Filter::ActivityId,
@ -22,9 +20,6 @@ class CostQuery::Filter < Report::Filter
CostQuery::Filter::StatusId, CostQuery::Filter::StatusId,
CostQuery::Filter::Subject, CostQuery::Filter::Subject,
CostQuery::Filter::TrackerId, CostQuery::Filter::TrackerId,
#CostQuery::Filter::Tweek,
#CostQuery::Filter::Tmonth,
#CostQuery::Filter::Tyear,
CostQuery::Filter::UpdatedOn, CostQuery::Filter::UpdatedOn,
CostQuery::Filter::UserId, CostQuery::Filter::UserId,
CostQuery::Filter::PermissionFilter, CostQuery::Filter::PermissionFilter,

@ -1,3 +0,0 @@
class CostQuery::Filter::Base < Report::Filter::Base
include CostQuery::QueryUtils
end

@ -1,25 +0,0 @@
module CostQuery::Filter
class CustomField < Base
extend CostQuery::CustomFieldMixin
on_prepare do
applies_for :label_issue_attributes
# redmine internals just suck
case custom_field.field_format
when 'string', 'text' then use :string_operators
when 'list' then use :null_operators
when 'date' then use :time_operators
when 'int', 'float' then use :integer_operators
when 'bool'
@possible_values = [['true', 't'], ['false', 'f']]
use :null_operators
else
fail "cannot handle #{custom_field.field_format.inspect}"
end
end
def self.available_values(*)
@possible_values || custom_field.possible_values
end
end
end

@ -14,7 +14,6 @@ class CostQuery::GroupBy < Report::GroupBy
CostQuery::GroupBy::SingletonValue, CostQuery::GroupBy::SingletonValue,
CostQuery::GroupBy::Tmonth, CostQuery::GroupBy::Tmonth,
CostQuery::GroupBy::TrackerId, CostQuery::GroupBy::TrackerId,
#CostQuery::GroupBy::Tweek,
CostQuery::GroupBy::Tyear, CostQuery::GroupBy::Tyear,
CostQuery::GroupBy::UserId, CostQuery::GroupBy::UserId,
CostQuery::GroupBy::Week, CostQuery::GroupBy::Week,

@ -1,3 +0,0 @@
class CostQuery::GroupBy::Base < Report::GroupBy::Base
include CostQuery::QueryUtils
end

@ -1,7 +0,0 @@
module CostQuery::GroupBy
class CustomField < Base
applies_for :label_issue_attributes
extend CostQuery::CustomFieldMixin
on_prepare { group_fields table_name }
end
end

@ -1,6 +1,4 @@
class CostQuery::Operator < Report::Operator class CostQuery::Operator < Report::Operator
include CostQuery::QueryUtils
# Operators from Redmine # Operators from Redmine
new "c", :arity => 0 do new "c", :arity => 0 do
def modify(query, field, *values) def modify(query, field, *values)

@ -29,9 +29,6 @@ module CostQuery::QueryUtils
"'#{quote_string l(ident)}'" "'#{quote_string l(ident)}'"
end end
def self.included(klass) propagate!
super
klass.extend self
end
end end

@ -1,6 +1,4 @@
class CostQuery::SqlStatement < Report::SqlStatement class CostQuery::SqlStatement < Report::SqlStatement
include CostQuery::QueryUtils
COMMON_FIELDS = %w[ COMMON_FIELDS = %w[
user_id project_id issue_id rate_id user_id project_id issue_id rate_id
comments spent_on created_on updated_on tyear tmonth tweek comments spent_on created_on updated_on tyear tmonth tweek

@ -1,3 +1 @@
class CostQuery::Table < Report::Table class CostQuery::Table < Report::Table; end
include CostQuery::QueryUtils
end

Loading…
Cancel
Save