Edgewall Software

Changes between Version 6 and Version 7 of TimeTracking


Ignore:
Timestamp:
Nov 1, 2005, 2:06:09 PM (19 years ago)
Author:
steffenp@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TimeTracking

    v6 v7  
    55So far two solutions are available that are described below, both modify the Trac's source code:
    66
    7  * Extending the data model  (for 0.8-stable)
    8  * Using custom ticket fields (for current svn)
     7 * Extending the data model  (for 0.8)
     8 * Using custom ticket fields (for 0.9)
    99
    1010== Extending the data model ==
     
    2929===== Patching Trac =====
    3030
    31 Download and apply the latest [http://steffenpingel.de/patches/trac/ time tracking patch]:
     31Download and apply the [http://steffenpingel.de/patches/trac/trac-time-tracking-0.9.diff time tracking patch]:
    3232
    33  * Checkout the latest Trac from the Subversion trunk
    34  * Run {{{patch -p0 < trac-time-tracking-r1612.diff}}} from the checked out directory
     33 * Download and unzip/untar Trac
     34 * Run {{{patch -p0 < trac-time-tracking-0.9.diff}}} from the checked out directory
    3535 * Reinstall Trac (run {{{./setup.py install}}})
    36 
    37 Replace {{{r1612}}} with the revision of the patch you downloaded.
    3836
    3937===== Modifying trac.ini =====
     
    5755Open your Trac project in a web browser and goto "View Tickets" -> "New Report" (you might need to grant REPORT_CREATE permission first). Enter a title like "Time Tracking" and the following query:
    5856
     57====== MySQL ======
     58
    5959{{{
     60#!sql
    6061SELECT DISTINCT
    6162
     
    8081
    8182  ORDER BY milestone
     83}}}
     84
     85====== Using Postgres with psycho ======
     86
     87Postgres has a few wrinkles and time intervals are not as hard to use.
     88
     89{{{
     90#!sql
     91SELECT DISTINCT
     92   id AS ticket,
     93   pl.value::interval  AS planned,
     94   s.value::interval AS spent,
     95   r.value::interval AS interval,
     96  ((s.value::interval + r.value::interval) - pl.value::interval) as accuracy,
     97   milestone AS customer,   summary, component, status
     98  FROM enum,ticket t
     99  LEFT OUTER JOIN ticket_custom pl ON
     100       (t.id=pl.ticket AND pl.name='tt_estimated')
     101  LEFT OUTER JOIN ticket_custom s ON
     102       (t.id=s.ticket AND s.name='tt_spent')
     103  LEFT OUTER JOIN ticket_custom r ON
     104       (t.id=r.ticket AND r.name='tt_remaining')
     105  ORDER BY milestone;
     106
    82107}}}
    83108
     
    121146This closes ticket #1, increases the time spent by 1 hour and decreases the remaining time by 1 hour.
    122147
    123 
    124  = Using Postgres with psycho =
    125 
    126 Postgres has a few wrinkles and time intervals are not as hard to use.
    127 {{{
    128 #!sql
    129 SELECT DISTINCT
    130    id AS ticket,
    131    pl.value::interval  AS planned,
    132    s.value::interval AS spent,
    133    r.value::interval AS interval,
    134   ((s.value::interval + r.value::interval) - pl.value::interval) as accuracy,
    135    milestone AS customer,   summary, component, status
    136   FROM enum,ticket t
    137   LEFT OUTER JOIN ticket_custom pl ON
    138        (t.id=pl.ticket AND pl.name='tt_estimated')
    139   LEFT OUTER JOIN ticket_custom s ON
    140        (t.id=s.ticket AND s.name='tt_spent')
    141   LEFT OUTER JOIN ticket_custom r ON
    142        (t.id=r.ticket AND r.name='tt_remaining')
    143   ORDER BY milestone;
    144 
    145 }}}
    146 
    147 
    148148