From 5debfb69f1ce31944f8952ad2f34ba1871640f8e Mon Sep 17 00:00:00 2001 From: rkh Date: Wed, 14 Jul 2010 15:03:37 +0000 Subject: [PATCH] fix cost type labor git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1400 7926756e-e54e-46e6-9721-ed318f58905e --- app/helpers/reporting_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/reporting_helper.rb b/app/helpers/reporting_helper.rb index 00a5a79d8e..4413332682 100644 --- a/app/helpers/reporting_helper.rb +++ b/app/helpers/reporting_helper.rb @@ -35,6 +35,12 @@ module ReportingHelper link_to project.name, :controller => 'projects', :action => 'show', :id => project end + def cost_type(value) + id = value.to_i + return l(:caption_labor) if id < 0 + CostType.find(id).name + end + ## # For a given row, determine how to render it's contents according to usability and # localization rules @@ -51,7 +57,7 @@ module ReportingHelper when :tweek then "#{l(:label_week)} ##{value}" when :tmonth then month_name(value.to_i) when :category_id then IssueCategory.find(value.to_i).name - when :cost_type_id then CostType.find(value.to_i).name + when :cost_type_id then cost_type(value) when :cost_object then CostObject.find(value.to_i).subject when :issue_id then link_to_issue Issue.find(value.to_i) when :spent_on then format_date(value.to_date)