﻿id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
10874,Reduce the estimated hours whenever a developer logs hours to a ticket,k1@…,bobbysmith007,"I'm using python 2.5 and trac 0.12.2

To visualize a burndown chart, I'm using estimationtoolsplugin.

Since timingandestimationplugin does not reduce the estimatedhours when a user logs hours to a ticket, the burndown chart does not decrease to zero. I've modified my local copy by replacing the following lines in ticket_daemon.py:
{{{
            ## If our hours changed
            if not hours == 0:                
                newtotal = str(totalHours+hours)
                save_ticket_change( db, ticket_id, author, change_time,
                                    ""hours"", '0.0', str(hours), self.log)
                save_ticket_change( db, ticket_id, author, change_time,
                                    ""totalhours"", str(totalHours), str(newtotal), self.log)
                save_custom_field_value( db, ticket_id, ""hours"", '0')
                save_custom_field_value( db, ticket_id, ""totalhours"", str(newtotal) )
}}}

with:

{{{
            ## If our hours changed
            if not hours == 0:                
                newtotal = str(totalHours+hours)
                newestimated = str(estimatedhours-hours)
                save_ticket_change( db, ticket_id, author, change_time,
                                    ""hours"", '0.0', str(hours), self.log)
                save_ticket_change( db, ticket_id, author, change_time,
                                    ""totalhours"", str(totalHours), str(newtotal), self.log)
                save_ticket_change( db, ticket_id, author, change_time,
                                    ""estimatedhours"", str(estimatedhours), str(newestimated), self.log)
                save_custom_field_value( db, ticket_id, ""hours"", '0')
                save_custom_field_value( db, ticket_id, ""totalhours"", str(newtotal) )
                save_custom_field_value( db, ticket_id, ""estimatedhours"", str(newestimated) )
}}}",enhancement,new,normal,TimingAndEstimationPlugin,normal,,,,
