Added count of the issues based on tracker. #1190

This commit is contained in:
Eric Davis
2008-06-09 15:46:45 -07:00
parent 09f88d623c
commit b571a1f338
2 changed files with 18 additions and 1 deletions

View File

@@ -120,6 +120,19 @@ class Deliverable < ActiveRecord::Base
def labor_budget
0
end
def issues_with_trackers
trackers = self.project.trackers
return { } if trackers.empty?
tracker_map = { }
trackers.each do |tracker|
tracker_map[tracker.name] = Issue.find_all_by_tracker_id_and_project_id_and_deliverable_id(tracker.id, self.project.id, self.id).size
end
return tracker_map
end
# Returns true if the deliverable can be edited by user, otherwise false
def editable_by?(user)

View File

@@ -42,6 +42,10 @@
</td>
<td colspan="2">
TODO Tasks
<p><%= l(:label_issue_plural) -%>: <%= deliverable.issues.size -%></p>
<% deliverable.issues_with_trackers.each do |tracker_name, count| %>
<p><%= h tracker_name -%>: <%= h(count) %></p>
<% end %>
</td>
</tr>