[#827] Add status group in time entries report.

Patch provided by Jérôme BATAILLE.
Test from Jean-Philippe Lang.
This commit is contained in:
Holger Just 2012-01-16 13:48:06 +01:00
parent d9a0ac37eb
commit 61a65d4624
2 changed files with 11 additions and 0 deletions

View File

@ -160,6 +160,9 @@ class TimeEntryReportsController < ApplicationController
@available_criterias = { 'project' => {:sql => "#{TimeEntry.table_name}.project_id",
:klass => Project,
:label => :label_project},
'status' => {:sql => "#{Issue.table_name}.status_id",
:klass => IssueStatus,
:label => :field_status},
'version' => {:sql => "#{Issue.table_name}.fixed_version_id",
:klass => Version,
:label => :label_version},

View File

@ -128,6 +128,14 @@ class TimeEntryReportsControllerTest < ActionController::TestCase
assert_equal "0.00", "%.2f" % assigns(:total_hours)
end
def test_report_status_criterion
get :report, :project_id => 1, :criterias => ['status']
assert_response :success
assert_template 'report'
assert_tag :tag => 'th', :content => 'Status'
assert_tag :tag => 'td', :content => 'New'
end
def test_report_all_projects_csv_export
get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
assert_response :success