Feature #971 ยป spent_time_column.patch
| H:/trunk_fix/app/helpers/queries_helper.rb (working copy) | ||
|---|---|---|
|
format_date(value)
|
||
|
elsif value.is_a?(Time)
|
||
|
format_time(value)
|
||
|
elsif value.is_a?(Float)
|
||
|
"%0.02f" % value
|
||
|
else
|
||
|
case column.name
|
||
|
when :subject
|
||
| H:/trunk_fix/app/models/query.rb (working copy) | ||
|---|---|---|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
class QueryColumn
|
||
|
attr_accessor :name, :sortable, :default_order
|
||
|
attr_accessor :name, :sortable, :default_order, :label
|
||
|
include GLoc
|
||
|
|
||
|
def initialize(name, options={})
|
||
|
self.name = name
|
||
|
self.sortable = options[:sortable]
|
||
|
self.default_order = options[:default_order]
|
||
|
self.label = options[:label] || "field_#{name}"
|
||
|
end
|
||
|
|
||
|
def caption
|
||
| ... | ... | |
|
|
||
|
def caption
|
||
|
set_language_if_valid(User.current.language)
|
||
|
l("field_#{name}")
|
||
|
l(label)
|
||
|
end
|
||
|
end
|
||
| ... | ... | |
|
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
|
||
|
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
|
||
|
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"),
|
||
|
QueryColumn.new(:spent_hours, :label => :label_spent_time),
|
||
|
QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio"),
|
||
|
QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'),
|
||
|
]
|
||