Merge branch 'feature/widgets' into feature/regional_companies

pull/6827/head
Philipp Tessenow 14 years ago
commit 660cda8aa1
  1. 11
      assets/stylesheets/reporting.css
  2. 2
      config/locales/de.yml
  3. 24
      lib/report.rb
  4. 8
      lib/report/query_utils.rb
  5. 2
      lib/report/result.rb

@ -500,14 +500,3 @@ html>body #ajax-indicator { position: fixed; }
padding-left: 26px;
vertical-align: bottom;
}
<<<<<<< HEAD
#content p,
#content label,
#content a,
#content div {
font-size: 11px;
line-height: 16px;
}
=======
>>>>>>> feature/widgets

@ -9,7 +9,7 @@ de:
label_rows: "Zeilen"
label_group_by: "Gruppieren nach"
label_group_by_add: "Grouppierung hinzufügen"
label_group_by_add: "Gruppierung hinzufügen"
label_filter: "Filter"
label_filter_plural: "Filter"
label_filter_add: "Filter hinzufügen"

@ -18,6 +18,10 @@ class Report < ActiveRecord::Base
@@accepted_properties ||= []
end
def self.reporting_connection
connection
end
def self.chain_initializer
@chain_initializer ||= []
end
@ -31,7 +35,7 @@ class Report < ActiveRecord::Base
def serialize
# have to take the reverse to retain the original order when deserializing
self.serialized = { :filters => filters.collect(&:serialize).reverse, :group_bys => group_bys.collect(&:serialize).reverse }
self.serialized = { :filters => filters.collect(&:serialize).sort, :group_bys => group_bys.collect(&:serialize).reverse }
end
def deserialize
@ -135,23 +139,7 @@ class Report < ActiveRecord::Base
end
def hash
report_string = ""
report_string.concat('filters: [')
report_string.concat(filters.map { |f|
f.class.underscore_name + f.operator.to_s + (f.values ? f.values.to_json : "")
}.sort.join(', '))
report_string.concat(']')
report_string.concat(', group_bys: {')
report_string.concat(group_bys.group_by(&:type).map { |t, gbs|
"#{t} : [#{gbs.collect(&:class).collect(&:underscore_name).join(', ')}]"
}.join(', '))
report_string.concat('}')
report_string.hash
(self.class.name + serialize.inspect).hash
end
def == another_report

@ -1,7 +1,7 @@
module Report::QueryUtils
alias singleton_class metaclass unless respond_to? :singleton_class
delegate :quoted_false, :quoted_true, :to => "engine.connection"
delegate :quoted_false, :quoted_true, :to => "engine.reporting_connection"
attr_writer :engine
module PropagationHook
@ -43,7 +43,7 @@ module Report::QueryUtils
# @return [Object] Quoted version
def quote_string(str)
return str unless str.respond_to? :to_str
engine.connection.quote_string(str)
engine.reporting_connection.quote_string(str)
end
def current_language
@ -75,7 +75,7 @@ module Report::QueryUtils
end
def quoted_date(date)
engine.connection.quoted_date date.to_dateish
engine.reporting_connection.quoted_date date.to_dateish
end
##
@ -175,7 +175,7 @@ module Report::QueryUtils
end
def adapter_name
engine.connection.adapter_name.downcase.to_sym
engine.reporting_connection.adapter_name.downcase.to_sym
end
def cache

@ -71,7 +71,7 @@ class Report::Result
end
def final?(type)
type? type and (direct? or first.type != type)
type? type and (direct? or size == 0 or first.type != type)
end
def type?(type)

Loading…
Cancel
Save