Modify ↓
#8696 closed enhancement (fixed)
When autostopstart is enabled, leave a comment on the active ticket
Reported by: | HumanInternals | Owned by: | Colin Guthrie |
---|---|---|---|
Priority: | normal | Component: | WorkLogPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
When the autostopstart option is enabled, it would be nice to leave a comment on the ticket the user was previously working on, saying that he stopped work in order to work on ....
Patch for the 0.12 version:
Index: worklog/manager.py =================================================================== --- worklog/manager.py (revision 10068) +++ worklog/manager.py (working copy) @@ -135,7 +135,7 @@ if self.config.getbool('worklog', 'autostopstart'): # Don't care if this fails, as with these arguments the only failure # point is if there is no active task... which is the desired scenario :) - self.stop_work() + self.stop_work_auto(ticket) self.explanation = '' @self.env.with_transaction() @@ -146,7 +146,9 @@ (self.authname, ticket, self.now, self.now, 0)) return True - + def stop_work_auto(self, new_ticket): + self.stop_work(comment='Stopping work on this ticket to work on #%s.' % (new_ticket)) + def stop_work(self, stoptime=None, comment=''): active = self.get_active_task() if not active: @@ -340,4 +342,4 @@ 'status': status, 'comment': comment}) return rv - \ No newline at end of file +
Attachments (0)
Change History (2)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Now that I think about that... not quite sure why I created that stop_work_auto() method - calling stop_work() directly with the comment argument makes more sense