Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding bottom total sum line

  • Loading branch information...
commit 4a2f5a7413552c00f75e5f3c656e2cdbce8ec5ea 1 parent 41dfdb4
Jan Schulz-Hofen authored
View
19 app/views/hooks/redmine_spent_time_column/_view_issues_index_bottom.html.erb
@@ -0,0 +1,19 @@
+<%
+ estimated_hours = spent_hours = calculated_spent_hours = divergent_hours = remaining_hours = 0.0
+ @issues.each do |issue|
+ estimated_hours += issue.estimated_hours ||0.0
+ spent_hours += issue.spent_hours ||0.0
+ calculated_spent_hours += issue.calculated_spent_hours ||0.0
+ divergent_hours += issue.divergent_hours ||0.0
+ remaining_hours += issue.remaining_hours ||0.0
+ end
+%>
+<p class="other-formats">
+ <strong><%= t :field_estimated_hours %>:</strong> <%= estimated_hours.round(2) %>,
+ <strong><%= t :label_spent_time %>:</strong> <%= spent_hours.round(2) %>,
+ <strong><%= t :label_calculated_spent_hours %>:</strong> <%= calculated_spent_hours.round(2) %>,
+ <strong><%= t :label_divergent_hours %>:</strong> <%= divergent_hours.round(2) %>,
+ <strong><%= t :label_remaining_hours %>:</strong> <%= remaining_hours.round(2) %>
+</p>
+
+
View
1  init.rb
@@ -1,5 +1,6 @@
require 'redmine'
require 'dispatcher'
+require 'redmine_spent_time_column/hooks'
Dispatcher.to_prepare do
Issue.send(:include, RedmineSpentTimeColumn::Patches::IssuePatch) unless Issue.include?(RedmineSpentTimeColumn::Patches::IssuePatch)
View
5 lib/redmine_spent_time_column/hooks.rb
@@ -0,0 +1,5 @@
+module RedmineSpentTimeColumn
+ class ViewHooks < Redmine::Hook::ViewListener
+ render_on :view_issues_index_bottom, :partial => 'hooks/redmine_spent_time_column/view_issues_index_bottom'
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.