Feature #3848

Allow the current user to record the time spent by another one.

Added by Cedric VINCENT over 8 years ago. Updated over 1 year ago.

Status:NewStart date:2009-09-11
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Time tracking
Target version:-
Resolution:

Description

This patch allows the current user to record the time spent by another one, as you can see in timelog1.png and timelog2.png I wrote this patch because my co-workers are too lazy busy to update their issues ;)

I never programmed in Ruby before this patch, so feel free to rewrite it at your convenience. Maybe an exception should be thrown in the controllers if the current user tries to edit a time entry he is not allowed to, even if it is already checked in the views.

timelog1.png (18.2 KB) Cedric VINCENT, 2009-09-11 15:59

timelog2.png (10.8 KB) Cedric VINCENT, 2009-09-11 15:59

0001-Allow-the-current-user-to-record-the-time-spent-by-a.patch Magnifier (5.14 KB) Cedric VINCENT, 2009-09-11 15:59

0002-Access-params-time_entry-only-if-editing-a-time-entr.patch Magnifier (1.1 KB) Cedric VINCENT, 2009-09-21 16:48

0003-Allow-to-change-the-owner-a-protected-attribute-of-a.patch Magnifier (1.06 KB) Cedric VINCENT, 2009-09-21 16:48

Allow-the-current-user-to-record-the-time-spent-0.9.3.patch Magnifier - For redmine-0.9.3 (4.73 KB) Oleg Volkov, 2010-03-14 09:11

time-spent-by-another-user-v.0.1.path - For redmine-0.9.3 (4.02 KB) Oleg Volkov, 2010-03-14 11:44

time-spent-by-another-user-v.0.2.patch Magnifier (2.64 KB) Oleg Volkov, 2010-03-18 12:04

log-time-for-another-user.diff Magnifier (3.25 KB) Jack T, 2011-03-21 08:45

patch-3848_log-time-for-others-users-ld.diff Magnifier (3.37 KB) Lars Dornheim, 2011-08-05 05:57

log-time-for-other-users.diff Magnifier - Allow users with permission for edit time entries to log time for other users. (5.71 KB) Bishma Stornelli Ortega, 2013-03-13 18:36

log-time-for-other-users.diff Magnifier (5.52 KB) Gary Watson, 2013-07-08 23:12

log-time-for-other-users.diff Magnifier (4.47 KB) Paul Freund, 2014-02-18 14:42

redmine_foreign_timelog.patch Magnifier (3.07 KB) Patrik Halfar, 2015-01-29 23:05

redmine_3_2_log_time_for_others.patch Magnifier (3.65 KB) Andor Tóth, 2016-07-29 13:25


Related issues

Related to Redmine - Feature #7239: Allow some users to add / edit time entries on behalf of ... New 2011-01-06
Related to Redmine - Feature #6486: Log time for other users Closed 2010-09-25
Related to Redmine - Feature #9276: Log Time on an issue assigned to other New 2011-09-19
Related to Redmine - Feature #8505: Log Time for Multiple Users New 2011-06-02
Duplicated by Redmine - Feature #10753: Abiliy to log time spent for other user Closed
Duplicated by Redmine - Feature #27328: edit the time of the user Closed

History

#1 Updated by Cedric VINCENT over 8 years ago

Patch to apply against redmine-0.8.4

#2 Updated by Eric Davis over 8 years ago

  • Category set to Time tracking

Thank you, that's a good feature. We'll need to update the patch to apply to trunk. I'm not sure if the edit time entries permission should be used or if a new one should be created.

#3 Updated by Jean-Philippe Lang over 8 years ago

I think a new permission would be required if we add this feature.

#4 Updated by Cedric VINCENT about 8 years ago

Oops! There are two bugs in the previous patch, here come the corresponding fixes:

  1. Access params[:time_entry] only if editing a time entry. It fixes the error "ActiveRecord::RecordNotFound".
  2. Allow to change the "owner" of a time entry. Previously, the "owner" was not changed because it is a protected attribute.

Cheers,
Cedric.

#5 Updated by Oleg Volkov almost 8 years ago

You can update the patch to version 0.9.3?

#6 Updated by Oleg Volkov almost 8 years ago

This patch is not entirely correct, since there is no information who (instead of the user) has made him the information. In addition, there is a need to create new questions and make comments from another user. Both questions are needed when the user is not possible to do it yourself, and he asked the operator to do so by phone.

#8 Updated by Oleg Volkov almost 8 years ago

