From 0f9966aadf86d90cc9cad6059ff0d03870c2b9c4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 30 Jan 2017 17:47:39 +0000 Subject: [PATCH] Merged r16292 (#20661). git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16308 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 5 +++++ app/views/issues/show.html.erb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 01a127b5b..147d44097 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -112,6 +112,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 diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 70a7fe165..48a4d2464 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -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 -- 2.39.5