Feature #5010
openHours per project per user
0%
Description
I am strongly missing the estimated hours per project and per user. The attached image shows one of the pages of the Roadmap project tab. Quite perfect but it just displays the numbers of issues per user (completed slash total). I need (or better to say my management rerquires) the hours (completed slash total).
Any chance to have this simple feature soon?
Files
Updated by Jiří Křivánek over 14 years ago
- File redmine-req-1.png redmine-req-1.png added
Even better place for the time estimate is demonstrated by the second attached image. Well, I can realize that the previous was just easy but this one is a bit difficult...
Updated by Jiří Křivánek over 14 years ago
Perhaps this could help:
I updated the versions_helper.rb
file, the render_issue_status_by
method this way:
def render_issue_status_by(version, criteria)
criteria ||= 'category'
raise 'Unknown criteria' unless STATUS_BY_CRITERIAS.include?(criteria)
h = Hash.new {|k,v| k[v] = [0, 0]}
if criteria == 'assigned_to'
begin
# Total estimated hours
Issue.sum("estimated_hours",
:group => criteria,
:conditions => ["#{Issue.table_name}.estimated_hours is not NULL AND #{Issue.table_name}.fixed_version_id = ?", version.id]).each {|c,s| h[c][0] = s.to_i}
# Open issues count
Issue.sum("(estimated_hours * (100 - done_ratio)) / 100",
:group => criteria,
:include => :status,
:conditions => ["#{Issue.table_name}.estimated_hours is not NULL AND #{Issue.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", version.id, false]).each {|c,s| h[c][1] = s.to_i}
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end
else
begin
# Total issue count
Issue.count(:group => criteria,
:conditions => ["#{Issue.table_name}.fixed_version_id = ?", version.id]).each {|c,s| h[c][0] = s}
# Open issues count
Issue.count(:group => criteria,
:include => :status,
:conditions => ["#{Issue.table_name}.fixed_version_id = ? AND #{IssueStatus.table_name}.is_closed = ?", version.id, false]).each {|c,s| h[c][1] = s}
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end
end
counts = h.keys.compact.sort.collect {|k| {:group => k, :total => h[k][0], :open => h[k][1], :closed => (h[k][0] - h[k][1])}}
max = counts.collect {|c| c[:total]}.max
render :partial => 'issue_counts', :locals => {:version => version, :criteria => criteria, :counts => counts, :max => max}
end
It appears to do what I needed: It displays the estimated hours rather than the issues counts.
Could you please include my piece of code with one of the next Redmine releases, as another option pickable from the dropdown?
Thank you & best regards,
Jiri.