0001-Expose-created_on-field-for-time-entry-queries.patch

Anonymous, 2016-10-28 13:20

Download (1.89 KB)

View differences:

app/models/time_entry_query.rb
23 23
  self.available_columns = [
24 24
    QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true),
25 25
    QueryColumn.new(:spent_on, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"], :default_order => 'desc', :groupable => true),
26
    QueryColumn.new(:created_on, :sortable => "#{TimeEntry.table_name}.created_on", :default_order => 'desc', :groupable => true),
26 27
    QueryColumn.new(:tweek, :sortable => ["#{TimeEntry.table_name}.spent_on", "#{TimeEntry.table_name}.created_on"], :caption => l(:label_week)),
27 28
    QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true),
28 29
    QueryColumn.new(:activity, :sortable => "#{TimeEntryActivity.table_name}.position", :groupable => true),
......
41 42

  
42 43
  def initialize_available_filters
43 44
    add_available_filter "spent_on", :type => :date_past
45
    add_available_filter "created_on", :type => :date_past
44 46

  
45 47
    principals = []
46 48
    versions = []
......
122 124
  end
123 125

  
124 126
  def default_columns_names
125
    @default_columns_names ||= [:project, :spent_on, :user, :activity, :issue, :comments, :hours]
127
    @default_columns_names ||= [:project, :spent_on, :created_on, :user, :activity, :issue, :comments, :hours]
126 128
  end
127 129

  
128 130
  def default_totalable_names
129
-