Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7471 closed task (wontfix)

Log hours on different date

Reported by: Jochus Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords: patch useful-sql
Cc: Trac Release: 0.12

Description

Hi,

Is it possible to log hours on a date in the past? I'm willing to do this, to make sure my burndown chart looks ok :-) !

Jochen

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Russ Tyndall

Keywords: patch useful-sql added
Resolution: wontfix
Status: newclosed

You can certainly manually insert hours/totalhours changes into the ticket_change table in trac. It will be a little ugly to update the total hours on every ticket change after that time, but doable.


! THIS IS TOTALLY UNDEBUGGED, USE WITH CARE: Obviously, use python or your database's parameter syntax, but something like:

  $total_hours = (SELECT SUM(newvalue)
                  FROM ticket_change 
                  WHERE ticket=$ticket_id and time < $change_timestamp and field='hours')

  INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue)
  VALUES( $ticket_id, $change_timestamp, $change_author, 'hours', 0 , $hours_to_add )


  INSERT INTO ticket_change (ticket, time, author, field, oldvalue, newvalue)
  VALUES( $ticket_id, $change_timestamp, $change_author, 'total_hours',
          $total_hours , $total_hours + $hours_to_add );

  UPDATE ticket_change 
     SET old_value = old_value + $hours_to_add, 
         new_value = new_value + $hours_to_add
   WHERE ticket=$ticket_id and time > $change_timestamp and
         field='totalhours';

   UPDATE ticket_custom SET value = value + $hours_to_add 
    WHERE ticket=$ticket_id and name='totalhours';


However, this falls outside of my usage case for this plugin. My company acceleration.net is happy to write you a plugin that can supply this additional functionality, but I am unable to donate time towards this.

Thanks for your understanding,

Russ Tyndall

comment:2 Changed 7 years ago by Russ Tyndall

As an aside this could probably be done as an admin page or something. I was initially very concerned about adding more fields to the layout, as that is already a bit of box soup.

Also patches welcome, if you take the above code and turn it into a patch that adds an admin page, I will happily include it in the plugin

comment:3 Changed 7 years ago by Jochus

Russ,

Thanks! :-) ! I'm willing to patch this, but I also need to find time to do this :-)

Jochen

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Russ Tyndall.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.