Project

General

Profile

Actions

Patch #1582

closed

Add Time Spent Column to Issue List

Added by Eric Davis over 16 years ago. Updated almost 13 years ago.

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

0%

Estimated time:

Description

This patch adds a new column to the issues list, called Time Spent. It will be the total of all time logged on an issue.

Git patch applies successfully to r1618 using patch -p1

$ patch -p1 < ../../patches/add_time_spent_column_to_issues.patch 
patching file app/helpers/issues_helper.rb
patching file app/models/query.rb
patching file lang/en.yml

Files

add_time_spent_column_to_issues.patch (1.88 KB) add_time_spent_column_to_issues.patch Git version of the patch Eric Davis, 2008-07-04 18:40
add_time_spent_column_to_issues-svn.patch (1.9 KB) add_time_spent_column_to_issues-svn.patch SVN version of the patch Eric Davis, 2008-07-04 18:40
add_time_spent_column_to_issues-svn_r2823.patch (3.45 KB) add_time_spent_column_to_issues-svn_r2823.patch Patch for r2823 without colored values in "Time spent" column Chris Grieger, 2009-07-19 11:11
add_time_spent_column_to_issues_and_colored-svn_r2823.patch (4.18 KB) add_time_spent_column_to_issues_and_colored-svn_r2823.patch Patch for r2823 WITH colored values in "Time spent" column Chris Grieger, 2009-07-19 11:11
add_time_spent_column_to_issues_withpermissions.patch (10.7 KB) add_time_spent_column_to_issues_withpermissions.patch Yohann Monnier, 2010-09-15 14:42
spent_time_not_number_format.PNG (28.4 KB) spent_time_not_number_format.PNG Wrong number format in PDF export Boris Pigeot, 2010-09-23 12:09

Related issues

Related to Redmine - Feature #1787: Time Spent vs. Estimated TimeClosed2008-08-13

Actions
Related to Redmine - Feature #971: Add "Spent time" column to queryClosedJean-Philippe Lang2008-04-01

Actions
Related to Redmine - Feature #6503: Spent time column in issue listingClosed2010-09-27

Actions
Related to Redmine - Feature #8983: Spent time column available in issue listClosed2011-08-04

Actions
Actions #1

Updated by Mischa The Evil over 16 years ago

Eric, how does this patch relate to the patch provided by jplang in issue #971?

Actions #2

Updated by Eric Davis over 16 years ago

Mischa The Evil wrote:

Eric, how does this patch relate to the patch provided by jplang in issue #971?

Almost identical. Good eye.

Actions #3

Updated by Arndt Lehmann about 16 years ago

+1

Actions #4

Updated by Anonymous about 16 years ago

+2

Actions #5

Updated by Adam Tulinius almost 16 years ago

Hi,

We're using Redmine at our company, and would really like this patch (or something like it) to be included into Redmine, so we won't have to patch Redmine manually. :-)

Yours sincerily,
Adam Tulinius

Actions #6

Updated by Hans Kazan over 15 years ago

+2 i like this one. Especially that one can switch it on/off!

Actions #7

Updated by Richard Cooke over 15 years ago

Great patch, thank you!

How do I change it to show only two decimal places? At the moment some values are 8.2300000190735 in my issues list.

How difficult would it be to color spent time red, if spent time is greater than actual time?

Actions #8

Updated by Chris Grieger over 15 years ago

Updated the patch with the ability to sort by the "Time spent" column and added rounding to 2 decimal places.

patch -p0 < patches/add_time_spent_column_to_issues-svn_r2823.patch 
patching file app/helpers/issues_helper.rb
patching file app/models/issue.rb
patching file app/models/query.rb
patching file app/controllers/issues_controller.rb
patching file config/locales/en.yml

The 2nd patch also colors the spent hours red if > estimated hours.

Actions #9

Updated by Kirill Ponomarev over 15 years ago

I got error:

