app/models/time_report_query.rb
# Accepts :from/:to params as shortcut filters
Accepts :from/:to params as shortcut filters
Accepts : from / : to params as shortcut filters
def build_from_params(params, defaults={})
    if Redmine::VERSION::MAJOR < 4
      super(params)
    else
      super(params, defaults)
    end
    if params[:from].present? && params[:to].present?
      add_filter('spent_on', '><', [params[:from], params[:to]])
    elsif params[:from].present?
      add_filter('spent_on', '>=', [params[:from]])
    elsif params[:to].present?
      add_filter('spent_on', '<=', [params[:to]])
    end
    self.criteria = params[:criteria] || (params[:query] && params[:query][:criteria])
    self.period = params[:period] || (params[:query] && params[:query][:period])
    self
  end
def build_from_params ( params , defaults = { } ) if Redmine :: VERSION :: MAJOR < 4 super ( params ) else super ( params , defaults ) end if params [ :from ] . present? && params [ :to ] . present? add_filter ( 'spent_on' , '><' , [ params [ :from ] , params [ :to ] ] ) elsif params [ :from ] . present? add_filter ( 'spent_on' , '>=' , [ params [ :from ] ] ) elsif params [ :to ] . present? add_filter ( 'spent_on' , '<=' , [ params [ :to ] ] ) end self . criteria = params [ :criteria ] || ( params [ :query ] && params [ :query ] [ :criteria ] ) self . period = params [ :period ] || ( params [ :query ] && params [ :query ] [ :period ] ) self end
Accepts :from/:to params as shortcut filters
Accepts : from / : to params as shortcut filters
################ # Smile specific : criteria ################ # Smile specific : period
params
<not_specific>
defaults
<not_specific>