proper display of date entries in group by

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@255 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 15 years ago
parent e2f02d8e44
commit d727794b39
  1. 14
      app/views/cost_reports/_list_group_by.rhtml

@ -45,13 +45,13 @@
group_by = {:group_by=>{:name=>"", :granularity=>"year"}}
fields = entry.keys - %w[count sum]
fields.sort!
name = case fields
when %[tyear tmonth] then "#{entry[:tyear]} #{month_name(entry[tmonth])}"
when %[tyear tweek] then "#{entry[:tyear]}, #{l(:week)} \##{month_name(entry[tweek])}"
else fields.map { |k| CostQuery.get_name(k, entry[k]) }.join " "
end
name = entry.map { |k, v| CostQuery.get_name(k, v) unless %w[count sum].include? k.to_s }.join(" ")
if fields.include? "tmonth"
name = "#{entry[:tyear]}, #{month_name(entry["tmonth"].to_i)}"
elsif fields.include? "tweek"
name = "#{entry[:tyear]}, #{l(:week)} \##{entry["tweek"]}"
else
name = fields.map { |k| CostQuery.get_name(k, entry[k]) }.join " "
end
name.strip!
%>

Loading…
Cancel
Save