Project

General

Profile

Actions

Defect #35134

closed

Change total spent time link to global time entries when issue has subtasks that can be on non descendent projects

Added by Dmitry Makurin over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Parent issue displays total spent hours. It includes self time entries and all of subtasks and also gives user a link to time_entries controller. Link leads to time_entries inside a parent issue project so if any of subtask will be in different project than parent you won't see it.

Issue.total_spent_hours does not filter time entries by a project.

I guess it's more natural to give link to time_entries instead projects/:id/time_entries.

Index: app/helpers/issues_helper.rb
<+>UTF-8
===================================================================
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
--- a/app/helpers/issues_helper.rb    (revision ad087516f4f11bb530ea96777e3edc32940e323b)
+++ b/app/helpers/issues_helper.rb    (revision 3c8f6a9152e28c5057710f68b13559db56990dbf)
@@ -259,7 +259,7 @@

   def issue_spent_hours_details(issue)
     if issue.total_spent_hours > 0
-      path = project_time_entries_path(issue.project, :issue_id => "~#{issue.id}")
+      path = time_entries_path(:issue_id => "~#{issue.id}")

       if issue.total_spent_hours == issue.spent_hours
         link_to(l_hours_short(issue.spent_hours), path)


Files

Actions

Also available in: Atom PDF