ActionView::TemplateError (comparison of Float with nil failed) on line #17 of issues/_list.rhtml:
14:     <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= css_issue_classes(issue) %>">
15:         <td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
16:         <td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
17:         <% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %>
18:     </tr>
19:     <% end -%>
20:     </tbody>

    app/models/issue.rb:229:in `>'
    app/models/issue.rb:229:in `spent_hours_colored'
    app/helpers/queries_helper.rb:56:in `send'
    app/helpers/queries_helper.rb:56:in `column_content'
    app/views/issues/_list.rhtml:17:in `_run_erb_47app47views47issues47_list46rhtml'
    app/views/issues/_list.rhtml:17:in `each'
    app/views/issues/_list.rhtml:17:in `_run_erb_47app47views47issues47_list46rhtml'
    app/views/issues/_list.rhtml:13:in `each'
    app/views/issues/_list.rhtml:13:in `_run_erb_47app47views47issues47_list46rhtml'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/capture_helper.rb:141:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/capture_helper.rb:141:in `capture_erb_with_buffer'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/capture_helper.rb:44:in `capture'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/form_tag_helper.rb:443:in `form_tag_in_block'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/helpers/form_tag_helper.rb:39:in `form_tag'
    app/views/issues/_list.rhtml:1:in `_run_erb_47app47views47issues47_list46rhtml'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:342:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:342:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template_handlers/compilable.rb:29:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template_handlers/compilable.rb:29:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/partial_template.rb:20:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:30:in `benchmark'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/partial_template.rb:19:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template.rb:22:in `render_template'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/partials.rb:110:in `render_partial'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:277:in `render'
    app/views/issues/index.rhtml:43:in `_run_erb_47app47views47issues47index46rhtml'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:342:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:342:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template_handlers/compilable.rb:29:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template_handlers/compilable.rb:29:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template.rb:35:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/template.rb:22:in `render_template'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_view/base.rb:248:in `render_file'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:1112:in `render_for_file'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:872:in `render_with_no_layout'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/layout.rb:251:in `render_without_benchmark'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:51:in `render'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/benchmark.rb:8:in `realtime'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:51:in `render'
    app/controllers/issues_controller.rb:69:in `index'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:131:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:131:in `custom'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:160:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:160:in `respond'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:154:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:154:in `respond'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/mime_responds.rb:107:in `respond_to'
    app/controllers/issues_controller.rb:68:in `index'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:1166:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:579:in `call_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/query_cache.rb:8:in `cache'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:529:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:529:in `process_without_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/session_management.rb:130:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/base.rb:389:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:149:in `handle_request'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:107:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:104:in `synchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:104:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_controller/dispatcher.rb:35:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/webrick_server.rb:112:in `handle_dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/webrick_server.rb:78:in `service'
    c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/webrick_server.rb:62:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/servers/webrick.rb:66
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:39
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    script/server:3

Rendering C:/redmine-0.8-stable/public/500.html (500 Internal Server Error)

Actions #10

Updated by Kirill Ponomarev over 15 years ago

I changed method in issue.rb and all works fine:

def spent_hours_colored(value)
  if value.nil? || estimated_hours.nil? || value <= estimated_hours
    return value
  else
    return "<FONT COLOR='RED'>"+value.to_s+"</FONT>" 
  end
end
Actions #11

Updated by Nikolay Kotlyarov over 14 years ago

  • Assignee set to Eric Davis

+1

Actions #12

Updated by David PVB over 14 years ago

+1
....

I got error using Redmine v 0.8.7

Error patching this file: app/controllers/issues_controller.rb

Looking at it, it's totally different...

Actions #13

Updated by David Parker over 14 years ago

+1

Actions #14

Updated by Mark Hagers over 14 years ago

+2 (one for me and one for my manager who is clamoring for just such a feature).
Do I understand correctly that the patches mentioned in this issue are no longer functional?
If not I'll have a go at trying them out first.

Actions #15

Updated by Bart Stuyckens about 14 years ago

+1

Actions #16

Updated by Yohann Monnier about 14 years ago

Hi All,

I updated the last patch colored time spent.

But i also update more files for security issues (there is a permission on viewing spent time, so we need to handle it in html view, csv and pdf)

I did not know how to make a regular patch with git, so i hope to find someone to apply this and post a svn patch for you.

It should work for the last version of redmine

Actions #18

Updated by Boris Pigeot about 14 years ago

Yohann Monnier wrote:

with attached file its better !

I try this patch, but maybe there is a bug in PDF export, number are not "all" formated correctly.
See the attachment:
0.2000000029802 in PDF file,
0.20 in Issue tab.

Actions #19

Updated by Anonymous about 14 years ago

+1 on including that into the trunk, that would be awesome!

Actions #20

Updated by Eric Davis about 14 years ago

  • Assignee deleted (Eric Davis)
Actions #21

Updated by Peter Horvath about 14 years ago

Hi,

I applied the patch listed in #17 post. Everything is working fine except that when i try to sort by spent_hours i got the following error.
My redmine version is 0.9.3
About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.5
Rails version 2.2.3
Active Record version 2.2.3
Action Pack version 2.2.3
Active Resource version 2.2.3
Action Mailer version 2.2.3
Active Support version 2.2.3
Edge Rails revision unknown
Application root /usr/share/redmine
Environment production
Database adapter mysql
Database schema version 20100221100219

About your Redmine plugins
Redmine Todo Lists plugin 0.0.4.2
Redmine Add Link plugin 0.0.1
Subtasks plugin 0.0.1

