fernandokosh / redmine_time_tracker

A time tracker plugin for Redmine
Other
203 stars 139 forks source link

pause time tracker #31

Closed craigspamgoeshere closed 13 years ago

craigspamgoeshere commented 13 years ago

sometimes I have to take a break, or get interrupted. I don't want to log the time with a comment just yet as I will return to the task, but I do need to stop the clock temporarily.

How hard would it be to 'pause' the current time tracker? It seems like you have to add another time tracker to track the paused time, and then subtract them all when the timer was stopped.

thanks for your efforts.

delaitre commented 13 years ago

Well, this is somewhat related to #8, much easier though. Indeed, this is a required step to accomplish #8 thus it might be implemented.

This is not very hard, you just have to add a total_time countiner is the time tracker. When you start the tracker, you retrieve the current time. When you pause it, you add (current time - start time) to the total_time.

craigspamgoeshere commented 13 years ago

what about if I pause it multiple times?

delaitre commented 13 years ago

Pausing multiple time is simply a sequence of starting -> pausing. In the start function, you save the current time. In the pause one, you add the difference between the current time and the one you saved to a total "time spent" attribute. This way, you will be able to start/pause the tracker any time you want.

Maybe I was not clear the first time: this is not implemented yet, but one can do it as I explained.

craigspamgoeshere commented 13 years ago

i see you will have to add a colunm to the database, but the codebase is small and this wouldn't be a big patch. I do not know ruby or I would attempt it myself

delaitre commented 13 years ago

Well,

I have started hacking on this feature yesterday however I can't install redmine anymore on my system for a mysterious reason... I need to fix this before finalizing my patch...

delaitre commented 13 years ago

This is implemented in master.

craigspamgoeshere commented 13 years ago

thanks, I was able to get this working.

I had to run sudo /opt/bitnami/ruby/bin/rake db:migrate_plugins RAILS_ENV=production to get it installed properly. Also the entry for the "Time Tracker" menu option was missing from the english language file.

delaitre commented 13 years ago

Yes, there is a new migration script to run as I had to add new columns in the table. The english language file as already been updated too.