This path is changed:
1. Allow change user only entry/edit "Spent time" (http://www.redmine.org/attachments/2520/timelog1.png) and disabled from Issue Update (http://www.redmine.org/attachments/2521/timelog2.png).
2. Select only users with permission to add record time. (Excluded admin!)

TODO: Logged real user name.

#9 Updated by Oleg Volkov almost 8 years ago

I created a new version of the patch.
The patch is shorter.

#10 Updated by Arnaud Lesauvage almost 7 years ago

I'm very interested in this patch. Is the patch submitted by Oleg still working ?
We are running redmine against trunk r4359.

I still think this is a very useful feature. In our company, we have projects where the workers do not encode their spent times themselves.
Eric and Jean-Philippe both have shown interest in this so I am hopeful in seeing this integrated in trunk ?

#11 Updated by Jack T over 6 years ago

Updated Oleg's patch to work on Redmine 1.1.0.

I'm new to Redmine, and one of the updates I made to Oleg's patch was in app/controllers/timelog_controller.rb, I made changes to both def new and def create sections instead of @def edit.

#12 Updated by Lars Dornheim over 6 years ago

The last patch did not work for my Redmine 1.1.0.stable.4761, so I adapted it a little bit to work with my Redmine. Furthermore editing of the user field of existing time logs now works for me, too.

#13 Updated by Pavel Potcheptsov about 5 years ago

Is there any plan to include this in current?

#14 Updated by Pavel Potcheptsov almost 5 years ago

this worked for 1.3.3
but unfortunately last patch doesn't work with current 2.x.x
any suggestions?

#15 Updated by Bishma Stornelli Ortega almost 5 years ago

I update the patch to work with version 2.2.1. I haven't tested in any other version.

Some changes were added. In a nutshell, this patch does:

  • Allow users with permission :edit_time_entries to log time in a project for another user assigned to that project and with permission to log time.
  • Since an admin does not need to be assigned to a project to log time in it, he/she will be added to the select list of users as "<< me >>"
  • The label << me >> will appear in the select list if the available users include the current user (or if current user is admin as mentioned before).
  • These log can be done either through /projects/identifier/time_entries/new or when updating an issue. Maybe I'll add later the option to update through /time_entries/new but it will require a little adittional work.

Let me know if you find any bug.

#16 Updated by Toshi MARUYAMA almost 5 years ago

  • Tracker changed from Patch to Feature

#17 Updated by Daniel Felix almost 5 years ago

Maybe this could be a candidate for 2.4?

#18 Updated by Cassiano Monteiro over 4 years ago

Agreed. This is definitely something I need (my co-workers are very lazy on logging their times).

#19 Updated by Gary Watson over 4 years ago

A slightly updated diff that works with redmine 2.3.1 There was a small modification I had to make by hand to get the patch to apply otherwise it's the same as the one produced by Bishma Stornelli Ortega that worked with 2.2.1

#20 Updated by Maximilian Schwerin about 4 years ago

The last patch requires ruby >= 1.9.2.

+1 for including this in asap

#21 Updated by Paul Freund almost 4 years ago

The patch from Gary Watson also works with version 2.4.2 if you remove the diff for issue.rb. I've attatched an updated patch. All use cases we tested worked but I can't guarantee it works in all.

#22 Updated by Pavel Potcheptsov over 3 years ago

Paul Freund wrote:

The patch from Gary Watson also works with version 2.4.2 if you remove the diff for issue.rb. I've attatched an updated patch. All use cases we tested worked but I can't guarantee it works in all.

is there any plan to include this functionality in trunk?

#23 Updated by Alex Dergachev about 3 years ago

I just threw together a hacky plugin that seeks to achieve the same thing
It doesn't check any permissions and probably has other bugs, but it works for us on redmine 2.6 without hacking core:

https://github.com/evolvingweb/redmine_timesheet_log_user

#24 Updated by Patrik Halfar almost 3 years ago

Hi all,
for latest version 2.6.1 I'm using following patch, is has origin in patch from this feature request, but include separete permisson, so it is possible permit this functionality for some roles only.

Intersting should be add functionality requested by #8505.

#25 Updated by Josh Ovett almost 3 years ago

We tested Patrick Halfars patch, Redmine_foreign_timelog.patch and it breaks redmine 2.6.1.

#26 Updated by Henry Auffahrt over 2 years ago

+1 is there a plugin for that?

Our Admin only want to implement plugins and no patch files. Thanks a Lot!

#27 Updated by Pavel Potcheptsov over 2 years ago

Unfortunately this path doesn't work in redmine 3.x.
If you select another person you want to log time for, you'll get time entries logged by yourself and not by that person.

#28 Updated by Alexander Ryabinovskiy over 2 years ago

We use this plugin http://www.redmine.org/plugins/redmine_work_time with Redmine 3.1.0. It allows to add / edit work time of another users. But it is not very simple, please add this functionality to Redmine core!

#29 Updated by Александр Скворцов almost 2 years ago

How select collection: assigned and current user only?

#30 Updated by Andor Tóth over 1 year ago

I have updated Patrik's patch for 3.2.0.stable.

#31 Updated by Toshi MARUYAMA about 1 month ago

Also available in: Atom PDF