]> source.dussan.org Git - redmine.git/commitdiff
Merged r14406 from trunk to 3.1-stable (#11253, #20456)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 31 Aug 2015 03:38:12 +0000 (03:38 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 31 Aug 2015 03:38:12 +0000 (03:38 +0000)
Adds "Total spent hours" column available on the issue list.

git-svn-id: http://svn.redmine.org/redmine/branches/3.1-stable@14533 e93f8b46-1217-0410-a6f0-8f06a7374b81

51 files changed:
app/models/issue_query.rb
config/locales/ar.yml
config/locales/az.yml
config/locales/bg.yml
config/locales/bs.yml
config/locales/ca.yml
config/locales/cs.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en-GB.yml
config/locales/en.yml
config/locales/es-PA.yml
config/locales/es.yml
config/locales/et.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fi.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/hr.yml
config/locales/hu.yml
config/locales/id.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/lt.yml
config/locales/lv.yml
config/locales/mk.yml
config/locales/mn.yml
config/locales/nl.yml
config/locales/no.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/pt.yml
config/locales/ro.yml
config/locales/ru.yml
config/locales/sk.yml
config/locales/sl.yml
config/locales/sq.yml
config/locales/sr-YU.yml
config/locales/sr.yml
config/locales/sv.yml
config/locales/th.yml
config/locales/tr.yml
config/locales/uk.yml
config/locales/vi.yml
config/locales/zh-TW.yml
config/locales/zh.yml
test/functional/issues_controller_test.rb

index 20ea596307a15468d97ef08fa25b2c96695947eb..edc1290fe4959890ed03dd94b594032b01ecd55d 100644 (file)
@@ -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) ||
index 22ed41b9e2c873e67826999abc3feeacb0a56b58..c761498775429ca9cb36dc1bd947289e535f2e08 100644 (file)
@@ -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: الوقت الذي تم انفاقه كاملا
index a21724acb3862780eceb7eb0d90e0a31d8e6b381..de78f38908cbb8e1a209f63f5098851bbc6029af 100644 (file)
@@ -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
index e0fda6be61f808d2218efe85df6b57c5c42d9df3..a61fe8dda075229bdab793de776721a0a9f23295 100644 (file)
@@ -1147,3 +1147,4 @@ bg:
   description_date_from: Въведете начална дата
   description_date_to: Въведете крайна дата
   text_repository_identifier_info: 'Позволени са малки букви (a-z), цифри, тирета и _.<br />Промяна след създаването му не е възможна.'
+  label_total_spent_time: Общо употребено време
index d8b054d30d7a236e6ee93258a43372c0ea259ce5..ee5fb1eb3ea119c2f66847a26d288220952b8a8a 100644 (file)
@@ -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
index 3b58433131359bdab491ca2058d4f2100bfb4c7f..1c6d7facb285a3bd21157abc2f18b8d830a48ab7 100644 (file)
@@ -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"
index 20b03ad1197c93d0d7d78c01118b14bbd5abecf4..ab2c905dcfc5496b1d294677d9e72ba05e2720fd 100644 (file)
@@ -1155,3 +1155,4 @@ cs:
   label_member_management_all_roles: Všechny role
   label_member_management_selected_roles_only: Pouze tyto role
   label_password_required: Pro pokračování potvrďte vaše heslo
