Skip to content
Browse files

[#3538] Show the number of issues excluded from the count, based on s…

…tatus.
  • Loading branch information...
1 parent 1727d49 commit 3b6c35b7fdfba0f2b9fbb9b5ef7a06c60ead3c9e @edavis10 committed Jan 25, 2010
View
12 app/models/completion_count.rb
@@ -19,6 +19,18 @@ def total_completed
end
+ def total_excluded
+ if Setting.plugin_redmine_reports['completion_count'].present? && Setting.plugin_redmine_reports['completion_count']['exclude_statuses'].present?
+ Issue.visible.count(:conditions =>
+ ["#{Issue.table_name}.created_on >= (?) and #{Issue.table_name}.created_on <= (?) and #{Issue.table_name}.status_id IN (?)",
+ start_date,
+ end_date,
+ Setting.plugin_redmine_reports['completion_count']['exclude_statuses'].collect(&:to_i)])
+ else
+ return 0
+ end
+ end
+
def total_by_tracker_for_user(tracker, user_id)
Issue.visible.count(:conditions =>
["#{Issue.table_name}.updated_on >= (?) and #{Issue.table_name}.updated_on <= (?) and #{Issue.table_name}.tracker_id = (?) and #{Issue.table_name}.assigned_to_id = (?) and #{Issue.table_name}.status_id IN (?)",
View
4 app/views/system_reports/completion_count.html.erb
@@ -35,6 +35,10 @@
<td><%= l(:reports_completion_count_difference) %></td>
<td id="total-difference"><%= @completion_count.total_incoming - @completion_count.total_completed %></td>
</tr>
+ <tr class="excluded">
+ <td><%= l(:reports_completion_count_excluded) %></td>
+ <td id="total-excluded"><%= @completion_count.total_excluded %></td>
+ </tr>
</tbody>
</table>
<br />
View
2 config/locales/en.yml
@@ -22,3 +22,5 @@ en:
reports_spent_time_reports: Spent Time Summary Reports
reports_all_issues: All Issues
reports_label_select_size: Size of select fields
+ reports_completion_count_excluded: Excluded
+ reports_text_exclude_statuses: Excluded Statuses
View
14 test/functional/system_reports_completion_count_test.rb
@@ -10,6 +10,7 @@ def setup
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
build_anonymous_role
+ setup_plugin_configuration
end
context "GET :completion_count" do
@@ -89,6 +90,15 @@ def setup
:status => @closed
})
+ # Feature, Excluded User2
+ Issue.generate_for_project!(@project, {
+ :assigned_to => @user2,
+ :tracker => @feature,
+ :created_on => 2.days.ago,
+ :updated_on => 1.day.ago,
+ :status => @excluded_status1
+ })
+
# Feature, out of date range
Issue.generate_for_project!(@project, {
:assigned_to => @user2,
@@ -120,6 +130,10 @@ def setup
should 'show the difference' do
assert_select 'td#total-difference', '1'
end
+
+ should 'show the excluded count' do
+ assert_select 'td#total-excluded', '1'
+ end
end
context 'user section' do

0 comments on commit 3b6c35b

Please sign in to comment.
Something went wrong with that request. Please try again.