mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
Adds "Total spent hours" column available on the issue list (#11253).
git-svn-id: http://svn.redmine.org/redmine/trunk@14406 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
71942ec5a2
commit
f6ea714f52
@ -267,6 +267,12 @@ class IssueQuery < Query
|
||||
:default_order => 'desc',
|
||||
:caption => :label_spent_time
|
||||
)
|
||||
@available_columns.insert index+1, QueryColumn.new(:total_spent_hours,
|
||||
:sortable => "COALESCE((SELECT SUM(hours) FROM #{TimeEntry.table_name} JOIN #{Issue.table_name} subtasks ON subtasks.id = #{TimeEntry.table_name}.issue_id" +
|
||||
" WHERE subtasks.root_id = #{Issue.table_name}.root_id AND subtasks.lft >= #{Issue.table_name}.lft AND subtasks.rgt <= #{Issue.table_name}.rgt), 0)",
|
||||
:default_order => 'desc',
|
||||
:caption => :label_total_spent_time
|
||||
)
|
||||
end
|
||||
|
||||
if User.current.allowed_to?(:set_issues_private, nil, :global => true) ||
|
||||
|
||||
@ -1154,3 +1154,4 @@ ar:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: الوقت الذي تم انفاقه كاملا
|
||||
|
||||
@ -1251,3 +1251,4 @@ az:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Cəmi sərf olunan vaxt
|
||||
|
||||
@ -1147,3 +1147,4 @@ bg:
|
||||
description_date_to: Въведете крайна дата
|
||||
text_repository_identifier_info: 'Позволени са малки букви (a-z), цифри, тирета и _.<br />Промяна след създаването му не е възможна.'
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Общо употребено време
|
||||
|
||||
@ -1167,3 +1167,4 @@ bs:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1156,3 +1156,4 @@ ca:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: "Temps total invertit"
|
||||
|
||||
@ -1156,3 +1156,4 @@ cs:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Celkem strávený čas
|
||||
|
||||
@ -1171,3 +1171,4 @@ da:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overordnet forbrug af tid
|
||||
|
||||
@ -1163,3 +1163,4 @@ de:
|
||||
label_member_management: Member management
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_total_spent_time: Aufgewendete Zeit aller Projekte anzeigen
|
||||
|
||||
@ -1154,3 +1154,4 @@ el:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1156,3 +1156,4 @@ en-GB:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -748,6 +748,7 @@ en:
|
||||
label_changes_details: Details of all changes
|
||||
label_issue_tracking: Issue tracking
|
||||
label_spent_time: Spent time
|
||||
label_total_spent_time: Total spent time
|
||||
label_overall_spent_time: Overall spent time
|
||||
label_f_hour: "%{value} hour"
|
||||
label_f_hour_plural: "%{value} hours"
|
||||
|
||||
@ -1188,3 +1188,4 @@ es-PA:
|
||||
label_member_management_all_roles: Todos los roles
|
||||
label_member_management_selected_roles_only: Sólo estos roles
|
||||
label_password_required: Confirme su contraseña para continuar
|
||||
label_total_spent_time: Tiempo total dedicado
|
||||
|
||||
@ -1186,3 +1186,4 @@ es:
|
||||
label_member_management_all_roles: Todos los roles
|
||||
label_member_management_selected_roles_only: Sólo estos roles
|
||||
label_password_required: Confirme su contraseña para continuar
|
||||
label_total_spent_time: Tiempo total dedicado
|
||||
|
||||
@ -1167,3 +1167,4 @@ et:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: "Kokku kulutatud aeg"
|
||||
|
||||
@ -1155,3 +1155,4 @@ eu:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Igarotako denbora guztira
|
||||
|
||||
@ -1155,3 +1155,4 @@ fa:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: زمان صرف شده روی هم
|
||||
|
||||
@ -1175,3 +1175,4 @@ fi:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -768,6 +768,7 @@ fr:
|
||||
label_changes_details: Détails de tous les changements
|
||||
label_issue_tracking: Suivi des demandes
|
||||
label_spent_time: Temps passé
|
||||
label_total_spent_time: Temps passé total
|
||||
label_overall_spent_time: Temps passé global
|
||||
label_f_hour: "%{value} heure"
|
||||
label_f_hour_plural: "%{value} heures"
|
||||
|
||||
@ -1162,3 +1162,4 @@ gl:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: "Tempo total empregado"
|
||||
|
||||
@ -1159,3 +1159,4 @@ he:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: זמן שהושקע סה"כ
|
||||
|
||||
@ -1155,3 +1155,4 @@ hr:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1173,3 +1173,4 @@
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Összes ráfordított idő
|
||||
|
||||
@ -1158,3 +1158,4 @@ id:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1149,3 +1149,4 @@ it:
|
||||
label_member_management_all_roles: Tutti i ruoli
|
||||
label_member_management_selected_roles_only: Solo questi ruoli
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Totale tempo impiegato
|
||||
|
||||
@ -1169,3 +1169,4 @@ ja:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: すべての作業時間の記録
|
||||
|
||||
@ -1198,3 +1198,4 @@ ko:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: 총 소요시간
|
||||
|
||||
@ -1213,3 +1213,4 @@ lt:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Visas dirbtas laikas
|
||||
|
||||
@ -1148,3 +1148,4 @@ lv:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1154,3 +1154,4 @@ mk:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Вкупно потрошено време
|
||||
|
||||
@ -1155,3 +1155,4 @@ mn:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1133,3 +1133,4 @@ nl:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Totaal bestede tijd
|
||||
|
||||
@ -1144,3 +1144,4 @@
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: All tidsbruk
|
||||
|
||||
@ -1174,3 +1174,4 @@ pl:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Przepracowany czas
|
||||
|
||||
@ -1173,3 +1173,4 @@ pt-BR:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Tempo gasto geral
|
||||
|
||||
@ -1159,3 +1159,4 @@ pt:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Total de tempo registado
|
||||
|
||||
@ -1149,3 +1149,4 @@ ro:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1260,3 +1260,4 @@ ru:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Всего затрачено времени
|
||||
|
||||
@ -1144,3 +1144,4 @@ sk:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Celkový strávený čas
|
||||
|
||||
@ -1154,3 +1154,4 @@ sl:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Skupni porabljeni čas
|
||||
|
||||
@ -1150,3 +1150,4 @@ sq:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1156,3 +1156,4 @@ sr-YU:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Celokupno utrošeno vreme
|
||||
|
||||
@ -1155,3 +1155,4 @@ sr:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Целокупно утрошено време
|
||||
|
||||
@ -1187,3 +1187,4 @@ sv:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Total tid spenderad
|
||||
|
||||
@ -1151,3 +1151,4 @@ th:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1163,3 +1163,4 @@ tr:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Toplam harcanan zaman
|
||||
|
||||
@ -1149,3 +1149,4 @@ uk:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Overall spent time
|
||||
|
||||
@ -1207,3 +1207,4 @@ vi:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: Tổng thời gian sử dụng
|
||||
|
||||
@ -1230,3 +1230,4 @@
|
||||
description_date_from: 輸入起始日期
|
||||
description_date_to: 輸入結束日期
|
||||
text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。<br />一旦儲存之後, 代碼便無法再次被更改。'
|
||||
label_total_spent_time: 整體耗用工時
|
||||
|
||||
@ -1155,3 +1155,4 @@ zh:
|
||||
label_member_management_all_roles: All roles
|
||||
label_member_management_selected_roles_only: Only these roles
|
||||
label_password_required: Confirm your password to continue
|
||||
label_total_spent_time: 总体耗时
|
||||
|
||||
@ -714,6 +714,13 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
hours = assigns(:issues).collect(&:spent_hours)
|
||||
assert_equal hours.sort.reverse, hours
|
||||
end
|
||||
|
||||
def test_index_sort_by_total_spent_hours
|
||||
get :index, :sort => 'total_spent_hours:desc'
|
||||
assert_response :success
|
||||
hours = assigns(:issues).collect(&:total_spent_hours)
|
||||
assert_equal hours.sort.reverse, hours
|
||||
end
|
||||
|
||||
def test_index_sort_by_user_custom_field
|
||||
cf = IssueCustomField.create!(:name => 'User', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'user')
|
||||
@ -848,6 +855,11 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_select 'table.issues tr#issue-3 td.spent_hours', :text => '1.00'
|
||||
end
|
||||
|
||||
def test_index_with_total_spent_hours_column
|
||||
get :index, :set_filter => 1, :c => %w(subject total_spent_hours)
|
||||
assert_select 'table.issues tr#issue-3 td.total_spent_hours', :text => '1.00'
|
||||
end
|
||||
|
||||
def test_index_should_not_show_spent_hours_column_without_permission
|
||||
Role.anonymous.remove_permission! :view_time_entries
|
||||
get :index, :set_filter => 1, :c => %w(subject spent_hours)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user