@@ -35,6 +35,10 class IssueQuery < Query | |||
|
35 | 35 | QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"), |
|
36 | 36 | QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"), |
|
37 | 37 | QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"), |
|
38 | QueryColumn.new(:total_estimated_hours, | |
|
39 | :sortable => "COALESCE((SELECT SUM(estimated_hours) FROM #{Issue.table_name} subtasks" + | |
|
40 | " WHERE subtasks.root_id = #{Issue.table_name}.root_id AND subtasks.lft >= #{Issue.table_name}.lft AND subtasks.rgt <= #{Issue.table_name}.rgt), 0)", | |
|
41 | :default_order => 'desc'), | |
|
38 | 42 | QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio", :groupable => true), |
|
39 | 43 | QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'), |
|
40 | 44 | QueryColumn.new(:closed_on, :sortable => "#{Issue.table_name}.closed_on", :default_order => 'desc'), |
@@ -342,6 +342,7 en: | |||
|
342 | 342 | field_default_status: Default status |
|
343 | 343 | field_users_visibility: Users visibility |
|
344 | 344 | field_time_entries_visibility: Time logs visibility |
|
345 | field_total_estimated_hours: Total estimated time | |
|
345 | 346 | |
|
346 | 347 | setting_app_title: Application title |
|
347 | 348 | setting_app_subtitle: Application subtitle |
@@ -362,6 +362,7 fr: | |||
|
362 | 362 | field_default_status: Statut par défaut |
|
363 | 363 | field_users_visibility: Visibilité des utilisateurs |
|
364 | 364 | field_time_entries_visibility: Visibilité du temps passé |
|
365 | field_total_estimated_hours: Temps estimé total | |
|
365 | 366 | |
|
366 | 367 | setting_app_title: Titre de l'application |
|
367 | 368 | setting_app_subtitle: Sous-titre de l'application |
@@ -721,6 +721,13 class IssuesControllerTest < ActionController::TestCase | |||
|
721 | 721 | hours = assigns(:issues).collect(&:total_spent_hours) |
|
722 | 722 | assert_equal hours.sort.reverse, hours |
|
723 | 723 | end |
|
724 | ||
|
725 | def test_index_sort_by_total_estimated_hours | |
|
726 | get :index, :sort => 'total_estimated_hours:desc' | |
|
727 | assert_response :success | |
|
728 | hours = assigns(:issues).collect(&:total_estimated_hours) | |
|
729 | assert_equal hours.sort.reverse, hours | |
|
730 | end | |
|
724 | 731 | |
|
725 | 732 | def test_index_sort_by_user_custom_field |
|
726 | 733 | cf = IssueCustomField.create!(:name => 'User', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'user') |
@@ -862,6 +869,11 class IssuesControllerTest < ActionController::TestCase | |||
|
862 | 869 | assert_select 'table.issues tr#issue-3 td.total_spent_hours', :text => '1.00' |
|
863 | 870 | end |
|
864 | 871 | |
|
872 | def test_index_with_total_estimated_hours_column | |
|
873 | get :index, :set_filter => 1, :c => %w(subject total_estimated_hours) | |
|
874 | assert_select 'table.issues td.total_estimated_hours' | |
|
875 | end | |
|
876 | ||
|
865 | 877 | def test_index_should_not_show_spent_hours_column_without_permission |
|
866 | 878 | Role.anonymous.remove_permission! :view_time_entries |
|
867 | 879 | get :index, :set_filter => 1, :c => %w(subject spent_hours) |
General Comments 0
You need to be logged in to leave comments.
Login now