Project

General

Profile

Feature #971 ยป spent_time_column.patch

Jean-Philippe Lang, 2008-04-01 20:29

View differences:

H:/trunk_fix/app/helpers/queries_helper.rb (working copy)
37 37
        format_date(value)
38 38
      elsif value.is_a?(Time)
39 39
        format_time(value)
40
      elsif value.is_a?(Float)
41
        "%0.02f" % value
40 42
      else
41 43
        case column.name
42 44
        when :subject
H:/trunk_fix/app/models/query.rb (working copy)
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 17

  
18 18
class QueryColumn  
19
  attr_accessor :name, :sortable, :default_order
19
  attr_accessor :name, :sortable, :default_order, :label
20 20
  include GLoc
21 21
  
22 22
  def initialize(name, options={})
23 23
    self.name = name
24 24
    self.sortable = options[:sortable]
25 25
    self.default_order = options[:default_order]
26
    self.label = options[:label] || "field_#{name}"
26 27
  end
27 28
  
28 29
  def caption
......
27 28
  
28 29
  def caption
29 30
    set_language_if_valid(User.current.language)
30
    l("field_#{name}")
31
    l(label)
31 32
  end
32 33
end
33 34

  
......
105 106
    QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
106 107
    QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
107 108
    QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"),
109
    QueryColumn.new(:spent_hours, :label => :label_spent_time),
108 110
    QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio"),
109 111
    QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'),
110 112
  ]
    (1-1/1)