Query::StatementInvalid: Mysql::Error: Unknown column 'time_entries.hours' in 'order clause': SELECT `issues`.`id` AS t0_r0, `issues`.`tracker_id` AS t0_r1, `issues`.`project_id` AS t0_r2, `issues`.`subject` AS t0_r3, `issues`.`description` AS t0_r4, `issues`.`due_date` AS t0_r5, `issues`.`category_id` AS t0_r6, `issues`.`status_id` AS t0_r7, `issues`.`assigned_to_id` AS t0_r8, `issues`.`priority_id` AS t0_r9, `issues`.`fixed_version_id` AS t0_r10, `issues`.`author_id` AS t0_r11, `issues`.`lock_version` AS t0_r12, `issues`.`created_on` AS t0_r13, `issues`.`updated_on` AS t0_r14, `issues`.`start_date` AS t0_r15, `issues`.`done_ratio` AS t0_r16, `issues`.`estimated_hours` AS t0_r17, `issues`.`user_story_id` AS t0_r18, `issues`.`parent_id` AS t0_r19, `issues`.`lft` AS t0_r20, `issues`.`rgt` AS t0_r21, `issue_statuses`.`id` AS t1_r0, `issue_statuses`.`name` AS t1_r1, `issue_statuses`.`is_closed` AS t1_r2, `issue_statuses`.`is_default` AS t1_r3, `issue_statuses`.`position` AS t1_r4, `issue_statuses`.`default_done_ratio` AS t1_r5, `projects`.`id` AS t2_r0, `projects`.`name` AS t2_r1, `projects`.`description` AS t2_r2, `projects`.`homepage` AS t2_r3, `projects`.`is_public` AS t2_r4, `projects`.`parent_id` AS t2_r5, `projects`.`created_on` AS t2_r6, `projects`.`updated_on` AS t2_r7, `projects`.`identifier` AS t2_r8, `projects`.`status` AS t2_r9, `projects`.`lft` AS t2_r10, `projects`.`rgt` AS t2_r11, `users`.`id` AS t3_r0, `users`.`login` AS t3_r1, `users`.`hashed_password` AS t3_r2, `users`.`firstname` AS t3_r3, `users`.`lastname` AS t3_r4, `users`.`mail` AS t3_r5, `users`.`mail_notification` AS t3_r6, `users`.`admin` AS t3_r7, `users`.`status` AS t3_r8, `users`.`last_login_on` AS t3_r9, `users`.`language` AS t3_r10, `users`.`auth_source_id` AS t3_r11, `users`.`created_on` AS t3_r12, `users`.`updated_on` AS t3_r13, `users`.`type` AS t3_r14, `users`.`identity_url` AS t3_r15, `trackers`.`id` AS t4_r0, `trackers`.`name` AS t4_r1, `trackers`.`is_in_chlog` AS t4_r2, `trackers`.`position` AS t4_r3, `trackers`.`is_in_roadmap` AS t4_r4, `enumerations`.`id` AS t5_r0, `enumerations`.`name` AS t5_r1, `enumerations`.`position` AS t5_r2, `enumerations`.`is_default` AS t5_r3, `enumerations`.`type` AS t5_r4, `enumerations`.`active` AS t5_r5, `enumerations`.`project_id` AS t5_r6, `enumerations`.`parent_id` AS t5_r7, `issue_categories`.`id` AS t6_r0, `issue_categories`.`project_id` AS t6_r1, `issue_categories`.`name` AS t6_r2, `issue_categories`.`assigned_to_id` AS t6_r3, `versions`.`id` AS t7_r0, `versions`.`project_id` AS t7_r1, `versions`.`name` AS t7_r2, `versions`.`description` AS t7_r3, `versions`.`effective_date` AS t7_r4, `versions`.`created_on` AS t7_r5, `versions`.`updated_on` AS t7_r6, `versions`.`wiki_page_title` AS t7_r7, `versions`.`status` AS t7_r8, `versions`.`sharing` AS t7_r9 FROM `issues` LEFT OUTER JOIN `issue_statuses` ON `issue_statuses`.id = `issues`.status_id LEFT OUTER JOIN `projects` ON `projects`.id = `issues`.project_id LEFT OUTER JOIN `users` ON `users`.id = `issues`.assigned_to_id AND (`users`.`type` = 'User' OR `users`.`type` = 'AnonymousUser' ) LEFT OUTER JOIN `trackers` ON `trackers`.id = `issues`.tracker_id LEFT OUTER JOIN `enumerations` ON `enumerations`.id = `issues`.priority_id AND (`enumerations`.`type` = 'IssuePriority' ) LEFT OUTER JOIN `issue_categories` ON `issue_categories`.id = `issues`.category_id LEFT OUTER JOIN `versions` ON `versions`.id = `issues`.fixed_version_id WHERE (((issue_statuses.is_closed=0) AND projects.id IN (1,6,5) AND projects.status=1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))) ORDER BY SUM, issues.id DESC LIMIT 0, 25

