Remove dead code.

pull/6827/head
Christian Rijke 12 years ago
parent eec3166dad
commit 2a553d7151
  1. 57
      app/helpers/reporting_helper.rb

@ -3,33 +3,8 @@ require 'date'
module ReportingHelper
# ======================= SHARED CODE START
# include QueriesHelper
include ApplicationHelper
# 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
# ##
# # For a given CostQuery::Filter filter, return an array of hashes, that contain
# # the partials that should be rendered (:name) for that filter and necessary
# # parameters.
# # @param [CostQuery::Filter] the filter we want to render
# def html_elements(filter)
# return text_elements filter if CostQuery::Operator.string_operators.all? { |o| filter.available_operators.include? o }
# return text_elements filter if CostQuery::Operator.integer_operators.all? { |o| filter.available_operators.include? o } #FIXME: have special filters designed for integer-operators, to give feedback if the user doesn't enter an int etc.
# return date_elements filter if CostQuery::Operator.time_operators.all? { |o| filter.available_operators.include? o }
# return heavy_object_elements filter if filter.heavy?
# object_elements filter
# end
def with_project(project)
project = Project.find(project) unless project.is_a? Project
project_was, @project = @project, project
@ -37,38 +12,6 @@ module ReportingHelper
@project = project_was
end
# def object_elements(filter)
# [
# {:name => :activate_filter, :filter_name => filter.underscore_name, :label => l(filter.label)},
# {:name => :operators, :filter_name => filter.underscore_name, :operators => filter.available_operators},
# {:name => :multi_values, :filter_name => filter.underscore_name},
# {:name => :remove_filter, :filter_name => filter.underscore_name}]
# end
# def heavy_object_elements(filter)
# [
# {:name => :activate_filter, :filter_name => filter.underscore_name, :label => l(filter.label)},
# {:name => :text, :text => l(:label_equals)},
# {:name => :heavy_values, :filter_name => filter.underscore_name, :disable_controls => true},
# {:name => :remove_filter, :filter_name => filter.underscore_name}]
# end
# def date_elements(filter)
# [
# {:name => :activate_filter, :filter_name => filter.underscore_name, :label => l(filter.label)},
# {:name => :operators, :filter_name => filter.underscore_name, :operators => filter.available_operators},
# {:name => :date, :filter_name => filter.underscore_name},
# {:name => :remove_filter, :filter_name => filter.underscore_name}]
# end
# def text_elements(filter)
# [
# {:name => :activate_filter, :filter_name => filter.underscore_name, :label => l(filter.label)},
# {:name => :operators, :filter_name => filter.underscore_name, :operators => filter.available_operators},
# {:name => :text_box, :filter_name => filter.underscore_name},
# {:name => :remove_filter, :filter_name => filter.underscore_name}]
# end
def mapped(value, klass, default)
id = value.to_i
return default if id < 0

Loading…
Cancel
Save