+  label_total_spent_time: Celkem strávený čas
index b8cd988a044b6a4d986246edac70657f5eafb790..19e54431e0ea84b31569fb0e9cc386a3002282db 100644 (file)
@@ -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
index adba9648fd4d194966e459dcde750aa182e3f42d..8a2bba7dd77fb34e9c809b6f74f635d6d6c67b22 100644 (file)
@@ -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
index f97de710e78d164d7a94afa22df57bd96a81c05a..71d3f73bffbc72df0d0e7565404178cf9365a60d 100644 (file)
@@ -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
index 4380361ec622822de4301390ee5eb432bc7f59b6..2b618f80a1b3241ed6f703d209ace4cc7a2a22a7 100644 (file)
@@ -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
index 1341239f3eb59bfcf702d6a719afa9d34f9fb4e6..039df462f9fbe1e5e7354e31ccc9070f3cd4429c 100644 (file)
@@ -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"
index ce70bda0a690d4565f883340b3c02e2cad6f917a..ec0dba02b7f0508b971259247d37f5f7cd5d8cc4 100644 (file)
@@ -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
index 7d34f4b26971e849577f88f86791b05abb231f77..4042eec9dfb30d878cd6e5caba8dc899c3b16ecb 100644 (file)
@@ -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
index 5e8bc6409c9280169cfdb550d4f1160ae5402bb6..3f2514f1636594731927bc2c29055950e5abd7f1 100644 (file)
@@ -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"
index 727b2f8ff845d19fe14821e7c2789e68ac42634d..d7c6d9b14242e4118d649bb915bafd0db793b546 100644 (file)
@@ -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
index 2664862769045b4035de4360168e80f8c694a51a..49d1710eb4c5061783971200e1b3feff40135b32 100644 (file)
@@ -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: زمان صرف شده روی هم
index a4cd9707a1a5c2127545ddc1a650a6936f2fb19b..65893e0a757c3408e1313eea41510e61169e79bc 100644 (file)
@@ -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
index 0fa522b0f9c2e99c6e844b38031dbc2d659a77c9..3432514befbc2c21f893a15b5649a564d6f0fc0d 100644 (file)
@@ -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"
index 7ff2d4cd4245d0c191f0892c3b64a1eacf99598c..fdacf983339f9db54d791fe3da683b8ba7096b20 100644 (file)
@@ -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"
index 991ea77889c1dab3583f0e6cc991355afe3d36cd..6abee17a9db2b0f1201bb6133ca8d67b709710b5 100644 (file)
@@ -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: זמן שהושקע סה"כ
index 708a0548cf3e1bceecf0bea10843094f041facb5..4cee66120f1e600cdfc71f25d91892838bab88ea 100644 (file)
@@ -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
index b594ad19a1c168c0aefe52d00c67a3b77bbd7f22..6319ddf23e5412a13efbcbb8d9842c3e00c66279 100644 (file)
   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ő
index e1caf0e31f1ebc873a8a877bb2ad1122da9ba91b..0839b09a05eef63401a93f96425b50952e1f470c 100644 (file)
@@ -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
index c29bf2700030b4e94bc4f487154894e3ccdd3d46..709149438a6d57d75c6d3443dfe0ddadef3e91da 100644 (file)
@@ -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
index 2e2a7e360b3a88c09df40b8bea3fe1b6bf8eb10a..5e09949e67ec50ff2fb16c78e1208006872dbf43 100644 (file)
@@ -1169,3 +1169,4 @@ ja:
   label_member_management_all_roles: すべてのロール
   label_member_management_selected_roles_only: 次のロールのみ
   label_password_required: この操作を続行するにはパスワードを入力してください
+  label_total_spent_time: すべての作業時間の記録
index 6e46c81583aed31bedef21d21211942597c4ad07..258dc099ac6325fd830d4fe4bdf3466a38bc5f12 100644 (file)
@@ -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: 총 소요시간
index 1a6e88425533c9a3c0a7e44bd89ea43a0dbe26da..652af5639351687ad40115ab860d1d0e346bb3f2 100644 (file)
@@ -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
index 2e568185df0e178b8276f1869e39933241bda8f1..dea9f8e13f97d9f41d6da89499bb17152250cb75 100644 (file)
@@ -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
index f7c9b6b8d6c62cef1c20b1d16af214f6714f41fc..b752cc5cb2811c8d556d61dbfabd0cf2e5fc82b2 100644 (file)
@@ -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: Вкупно потрошено време
index 17a63860c1a74778a0d73a9154f747273b97956d..e0bea04a44f695ca392778657c5d2cd5d0ceb1d8 100644 (file)
@@ -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
index 3d3c8ded018f0458530872b2d1c01859ec080e8c..96dfa9f7d85386928c1210bd80c8d548a08e627f 100644 (file)
@@ -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
index 1f97c6733a26000cbbc9fc0dac20bd71fcff235e..df905ce5a3fb624778f27cbc3d3cce166aab49ab 100644 (file)
   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
