Time Tracking plugin reborn

Post about your customizations to share with others.

Moderators: Developer, Contributor

Time Tracking plugin reborn

Postby mykbaker » Aug 05, 2011 5:11 pm

Hello All,

We have used Elmar's time tracking plugin, originally for mantis 0.19.1, extensively in my group over the years (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 464 times
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby dregad » Aug 08, 2011 9:21 am

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
dregad
Developer
 
Posts: 28
Joined: Jul 26, 2010 9:24 am

Re: Time Tracking plugin reborn

Postby mykbaker » Aug 08, 2011 10:05 am

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
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby dregad » Aug 08, 2011 11:08 am

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.
dregad
Developer
 
Posts: 28
Joined: Jul 26, 2010 9:24 am

Re: Time Tracking plugin reborn

Postby mykbaker » Aug 08, 2011 11:16 am

This is excellent, thank you for the feedback. I will update when I get a chance.
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby cas » Aug 18, 2011 4:46 am

We also used that same version and I also converted it to a plugin, see attached
Attachments
TimeTrack.zip
(47.82 KiB) Downloaded 340 times
cas
 
Posts: 293
Joined: Mar 11, 2006 11:08 am

Re: Time Tracking plugin reborn

Postby mykbaker » Aug 18, 2011 10:29 am

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.
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby cas » Aug 18, 2011 1:48 pm

No need for credits, as long as we get the best plugin :mrgreen:
cas
 
Posts: 293
Joined: Mar 11, 2006 11:08 am

Re: Time Tracking plugin reborn

Postby Merengues » Aug 25, 2011 10:21 am

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
Merengues
 
Posts: 2
Joined: Aug 22, 2011 9:18 am

Re: Time Tracking plugin reborn

Postby euerabi » Oct 10, 2011 10:06 am

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.
euerabi
 
Posts: 4
Joined: Oct 10, 2011 9:52 am

Re: Time Tracking plugin reborn

Postby mykbaker » Oct 10, 2011 1:41 pm

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.
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby euerabi » Oct 11, 2011 1:11 am

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: Oct 10, 2011 9:52 am

Re: Time Tracking plugin reborn

Postby euerabi » Oct 11, 2011 1:25 am

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?
euerabi
 
Posts: 4
Joined: Oct 10, 2011 9:52 am

Re: Time Tracking plugin reborn

Postby mykbaker » Oct 11, 2011 1:23 pm

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.
mykbaker
 
Posts: 16
Joined: Jul 02, 2009 8:14 am

Re: Time Tracking plugin reborn

Postby euerabi » Oct 11, 2011 3:08 pm

Can someone confirm that this functionality is gonna get removed from the core? Is there a place where such plans are defined?
euerabi
 
Posts: 4
Joined: Oct 10, 2011 9:52 am

Next

Return to Customizations

Who is online

Users browsing this forum: No registered users and 6 guests