diff --git a/README.ja.md b/README.ja.md
index 3b52a7e..dec8d63 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -132,6 +132,8 @@ ViewCustomize = {
"issue": {
"id": 1,
"author": {"id": 2, "name": "John Smith"},
+ "totalEstimatedHours": 10.0,
+ "totalSpentHours": 11.5,
"lastUpdatedBy": {"id": 1, "name": "Redmine Admin"}
}
}
diff --git a/README.md b/README.md
index 7bcf61f..31d413c 100644
--- a/README.md
+++ b/README.md
@@ -137,6 +137,8 @@ ViewCustomize = {
"issue": {
"id": 1,
"author": {"id": 2, "name": "John Smith"},
+ "totalEstimatedHours": 10.0,
+ "totalSpentHours": 11.5,
"lastUpdatedBy": {"id": 1, "name": "Redmine Admin"}
}
}
diff --git a/init.rb b/init.rb
index 5369414..8214018 100644
--- a/init.rb
+++ b/init.rb
@@ -3,7 +3,7 @@
name 'View Customize plugin'
author 'onozaty'
description 'View Customize plugin for Redmine'
- version '3.4.1'
+ version '3.5.0'
url 'https://github.com/onozaty/redmine-view-customize'
author_url 'https://github.com/onozaty'
diff --git a/lib/redmine_view_customize/view_hook.rb b/lib/redmine_view_customize/view_hook.rb
index 5243aad..15e7fda 100644
--- a/lib/redmine_view_customize/view_hook.rb
+++ b/lib/redmine_view_customize/view_hook.rb
@@ -32,7 +32,9 @@ def view_issues_show_details_bottom(context={})
"author" => {
"id" => context[:issue].author.id,
"name" => context[:issue].author.name
- }
+ },
+ "totalEstimatedHours" => context[:issue].total_estimated_hours,
+ "totalSpentHours" => context[:issue].total_spent_hours
}
if context[:issue].last_updated_by.present?
diff --git a/test/unit/view_customize_view_hook_test.rb b/test/unit/view_customize_view_hook_test.rb
index 5b08608..096b1b2 100644
--- a/test/unit/view_customize_view_hook_test.rb
+++ b/test/unit/view_customize_view_hook_test.rb
@@ -3,7 +3,7 @@
class ViewCustomizeViewHookTest < ActiveSupport::TestCase
fixtures :projects, :users, :email_addresses, :user_preferences, :members, :member_roles, :roles,
- :issues, :journals, :custom_fields, :custom_fields_projects, :custom_values,
+ :issues, :journals, :custom_fields, :custom_fields_projects, :custom_values, :time_entries,
:view_customizes
class Request
@@ -170,7 +170,7 @@ def test_view_issues_show_details_bottom
@@ -193,7 +193,7 @@ def test_view_issues_show_details_bottom_with_journals
@@ -207,4 +207,27 @@ def test_view_issues_show_details_bottom_with_journals
end
+ def test_view_issues_show_details_bottom_with_time_entries
+
+ User.current = User.find(1)
+ issue = Issue.find(1)
+
+ expected = <
+//
+
+
+
+HTML
+
+ html = @hook.view_issues_show_details_bottom({:request => Request.new("/issues/1"), :issue => issue, :project => @project_onlinestore})
+ assert_equal expected, html
+
+ end
+
end