Opened 8 years ago

Last modified 7 years ago

#12627 closed enhancement

Call TracHoursPlugin directly instead of posting comments — at Version 7

Reported by: Robert Becker Owned by:
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords:
Cc: trac-hacks.org@… Trac Release:

Description (last modified by Robert Becker)

I have created a small patch which calls the corresponding method of TracHoursPlugin directly to post the worked time instead of creating a comment which is to be parsed by TracHoursByComment.

This may cause hours to be counted twice if WorkLogPlugin is set to create comments and TracHoursByComment is enabled. If noted in the wiki I think this is a rather light tradeoff for being able to skip comments at all. Alternatively the comment message could be changed to "worked X hours and Y minutes" which won't be parsed by TracHoursByComment. (Circumvented by changing the output format a bit if TracHours is enabled)

Change History (10)

comment:1 Changed 8 years ago by Robert Becker

Adding an attachment did not work:

Trac detected an internal error:
OSError: [Errno 13] Permission denied: '/srv/trac-hacks.org/trac/files/attachments/ticket/719/71924e41595afe78e108a402bff1b0b2334873e3'

I have uploaded the diff file here: http://pastebin.com/UQ5J8smT

comment:2 in reply to:  1 Changed 8 years ago by Ryan J Ollos

Replying to roben:

Adding an attachment did not work:

Trac detected an internal error:
OSError: [Errno 13] Permission denied: '/srv/trac-hacks.org/trac/files/attachments/ticket/719/71924e41595afe78e108a402bff1b0b2334873e3'

Should be fixed now. Could you please try uploading the attachment again to confirm?

Changed 8 years ago by Robert Becker

Attachment: manager.py.diff added

comment:3 Changed 8 years ago by Robert Becker

Confirmed, thanks :)

Changed 8 years ago by Robert Becker

Attachment: manager.py.2.diff added

comment:4 Changed 8 years ago by Robert Becker

I have updated the patch to disable the "Stopping work on this ticket to start work on #XXX." comment if comments are set to be disabled in the configuration.

comment:5 Changed 7 years ago by Robert Becker

*bump*

It would really be great if you could incorporate this patch which really improves the plugin's behaviour when no comments are desired.

comment:6 Changed 7 years ago by Ryan J Ollos

Owner: Colin Guthrie deleted

Changed 7 years ago by Robert Becker

Attachment: manager.py.patch added

I have updated my patch to add the comment message to the trachours log. Also, if comments are enabled, the worklog message will be added again, but with a decimal hours representation to prevent parsing.

comment:7 Changed 7 years ago by Robert Becker

Description: modified (diff)
Note: See TracTickets for help on using tickets.