hicknhack-software / redmine_time_tracker

A time tracker plugin for Redmine
Other
106 stars 32 forks source link

Better integration into Redmine’s native time tracking #164

Closed rbugajewski closed 7 years ago

rbugajewski commented 10 years ago

It would be really great if the plugin’s UI (e.g. Reports) would also display time logs from Redmine’s native time tracking functionality. This currently works in one direction (the plugin’s booked entries are for example shown in Redmine’s report), but not the other way around. From my limited knowledge of the Redmine source code I guess that there’s simply no start / stop date / time model and that it only saves the day + amount of time spent. The plugin added this in separate tables. Please correct me if I’m wrong. One could solve this feature request by marking the time bookings with a dash or something similar for that purpose.

I love to work with the TimeTracker plugin, but I also use mobile apps or other plugins like Redmine Harvest integration that work with Redmine’s native functionality. This way you still could use 3rd party tools and see the project, activity, date, issue, comments & time spent in the Overview, Bookings & Reports sections.

Is this something doable or would it be – code-wise – very messy?

arBmind commented 10 years ago

A very good point. We decided to mark the times the plugin tracks and exclude the other times. This helps us to generate reports and other views more easily.

We never tried to work with both models. I would guess it's doable. If done right the code should stay manageable.

I would be happy to see a merge request for this enhancement.

rbugajewski commented 10 years ago

Do you have a generalized idea how this could be done?

I’m not (yet) familiar with the code base, but I would make the necessary changes.

arBmind commented 10 years ago

I guess there is a guarding scope somewhere. If you remove it, you should get time bookings from redmine and timetracker. The next step would be to enhance the views, so they can deal with the missing data.

I am looking forward for your pull request. :+1:

tvdeyen commented 10 years ago