index bc8f562ad620875c137230814e259dca3b633c85..94c94b33613518a1a77244d395665984674a3d49 100644 (file)
@@ -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
index 02f3b1702966b3c69e5d7cb074401ca86a46518b..3806c670da6429bd215208f0549c3e0af9c3d713 100644 (file)
@@ -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
index 128fa2e342c251e5c2d908224b461a4ad1ff2652..ec1ed1d18cd296a55a98d599b0efddcf3edba040 100644 (file)
@@ -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
index 5d1277c3919b363c6fb60768d92cb97224ce2998..83a8c13b4c32c95b35cfe788e4d8af4a3a4a0c34 100644 (file)
@@ -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
index c37653a5cd3df1ce724e3fa1b10d9d1a03c11306..6ce0caff0d4097a2ea3f029ffa55bfcec8b6ba0f 100644 (file)
@@ -1259,3 +1259,4 @@ ru:
   label_member_management_all_roles: Все роли
   label_member_management_selected_roles_only: Только эти роли
   label_password_required: Для продолжения введите свой пароль
+  label_total_spent_time: Всего затрачено времени
index 6a6a7b95625f151bdc5ce6fe5b81918336d53169..d16aeb5f22ccd2a4af67abb0a95fef8b94c3fcbd 100644 (file)
@@ -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
index a2bfcd9329dc48e93b3a583dd80bfc5a0d80276f..7bea31d4bcdd8540bafee6a9cadbcf270060aa14 100644 (file)
@@ -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
index a04a499f52265689af48024ae930536668aac66b..7fbdf65c01261ea764cd78cb2aa684b6ecd4507d 100644 (file)
@@ -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
index ea21928b3f110a442ef7a0a041ccc7001b6e60c8..62a65bbb4d171485919784f2dc4cd1a518071dba 100644 (file)
@@ -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
index 28256fbd60ed5176f278a9ea646cbb05ceebd069..d0146bd9a9829bd6dc279b0a0eea2a092070c91a 100644 (file)
@@ -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: Целокупно утрошено време
index dace2c47e57d215ca6bf1883260ccd3bd8466a1d..b55d2a2a0a019f532d05cc8c5283083e8ddbd3db 100644 (file)
@@ -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
index 399eeb4af17568511967613a11c1911c1ec966e7..1b1e6ec1a97c7d266e0f7b47c2b1026ed906adfe 100644 (file)
@@ -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
index ef9ad992c5995ddaddc79dbf3c0dd0fc2f119392..e42b8613498cec41f85378a0fcf2c22dbcb960d4 100644 (file)
@@ -1163,3 +1163,4 @@ tr:
   label_member_management_all_roles: Tüm roller
   label_member_management_selected_roles_only: Sadece bu roller
   label_password_required: Devam etmek için şifrenizi doğrulayın
+  label_total_spent_time: Toplam harcanan zaman
index a5eb003d05df0d490ce076006c7cc0bc95de6473..c3714bed0227f1dde35892a855434b1d001c4f20 100644 (file)
@@ -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
index 0496cbcf28fe53b35250c64324feb8fe58b4557f..dad4e0af85cbf6a59cae2a5200b8149c590ba4bd 100644 (file)
@@ -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
index 2d38033dd611ce61eef13944844a836a573d40d6..98dd0bc33e3612e26f49c567741f244b098fc136 100644 (file)
   description_date_from: 輸入起始日期
   description_date_to: 輸入結束日期
   text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。<br />一旦儲存之後, 代碼便無法再次被更改。'
+  label_total_spent_time: 整體耗用工時
index eafbe3ae6772cd8439ec596de95133d0ace5ce85..592b97e8f9db07c5a25282c36a3eeae07f983ab8 100644 (file)
@@ -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: 总体耗时
index 0958607030710592c34885147040478c96d06d08..6d106e88b3ad53a2b89ba400d50ffa4916561f12 100644 (file)
@@ -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)