]> source.dussan.org Git - redmine.git/commitdiff
Merged r16292 (#20661).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 30 Jan 2017 17:41:54 +0000 (17:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 30 Jan 2017 17:41:54 +0000 (17:41 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16306 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
app/views/issues/show.html.erb

index a3cd8fb9fb4722167cd97ab5ad07a97f4bf59c65..91c196b589b5e3a8dfb43c7ca3acf2050dfb5e72 100644 (file)
@@ -111,6 +111,11 @@ class IssuesController < ApplicationController
     @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
     @relation = IssueRelation.new
 
+    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 {
         retrieve_previous_and_next_issue_ids
index 2cbff32e512ac19015ead0dd96052c40d0bfd64f..99bc8424d402fe357b12f028173f8ab61882dfa3 100644 (file)
@@ -62,7 +62,7 @@
       rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), :class => 'estimated-hours'
     end
   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