Ok, I thought this is a bug (https://github.com/fernandokosh/redmine_time_tracker/issues/93).

It would be great if one could get a list of all tracked time entries not only the ones from the plugin.

tvdeyen commented 10 years ago

@arBmind may I ask, why you made the decision to differentiate between time entries made with the plugin and time entries booked manually? In my thinking, the plugin should only be an assitance to existing time booking. And the reporting must always include all booked time entries. It is very dangerous to loose tracked time.

Consider the following:

One user booked time the manual way, maybe through an external API (Redmine Phone app, etc) and another developer used the time tracking plugin. The project manager then wants to send the customer a report with an invoice. The manual booked time would be lost. This is not good and must not happen.

So I ask you to please revert your changes you made to this plugin and leave it as an assistance to default time tracking of redmine and don't build a separate system right in redmine. I know there are still the default reports of redmine. But what is the purpose of your custom build reports then, if they don't reflect the existing and only correct data?

I maybe have some time to look into this and remove your guarding code. A hint where to look would be great.

Thanks for your considerations.

tvdeyen commented 10 years ago

Related with #176

tvdeyen commented 10 years ago

Yesterday I took a deeper look into the code and the wiki of this plugin.

The tt_reporting_controller loads TimeBooking records. Totally legit, because of the new architecture of this plugin, that supports time tracking independently from project and issue. I also discovered, that this plugin works even with disabled Redmine's build in time tracking. So, I guess this a good way to not mess up both systems and not confuse the users.

But, to make this a complete independent time tracking solution there are some points missing:

It should be possible to book time manually. There are times where a developer simply has forgotten to start the clock and wants to book time afterwards. Maybe even through an external client (i.e. Redmine App for iPhone). So, if we disable the build in time tracking, that would not be possible any more.

I think a solution could be to hook into Redmine's TimeEntry model and create a TimeBooking afterwards. Or, as a second option, introduce a button to manually create a TimeBooking in the plugins interface. The downside of this solution would be that no external API could create valid time bookings anymore. So I would vote for first option.

What do you think?

jume-dev commented 10 years ago

We are definitly planing to enhance the integration with redmines timetracking. I think option one is the way to go, if its possible. I am not sure, if redmine offers a hook for that. Sadly i won't have time to add this soon, so we are open for pull requests :)

rbugajewski commented 10 years ago

@tvdeyen I fully agree. One of the biggest usability problems I currently have with the plugin is that there is no option to arbitrarily log time, like the author wouldn’t trust his employees and put obstacles in the way. I think that a better integration or an update to the current behavior would solve this issue.

jume-dev commented 10 years ago

@rbugajewski well, if this is your problem, simply assign your employes the permissions to edit their timetrackings and logs, and your problem is gone. They can simply start a timetracker and change the start time to whatever they want. Otherwise start and immediately stop a timer. Afterwards, edit the start and stop time according your needs.

tvdeyen commented 10 years ago

Unfortunately this is not so easy as you say Robert.

First the user has to manipulate start and/or end time. That is error prone and not very user friendly and I would consider this a hack. Especially because Redmine has the ability to book time manually. That's why I presumed to add an after_create hook into the TimeEntry model.

Second: Often the plugin complains about overlapping or not correct time. We even once had the problem that time was lost without any warning at all! Just because the rounding set the time to zero.

Another problem is, that if one wants to book 15 minutes, but only 5 minutes passed and one wants to start the timer again, the plugin waits the amount of time, that was booked in advance. And only starts to track again, if the correct time was reached. That's why we turned of the rounded for now.

All understandable and correct, if one wants a very restrictive and very correct time tracking. But this is not always what people want.

So maybe it should be adjustable through the plugin settings?

And to manually book time would be mandatory for us.

jume-dev commented 10 years ago

Well, i don't see why editing start and/or endtime is less error prone and less user friendly as manually book time throught standard redmine. In Fact, just set your start time and enter a time period of your choice. stop time will be adjusted accordingly, so nothing hard there imo.

If you enable rounding, it should be obvious what it does, and there are settings for this. just put the limit for rounding up to one or even zero and time will always be rounded up or disable rounding at all.

Honestly, i don't see a real world use case, where you want to book 15minutes for a project, if you only worked for 5 minutes and want to work further on the same project. Isn't that kinda double booking and some sort of tricking your costumers or whoever pays for your work time?

As @mstarke said in the other ticket, this plugin serves in first place our needs. And when we make reports for costumers it's kinda good, if there is no overlapping time. So the plugin does that for you.

Manually time tracking will come probably, but as said above, i can't say, when we manage to find the time.

rbugajewski commented 10 years ago

As @tvdeyen already said, this is not so easy @jume-dev (see #104 for slightly related information). Modification of time logs is very clunky and restrictive at the moment. I’m already the manager of the project and have all rights, but modification is sometimes not possible.

When you start a time log you can only set the start time and start date. When I want to book time for yesterday, I have to do the following steps:

  1. Start a timer
  2. Set the start date & start time to a day in the past; it I e.g. forgot to track time three days ago and want to add it now I need to create a time log that will be about 72 hours long.
  3. Stop the timer.
  4. Modify the logged time (basically adjusting the time spent) and book it.
  5. Fight with the remainder and error messages (deleting the time log would result in negative bookable time, bla bla)
  6. Go into a SQL-Interface and delete the time log manually from the database.

There should be an interface where I can directly book time (e.g. some greyed out text fields with stop date and / or time and a checkbox that would let me directly set a date in the past).

jume-dev commented 10 years ago

Well, you should be aware that time trackings longer as 24h are not well supported at the moment. Please stick to using trackings with less than 24h duration.

Another problem is, that deleting a timelog with multiple bookings from it, is extremly buggy. See #171 for this.

So please use deleting of timetracking with some bookings attached to it extremly cautious for now, till we fixed it. If you by any means need to remove some time tracking between 2 bookings, create multiple trackings.

We will fix this situation in the near future.

rbugajewski commented 10 years ago

@jume-dev I don’t want to use time logs longer than 24 hours. But how can I for example book three hours (from 11am to 2pm) for the last Thursday without adding such long time logs and without splitting them?

mstarke commented 10 years ago

The method you describes is the way to go. But you can overcome some of the bugs by doing it in a different fashion. That's the way I book times in the past and it worked for me quite nicely (since I do this just once or twice a month, I do not mind the effort, might be different for you).

What I do is just "start-stop" the timer without rounding enabled. This creates a >1sec time log, I edit start/stop time (one needs "can edit own time logs"-permission) of the time log and after that just book it. By this method you overcome any problems that might arise with >24h logs, given that you actually set start and end time correctly.

It's a bit long but works. This clumsiness comes with the splitting of bookings and time logs. We might be able to streamline such a use case a bit.

rbugajewski commented 10 years ago

Thanks @mstarke, I’ll try this the next time I have time to book from the past. This sounds like a feasible workaround. I would really love to contribute to the plugin, but I’m very busy now and in the upcoming months.

kusmierz commented 9 years ago

any news here?

arBmind commented 9 years ago

No news so far. The workaround described before works for us. We see the need for a better interface. I hope we find time next month.

tvdeyen commented 9 years ago

Everybody searching a Redmine 2.x compatible version of the original plugin, use this plugin: https://github.com/speedy32129/time_logger

It works just like expected. It logs time and is perfectly integrated into the build in time tracking of Redmine, no extra stuff, just time logging, period. Finally!

jume-dev commented 7 years ago

Alright, for everyone who still wants to use our plugin with the enhanced mechanism, we finally managed to clean things up and created a completely new version. While we don't have all features here requested in it yet, we have atleast the manually booking in place, but the code is now way better than before and adding new features is faster done. The use of redmines own time entries without attached booking is planned and will be eventually added some day, but we also plan on creating an own desktop and mobile app to make use of the new api we designed.

EDIT: Oh and we also fixed that nasty overlapping bugs, it should be more concise now when and why errors appear.

rbugajewski commented 7 years ago

Awesome work, thank you very much!

Is the migration from this plugin to the new Redmine Hourglass Plugin reliable and does it migrate everything the older plugin created (including comments)?

jume-dev commented 7 years ago

yeah that should work. I made it so, that you can install both parallel, import them from the older one, check if everything is alright and remove the old plugin after.