Time Tracking plugin reborn

Post about your customizations to share with others.

Moderators: Developer, Contributor

mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Time Tracking plugin reborn

Post by mykbaker »

Hello All,

We have used Elmar's time tracking plugin, originally for mantis 0.19.1, extensively in my group over the years (http://www.mantisbt.org/forums/viewtopic.php?f=4&t=589). I have been hacking it into the new versions of mantis over and over to keep it working but have finally converted it into a 1.2 plugin. With Elmar's permission I am including it in this post. Hopefully it will be of some value to others as well. If you do use it, please contact me if you have any problems or feature requests as I will be maintaining it for Elmar from here on out.

Differences from the original:
- I removed the cost options as we don't use them.
- I added support so users can only delete their own entries.
- I added a jump to Time Tracking link at the top of the issue view page.
- Standard plugin additions, new table name, security and configuration page.

Differences from timecard plugin and the built in time tracking:
- We needed to be able to record the date with the time. This allows us to go back and enter or fix old times. We have the table linked to some internal charting tools that make this feature very useful.

Message to the MantisBT Team:
Great job! Mantis is an excellent application and a very valuable open source offering. More than that, it has been well designed and coded. I have always enjoyed working in the Mantis code for various internal customizations but now, having learned the plugin API, I am even more impressed. A well thought out design worthy of review as a prime example of PHP coding. Keep up the good work! :)

Regards,
Mike Baker
Attachments
TimeTracking-1.0.0.zip
(13.6 KiB) Downloaded 888 times
dregad
Developer
Posts: 75
Joined: 26 Jul 2010, 14:24

Re: Time Tracking plugin reborn

Post by dregad »

Hi Mike,

