##// END OF EJS Templates
Display time spent on the issue and the total time spent like estimated hours (#17550)....
Jean-Philippe Lang -
r13891:31bffaa053fc
parent child
Show More
@@ -114,11 +114,27 module IssuesHelper
114 114 end
115 115
116 116 def issue_estimated_hours_details(issue)
117 s = issue.estimated_hours.present? ? l_hours(issue.estimated_hours) : ""
118 unless issue.leaf? || issue.total_estimated_hours.nil?
119 s << " (#{l(:label_total)}: #{l_hours(issue.total_estimated_hours)})"
117 if issue.total_estimated_hours.present?
118 if issue.total_estimated_hours == issue.estimated_hours
119 l_hours_short(issue.estimated_hours)
120 else
121 s = issue.estimated_hours.present? ? l_hours_short(issue.estimated_hours) : ""
122 s << " (#{l(:label_total)}: #{l_hours_short(issue.total_estimated_hours)})"
123 s.html_safe
124 end
125 end
126 end
127
128 def issue_spent_hours_details(issue)
129 if issue.total_spent_hours > 0
130 if issue.total_spent_hours == issue.spent_hours
131 link_to(l_hours_short(issue.spent_hours), issue_time_entries_path(issue))
132 else
133 s = issue.spent_hours > 0 ? l_hours_short(issue.spent_hours) : ""
134 s << " (#{l(:label_total)}: #{link_to l_hours_short(issue.total_spent_hours), issue_time_entries_path(issue)})"
135 s.html_safe
136 end
120 137 end
121 s.html_safe
122 138 end
123 139
124 140 # Returns an array of error messages for bulk edited issues
@@ -63,7 +63,9
63 63 end
64 64 end
65 65 if User.current.allowed_to?(:view_time_entries, @project)
66 rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), issue_time_entries_path(@issue)) : "-"), :class => 'spent-time'
66 if @issue.total_spent_hours > 0
67 rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time'
68 end
67 69 end
68 70 end %>
69 71 <%= render_custom_fields_rows(@issue) %>
@@ -48,6 +48,10 module Redmine
48 48 l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => ("%.2f" % hours.to_f))
49 49 end
50 50
51 def l_hours_short(hours)
52 "%.2f h" % hours.to_f
53 end
54
51 55 def ll(lang, str, value=nil)
52 56 ::I18n.t(str.to_s, :value => value, :locale => lang.to_s.gsub(%r{(.+)\-(.+)$}) { "#{$1}-#{$2.upcase}" })
53 57 end
General Comments 0
You need to be logged in to leave comments. Login now