summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 10:28:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 10:28:48 +0000
commitcb985627e2a00519f1340a5230e1a36bbc8cbfb6 (patch)
tree221af94ff9e298cbf15a08f96d0e14c7af701995
parent0554e1f3cb3b47efe6da858113ec4acc0e8f3d3c (diff)
downloadredmine-cb985627e2a00519f1340a5230e1a36bbc8cbfb6.tar.gz
redmine-cb985627e2a00519f1340a5230e1a36bbc8cbfb6.zip
Show visible spent time link for users allowed to view time entries (#20661).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@16292 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb5
-rw-r--r--app/views/issues/show.html.erb2
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 0f66f27fb..efd221087 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -101,6 +101,11 @@ class IssuesController < ApplicationController
@changesets.reverse!
end
+ if User.current.allowed_to?(:view_time_entries, @project)
+ Issue.load_visible_spent_hours([@issue])
+ Issue.load_visible_total_spent_hours([@issue])
+ end
+
respond_to do |format|
format.html {
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 9d767f0b1..e51124712 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -60,7 +60,7 @@
unless @issue.disabled_core_fields.include?('estimated_hours')
rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), :class => 'estimated-hours'
end
- if User.current.allowed_to_view_all_time_entries?(@project)
+ if User.current.allowed_to?(:view_time_entries, @project)
if @issue.total_spent_hours > 0
rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time'
end