Project

General

Profile

Defect #1384 » Worktime-Rails42issue.patch

Olivier Houdas, 07/01/2015 12:51 AM

View differences:

plugins/redmine_work_time/app/helpers/work_time_helper.rb Tue Jun 30 16:31:18 2015 +0200 → plugins/redmine_work_time/app/helpers/work_time_helper.rb Tue Jun 30 17:42:04 2015 +0200
3 3
    return "" unless issue
4 4
    issue_cost_est = issue.estimated_hours
5 5
    return "" unless issue_cost_est
6
    issue_cost = TimeEntry.sum(:hours, :conditions=>["issue_id=:i",{:i=>issue.id}])
6
    issue_cost = TimeEntry.where("issue_id=#{issue.id}").sum(:hours)
7 7
    return sprintf("(%1.1f/%1.1f)",issue_cost,issue_cost_est)
8 8
  end
9 9

  
......
11 11
    return "" unless issue
12 12
    issue_cost_est = issue.estimated_hours
13 13
    return "" unless issue_cost_est
14
    issue_cost = TimeEntry.sum(:hours, :conditions=>["issue_id=:i",{:i=>issue.id}])
14
    issue_cost = TimeEntry.where("issue_id=#{issue.id}").sum(:hours)
15 15
    return sprintf("%1.0f",issue_cost/issue_cost_est*100)
16 16
  end
17 17
end
(2-2/2)