Patch #5441

Initialize TimeEntry attributes with params[:time_entry]

Added by Jérémie Delaitre over 11 years ago. Updated almost 11 years ago.

Status:ClosedStart date:2010-05-04
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:


Category:Time tracking
Target version:1.1.0


I've made a one-liner patch to fill the new TimeEntry attributes created in IssuesController#update_issue_from_param with the params[:time_entry].

This allows to pre-fill the spent time field when accessing the issue editing page.

I want to use this feature for my time tracker plugin. When the user stops his time tracker, I want to redirect him to the issue editing page to let him change what he wants (%done ratio for example) and enter a time log comment. However, I need to be able to fill the spent time field for him with the time tracker value.

time_entry_init.diff Magnifier (732 Bytes) Jérémie Delaitre, 2010-05-04 17:54

time_entry_init.diff Magnifier - Updated patch with functional test (2.14 KB) Jérémie Delaitre, 2010-10-26 19:44

time_entry_init.diff Magnifier - With working functional test (2.1 KB) Jérémie Delaitre, 2010-11-04 22:40

Associated revisions

Revision 4411
Added by Jean-Philippe Lang almost 11 years ago

Initialize TimeEntry attributes with params when editing an issue (#5441).


#1 Updated by Ludovic Gasc about 11 years ago

  • Assignee changed from Eric Davis to Jean-Philippe Lang


I valid this patch, it's useful with this plugin:
Moreover, some other plugins could use this feature to pre-populate the timesheet part in the edit form.

Somebody in the Redmine team could integrate this patch in the Redmine trunk ?

#2 Updated by Jérémie Delaitre about 11 years ago

I still need this patch (1 line!). Is there any chance to get it included?

#3 Updated by Jean-Philippe Lang about 11 years ago

Could you update the patch for current trunk and include a functional test ?

#4 Updated by Jérémie Delaitre about 11 years ago

I've updated the patch according to current github master.
The 'test_get_edit_with_params' functional test has been updated too to check the time_entry params.

#5 Updated by Jérémie Delaitre about 11 years ago

I forgot to ask you to execute the updated test as I'm not confident in my redmine installation...

#6 Updated by Jérémie Delaitre almost 11 years ago

Ok, I finally have a working redmine install for testing purpose. It appears that my previous patch contains a bug in the functional test. I fixed it in this new patch (which should be the last one!).

#7 Updated by Jérémie Delaitre almost 11 years ago

Any chance to have this included in 1.0.4 or 1.1.0 ?

#8 Updated by Jean-Philippe Lang almost 11 years ago

  • Status changed from New to Closed
  • Target version set to 1.1.0

Patch commited in r4411.
As it's not a fix, it won't be merged in 1.0-stable but in 1.1.

Also available in: Atom PDF