ArgumentError (wrong number of arguments (1 for 0)):
/app/controllers/issues_controller.rb:545:in `delete'
/app/controllers/issues_controller.rb:545:in `query_statement_invalid'
/vendor/rails/activesupport/lib/active_support/rescuable.rb:73:in `call'
/vendor/rails/activesupport/lib/active_support/rescuable.rb:73:in `rescue_with_handler'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:61:in `rescue_action'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:138:in `passenger_orig_perform_action'
/usr/lib/ruby/1.8/phusion_passenger/railz/request_handler.rb:65:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:134:in `process_without_test'
/vendor/rails/actionpack/lib/action_controller/test_process.rb:18:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:392:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:184:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:112:in `dispatch_unlocked'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:125:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:in `synchronize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:134:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:41:in `dispatch'
/usr/lib/ruby/1.8/phusion_passenger/railz/request_handler.rb:50:in `process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:374:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:330:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:209:in `start'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61

Any help would be great

Thank you Peter

Actions #22

Updated by Maxim Strukov about 14 years ago

I make this changes:
app/models/query.rb
+ "QueryColumn.new(:spent_hours)," to @@available_columns

config/locales/en.yml
+ "field_spent_hours: Spent time"

If there is summary logged hours consist of 0.25 or 0.5 or 0.75 or 1.0, sum is displayed correctly rounded.
But if one of log times is 0.2 or 0.15 (does not consist of quarters) then sum look like 23.40000000596 or 0.30000001192093

Small example:

0.25 + 0.25 = 0.5
but 0.15 + 0.15 = 0.30000001192093

Why? Redmine 1.02 from SVN @4295

Actions #23

Updated by Maxim Strukov about 14 years ago

Maybe I fix this:

app/models/issue.rb
- @spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours", :include => :time_entries).to_f || 0.0
+ @spent_hours ||= self_and_descendants.sum("#{TimeEntry.table_name}.hours", :include => :time_entries).to_f.round(2) || 0.0

Actions #24

Updated by Jeremy Walker about 14 years ago

+1

Actions #26

Updated by Anton Nepomnyaschih about 14 years ago

It would be VERY good to have this in trunk! As PM i VERY want to see spent time versus estimated time. I should know - do we fit in our original estimation or not.

Actions #27

Updated by Loldo . about 14 years ago

+1

Actions #28

Updated by Evgeny Zhiryakov almost 14 years ago

+1

Actions #29

Updated by Luis Serrano Aranda over 13 years ago

Congratulation for your work I put the add_time_spent_column_to_issues_withpermissions.patch en my redmine and I think exists two bugs when I try to order the column redmine returns a blank page and if the column is visible and I try to export to pdf redmine fails

Actions #30

Updated by Luis Serrano Aranda over 13 years ago

This patch finally works the exportation I got it with the patch #3614, how I could add this field (spent_hour) to the queries ?

Thanks

Actions #31

Updated by Luis Serrano Aranda over 13 years ago

The permission dont work

Actions #32

Updated by Luis Serrano Aranda over 13 years ago

The probem are two plugins redmine show description an redmine default columns, all perfect thanks

Actions #33

Updated by Jared Fine over 13 years ago

+1

Actions #34

Updated by arthur me over 13 years ago

The patch applies for me. It would be great to add this to the issue view of subtasks. I'm using this primarily to get a roll up of estimates vs. actuals and having this on each set of subtasks would really help me get a snapshot the state of the project

Actions #35

Updated by Maxim Strukov over 13 years ago

How to paint Time Spent field at Issue card view?

Actions #36

Updated by Jérôme BATAILLE about 13 years ago

+1

Actions #37

Updated by Gustaf Friberg about 13 years ago

+1

It would be very nice to have this in the trunk. My interest is the same as many of the above: being able to compare estimated time vs spent time, by having a good overview.

Actions #38

Updated by Terence Mill about 13 years ago

+1 2TRUNK

Actions #39

Updated by Mischa The Evil about 13 years ago

As mentioned the first time by Tony Marschall in #8559 note-4, there exists a plugin which provides this feature (along with some others) implemented as it should (correctly checking permissions): Redmine spent time column. It's written by Jan Schulz-Hofen of plan.io.

I've started working on some improvements to make it better suitable for this issue in my fork of it:
https://github.com/MischaTheEvil/redmine_spent_time_column

Actions #40

Updated by Jean-Philippe Lang almost 13 years ago

  • Status changed from New to Closed

Superseded by r8073.

Actions

Also available in: Atom PDF