Project

General

Profile

Feature #34857 » 34857.patch

Felix Schäfer, 2021-03-08 17:01

View differences:

app/controllers/issues_controller.rb
59 59
          @issue_count = @query.issue_count
60 60
          @issues = @query.issues(:offset => @offset, :limit => @limit)
61 61
          Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
62
          if User.current.allowed_to?(:view_time_entries, nil, :global => true)
63
            Issue.load_visible_spent_hours(@issues)
64
            Issue.load_visible_total_spent_hours(@issues)
65
          end
62 66
        end
63 67
        format.atom do
64 68
          @issues = @query.issues(:limit => Setting.feeds_limit.to_i)
app/views/issues/index.api.rsb
19 19
      api.done_ratio  issue.done_ratio
20 20
      api.is_private  issue.is_private
21 21
      api.estimated_hours issue.estimated_hours
22
      api.total_estimated_hours issue.total_estimated_hours
23
      if User.current.allowed_to?(:view_time_entries, issue.project)
24
        api.spent_hours(issue.spent_hours)
25
        api.total_spent_hours(issue.total_spent_hours)
26
      end
22 27

  
23 28
      render_api_custom_values issue.visible_custom_field_values, api
24 29

  
(1-1/2)