Thanks for the plugin. Just a thought, not having looked at it in detail yet (I'll do it later as time allows) it may not make sense, but to avoid multiplication of similar plugins, would it not have been better to improve the existing timecard plugin by merging/adding your functionality on top ?

In any case, with regards to maintaining the code, I'd like to suggest that you put the source code on Github, as we have a specific repository for plugins hosting and it would be best to have it there. Send a message to the mailing list to request access.

And thanks for your kind message !

Damien
mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Re: Time Tracking plugin reborn

Post by mykbaker »

Hi Damien,

It is very possible that adding this functionality to the timecard plugin would have been the best route. Since my coworkers are used to this and because I had not worked on a plugin before I decided to make this into it's own plugin. I am unclear on the future of the time tracking features, is the timecard plugin going to become the official time tracking plugin for 1.3 and higher? If that is the case then I should probably add the functionality I need there to consolidate code.

One thing I do like about this plugin over timecard is that it creates it's own section on the issue edit page instead of trying to add the times to the notes area. Maybe there is a reason for that but it seems cleaner to keep it in it's own section.

thanks,
Mike
dregad
Developer
Posts: 75
Joined: 26 Jul 2010, 14:24

Re: Time Tracking plugin reborn

Post by dregad »

I quite like the design.

Comments and bugs:
  1. the code does not consistently follow the MantisBT coding conventions, e.g. with regards to spacings, variable names, etc - you might want to align to that
  2. System allows entry of negative hours - is that intentional ?
  3. users can only delete their own time entries (which is fine, except that the label "Delete Threshold" is somewhat misleading, maybe "Delete Own Threshold" would be clearer.
  4. The plugin does not allow a manager/admin to delete other user's entries; I think you missed a test condition in the if statement at line 142, something like

    Code: Select all

    || access_has_bug_level( plugin_config_get( 'admin_threshold' ), $p_bug_id )
    
  5. For me the "information" field is quite useless as it is - I'd much rather have a possibility to link to an existing bugnote (and have an option to make that link mandatory - in my company it is not allowed to book time without some comments as to what was done). Did you think about the possibility to record time entry at the same time (i.e. within the same form) as the bugnote ?
  6. History is not consistently updated
    • Adding time entry is not logged in history (use of undefined $bug_id variable, should be $f_bug_id)
    • Deleting time entry - you should not concatenate "Delete" with the field name
    • Format of old/new value is not consistent between Add/Delete
    • You should use the plugin_history_log function, instead of history_log_event_direct

      Code: Select all

      plugin_history_log( $f_bug_id, 'history', '', "$f_day.$f_month.$f_year: $t_time_value h.", $user );
      
    • When deletion done by admin, should log the name of user who initially filed the time entry too
  7. Missing a global report function to view time tracking for a given project
That's it for now. Hope this helps

Damien

You may also want to request to the mailing list, that a new project is created in http://mantisbt.org/bugs to track issues.
mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Re: Time Tracking plugin reborn

Post by mykbaker »

This is excellent, thank you for the feedback. I will update when I get a chance.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Time Tracking plugin reborn

Post by cas »

We also used that same version and I also converted it to a plugin, see attached
Attachments
TimeTrack.zip
(47.82 KiB) Downloaded 751 times
mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Re: Time Tracking plugin reborn

Post by mykbaker »

Okay, I will compare with what I have and save the best features of the two and then add you to the credits. If you want something other than cas in there send me a message. :)

Thanks.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Time Tracking plugin reborn

Post by cas »

No need for credits, as long as we get the best plugin :mrgreen:
Merengues
Posts: 2
Joined: 22 Aug 2011, 14:18

Re: Time Tracking plugin reborn

Post by Merengues »

thanx for the plugin. gonna try it
Shop For Spy Earpiece To Become Successful In The Exams
how to buy spy earpiece http://www.reema.fr/wakka.php?wiki=spyearpieceset
euerabi
Posts: 4
Joined: 10 Oct 2011, 14:52

Re: Time Tracking plugin reborn

Post by euerabi »

Hi,

i just discovered mantis few days ago, its great.

I started using the mylyn plugin to get my tasks shown in eclipse.

Are there any chances to get the mylyn connector (plugin) to work with this plugin? Mylyn already tracks the time you spend on a task, so the time recorded in mylyn should be uploaded too.

This would be a perfect setup.
mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Re: Time Tracking plugin reborn

Post by mykbaker »

I was also thinking integration with the Mylyn plugin would be really nice. I have looked into it a little and the Mylyn plugin is using the soap interface to communicate with Mantis. I've asked about an extension to that interface for plugins to use but as of yet there isn't anything in place. I haven't had much time to take it any further than that, but once an interface is in place I think it would be a fairly simple change.
euerabi
Posts: 4
Joined: 10 Oct 2011, 14:52

Re: Time Tracking plugin reborn

Post by euerabi »

Yes, I did not think of the fact that plugins may have no access to the interface.

This would be a great improvement for the project.

Btw, where do you release new versions? I downloaded the one from the post here.
euerabi
Posts: 4
Joined: 10 Oct 2011, 14:52

Re: Time Tracking plugin reborn

Post by euerabi »

Hi,

sry for doublepost, just wanted to link to my question at the dev board of the connector:

http://sourceforge.net/apps/phpbb/mylyn ... 8e6efd2b18

I somehow could not find the timetracking feature of the core mantis.

Edit: i found it now, and it works almost like i want it to. It just does not upload the time tracked with mylyn, you must type in the time manually.

By the way, didnt have time to test much, whats the main difference or advantage of this plugin compared to the core time tracking?
mykbaker
Posts: 16
Joined: 02 Jul 2009, 13:14

Re: Time Tracking plugin reborn

Post by mykbaker »

The main repository for the timetracking plugin can be found at:

https://github.com/mantisbt-plugins/timetracking

This is the initial plugin that I created from pieces found in the forums. There is also another link about halfway up this post that cas created. My goal is to integrate these two plugins so we can move forward with one but I have not had time yet.

The main differences between this plugin and the built in functionality are the data is not integrated with the notes function and you can modify the date of the time posting. I find I don't always get the time entered on the day the work was performed. We have an internal charting system at my company that we use to view the data so we need it to be correct.

I have heard that the built in time tracking functionality is slated for removal in the next version (3.0?) and will be replaced with a plugin.
euerabi
Posts: 4
Joined: 10 Oct 2011, 14:52

Re: Time Tracking plugin reborn

Post by euerabi »

Can someone confirm that this functionality is gonna get removed from the core? Is there a place where such plans are defined?
Post Reply