Changes between Version 50 and Version 51 of TracJsGanttPlugin
- Timestamp:
- Mar 9, 2015, 1:08:52 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracJsGanttPlugin
v50 v51 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Trac jsGantt plugin =4 5 == Description ==3 = Display a jsGantt chart in a wiki page 4 5 == Description 6 6 7 7 A plugin which allows Trac ticket data to be displayed in a [http://jsgantt.com jsGantt] chart in a wiki page. Tasks and milestones are links to the corresponding ticket or milestone. … … 11 11 Over time, the project management aspects of the Gantt chart have been isolated in the `TracPM` module which has grown to include a query helper (which allows finding tickets based on dependencies) and a ticket change listener (which reschedules tickets based on various constraints) and other support functions. Ultimately, these features -- which really have nothing to do with the Gantt chart -- will be moved to a separate `TracPM` plugin. 12 12 13 == Usage ==14 15 `[[TracJSGanttChart(sample=1)]]` displays the sample project from jsgantt.com. 13 == Examples 14 15 `[[TracJSGanttChart(sample=1)]]` displays the sample project from jsgantt.com. `[[TracJSGanttChart(milestone=Test)]]` displays all the tickets in the Test milestone. 16 16 17 17 [[Image(jsGanttSample.PNG)]] … … 23 23 `[[TracJSGanttChart(scheduled=1,display=owner:chrisn)]]` find all the scheduled tickets and display only those owned by user `chrisn`. 24 24 25 26 === Arguments === 27 28 The chart display can be controlled with a number of macro arguments: 25 === Arguments 26 27 The chart display can be controlled with the following macro arguments: 29 28 30 29 ||'''Argument''' ||'''Version''' ||'''Description''' ||'''Default''' 31 30 || `caption`|| ||Caption to place to right of tasks: None, `Caption`, `Resource`, `Duration`, `Complete` || `Resource` || 32 31 || `comp`|| ||Show (`1`) percent complete column, or do not (`0`). || `1` || 33 || `colorBy`|| ||Field to use to color tasks. Useful fields are `priority`, `owner` and `milestone` but any field can be used. When colored by `priority` colors are consistent with the colors used in Trac reports. Other coloring choices (e.g., by `milestone` or `owner`)use arbitrary, unique colors. || `priority` ||32 || `colorBy`|| ||Field to use to color tasks. Useful fields are `priority`, `owner` and `milestone` but any field can be used. When colored by `priority` colors are consistent with the colors used in Trac reports. Other coloring choices, eg by `milestone` or `owner`, use arbitrary, unique colors. || `priority` || 34 33 || `dateDisplay`|| ||Format to display dates: `mm/dd/yyyy`, `dd/mm/yyyy`, or `yyyy-mm-dd` || `mm/dd/yyyy` || 35 34 || `display`||0.10||Filter for limiting display of tickets. `owner:fred` shows only tickets owned by fred. `status:closed` shows only closed tickets.||None|| … … 40 39 || `format`|| ||Initial display format, one of those listed in `formats` || `day` || 41 40 || `formats`||||Formats to show for Gantt chart. A pipe-separated list of `minute`, `hour`, `day`, `week`, `month`, and `quarter`. || `day|week|month|quarter` || 42 || `goal`|| 0.9 ||Ticket(s) to show predecessors of. When using something like MasterTicketsPlugin to maintain ticket dependencies, you may create a Gantt showing a ticket and all of its predecessors with `goal=<ticket#>`. 41 || `goal`|| 0.9 ||Ticket(s) to show predecessors of. When using something like MasterTicketsPlugin to maintain ticket dependencies, you may create a Gantt showing a ticket and all of its predecessors with `goal=<ticket#>`. The macro uses the configured `succ` field to find all predecessor tasks and build an `id=` argument for Trac's native query handler.[[br]][[br]]Multiple goals may be provided like `goal=1|12|32`.[[br]][[br]]When used in a ticket description or comment, `goal=self` will display the current ticket's predecessors.|| None || 43 42 || `hoursPerDay`|| ||Hours worked per day || `8.0` || 44 || `lwidth`|| ||Width (in pixels) of left table (The one contains task names, etc. on the left of the Gantt chart.)|| None ||43 || `lwidth`|| ||Width (in pixels) of left table. The one contains task names, etc. on the left of the Gantt chart. || None || 45 44 || `omitMilestones`||0.8||Show milestones for displayed tickets (`0`) or only those specified by `milestone=` (`1`). || `0` || 46 45 || `openLevel`|| ||How many levels of task hierarchy to show open. `1` = only top level task. || `999` || 47 46 || `res`|| ||Show (`1`) resource column, or do not (`0`). || `1` || 48 || `root`|| ||Ticket(s) to show descendants of. When using something like Subtickets plugin to maintain a tree of tickets and subtickets, you may create a Gantt showing a ticket and all of its descendants with `root=<ticket#>`. 47 || `root`|| ||Ticket(s) to show descendants of. When using something like Subtickets plugin to maintain a tree of tickets and subtickets, you may create a Gantt showing a ticket and all of its descendants with `root=<ticket#>`. The macro uses the configured `parent` field or `parentchild` relation to find all descendant tasks and build an `id=` argument for Trac's native query handler.[[br]][[br]]Multiple roots may be provided like `root=1|12|32`.[[br]][[br]]When used in a ticket description or comment, `root=self` will display the current ticket's descendants.|| None || 49 48 || `sample`|| ||Display (`1`) sample tasks in Gantt, or do not (`0`) || `0` || 50 49 || `schedule`|| ||Schedule algorithm: as-last-as-possible (`alap`) or as-soon-as-possible (`asap`) || `alap` || … … 52 51 || `startDate`|| ||Show (`1`) start date column, or do not (`0`). || `1` || 53 52 || `userMap`||0.8||Map (`1`) user IDs to full names, or do not (`0`). || `1` || 54 || `order`||||Order of fields used to sort tickets before display. `order=milestone` sorts by milestone. 55 || `scrollTo`||||Date to scroll to when chart is initially drawn. 53 || `order`||||Order of fields used to sort tickets before display. `order=milestone` sorts by milestone. May include ticket fields, including custom fields, or "wbs" (work breakdown structure).||wbs|| 54 || `scrollTo`||||Date to scroll to when chart is initially drawn. A date in `yyyy-mm-dd` format or "today".||None|| 56 55 || `linkStyle`||||How to handle clicks on task in the chart. JSGantt style opening a dedicated window (`jsgantt`) or standard ticket link behaviour (`standard`).||`jsgantt`|| 57 56 58 Site-wide defaults for macro arguments may be set in the `[trac-jsgantt]` section of `trac.ini` . Where `option.<opt>` overrides the built-in default for `<opt>` from the table above.59 60 All other macro arguments are treated as TracQuery specification (e.g., `milestone=MS1|MS2`)to control which tickets are displayed.61 62 == Interfaces ==63 64 The TracPM module provides several interfaces that can be implemented to adapt the Project Management (PM) features to local business rules. (The TracPM module will be a separate plugin in the future.)These interfaces are defined in `pmapi.py`.65 66 === ITaskSorter ===57 Site-wide defaults for macro arguments may be set in the `[trac-jsgantt]` section of `trac.ini`, where `option.<opt>` overrides the built-in default for `<opt>` from the table above. 58 59 All other macro arguments are treated as TracQuery specification, eg `milestone=MS1|MS2`, to control which tickets are displayed. 60 61 == Interfaces 62 63 The TracPM module provides several interfaces that can be implemented to adapt the Project Management (PM) features to local business rules. The TracPM module will be a separate plugin in the future. These interfaces are defined in `pmapi.py`. 64 65 === ITaskSorter 67 66 68 67 TracPM defers decisions about ticket ordering to an `ITaskSorter` implementation. … … 87 86 }}} 88 87 89 ==== Provided Implementations ====88 ==== Provided Implementations 90 89 91 90 TracPM provides two implementations of `ITaskSorter`: … … 100 99 `SimpleSorter` is used by default if no sorter is enabled in `trac.ini`. 101 100 102 ==== Support Functions ====101 ==== Support Functions 103 102 104 103 `SimpleSorter` and `ProjectSorter` are both derived from `BaseSorter` which provides several functions which may be useful in implementing custom sorters. … … 108 107 * `compareOneField(field, t1, t2)` compares two tickets based on just one field. 109 108 110 === IResourceCalendar ===109 === IResourceCalendar 111 110 112 111 TracPM defers decisions about resource availability to an `IResourceCalendar` implementation. … … 123 122 }}} 124 123 125 ==== Provided Implementations ====124 ==== Provided Implementations 126 125 127 126 TracPM provides one implementation of `IResourceCalendar` … … 132 131 TeamCalendarPlugin provides an implementation which returns 0 hours for any day that a developer is marked unavailable in the calendar. 133 132 134 === ITaskScheduler ===135 136 An interface for task schedulers exists but itnot yet well documented.133 === ITaskScheduler 134 135 An interface for task schedulers exists, but is not yet well documented. 137 136 138 137 {{{ … … 150 149 }}} 151 150 152 == Scheduling ==151 == Scheduling 153 152 154 153 If the `TicketRescheduler` module is enabled, `TracPM` maintains private tables with task scheduling information. The `schedule` table has the current schedule: … … 165 164 }}} 166 165 167 The `schedule_change` table holds a record of changes in the schedule over time .166 The `schedule_change` table holds a record of changes in the schedule over time: 168 167 169 168 {{{ … … 182 181 }}} 183 182 184 It is possible -- but not yet supported --to use the data in `schedule_change` to reconstruct a baseline schedule for an effective date and then report changes from that baseline.183 It is possible, but not yet supported, to use the data in `schedule_change` to reconstruct a baseline schedule for an effective date and then report changes from that baseline. 185 184 186 185 These tables are maintained by a ticket change listener which looks for changes to fields which might affect schedule then: … … 192 191 * writes any changes to `schedule` (updating history in `schedule_change`) 193 192 194 With this data in place, you can show a Gantt of scheduled tickets with dates as in the database (`[[TracJSGanttChart(scheduled=1)]]`) or create reports of the scheduled tickets.193 With this data in place, you can show a Gantt chart of scheduled tickets with dates as in the database (`[[TracJSGanttChart(scheduled=1)]]`) or create reports of the scheduled tickets. 195 194 196 195 {{{ … … 204 203 est.value as est, 205 204 act.value as act, 206 -- This bit is specific to Postgres. 207 (SELECT to_date(to_timestamp((sched.finish/1000000))::text, 208 'YYYY-MM-DD')) AS due, 205 -- This bit is specific to PostgreSQL 206 (SELECT to_date(to_timestamp((sched.finish/1000000))::text, 'YYYY-MM-DD')) AS due, 209 207 status 210 208 FROM ticket AS t … … 219 217 }}} 220 218 221 == Installation ==222 223 219 == Installation 220 221 The following installation steps apply: 224 222 1. '''Install''' globally with: 225 223 {{{#!sh … … 317 315 1. '''Restart''' web server on command line: 318 316 {{{#!sh 319 $sudo /etc/init.d/apache2 restart320 }}} 321 322 == = Configuration details ===323 324 !TracJsGanttPlugin is intended to be flexible enough to get data from variousplugins by configuring the field names for those plugins in `trac.ini`. It is known to work with TimingAndEstimationPlugin (for estimated and total hours), MasterTicketsPlugin (for FS dependencies), and SubticketsPlugin for parent/child relationships. Custom fields for start and finish date are also supported.317 sudo /etc/init.d/apache2 restart 318 }}} 319 320 == Configuration 321 322 !TracJsGanttPlugin is intended to be flexible enough to get data from plugins by configuring the field names for those plugins in `trac.ini`. It is known to work with TimingAndEstimationPlugin (for estimated and total hours), MasterTicketsPlugin (for FS dependencies), and SubticketsPlugin for parent/child relationships. Custom fields for start and finish date are also supported. 325 323 326 324 All of the `fields.*` items name custom fields which may contain data for the Gantt. 327 325 328 * When `fields.estimate` and `fields.worked` are both configured, the plugin attempts to display (100 * `fields.worked`/`fields.estimate`) as the percent complete. The example works with TimingAndEstimationPlugin. Alternatively, if `percent` is configured, the plugin attempts to display it as the percent complete (it should be a number from 0 to 100).If none of those are configured, all tasks will be marked as 0% complete.329 330 * When `fields.pred` and `fields.succ` are configured the plugin uses them to determine the task dependencies. The example works with MasterTicketsPlugin. 331 332 * When `fields.parent` is configured, it is the field which holds the parent ticket number. The example works with SubticketsPlugin. If this field is not configured, no parent/child relationship will be displayed. If it is configured, the Gantt can be collapsed by the user to show or hide subtasks. (`parent_format` determines the format of the content of the `parent` field. Use "%s" (default) for SubticketsPlugin, or "#%s" for ChildTicketsPlugin.)333 334 * When `fields.start` and `fields.finish` are configured, the plugin uses them to set task start and finish dates. The `date_format` field is a Python `strptime()` format specifier which describes the contents of `fields.start` and `fields.finish`.If these fields are not configured, all tasks end today and have a 1-day duration.335 336 * When `fields.estimate` and `fields.finish` are both configured (and `fields.start` is not configured or not on the ticket), the plugin attempts to determine the start of the task from`fields.finish` and `fields.estimate` as `start = fields.finish - fields.estimate` with consideration for weekends and hours per day.337 338 * The `goal_ticket_type` may be used to have a custom ticket type show up as milestones on the chart. 339 340 == Bugs/Feature Requests ==326 * When `fields.estimate` and `fields.worked` are both configured, the plugin attempts to display (100 * `fields.worked`/`fields.estimate`) as the percent complete. The example works with TimingAndEstimationPlugin. Alternatively, if `percent` is configured, the plugin attempts to display it as the percent complete (it should be a number from 0 to 100). If none of those are configured, all tasks will be marked as 0% complete. 327 328 * When `fields.pred` and `fields.succ` are configured the plugin uses them to determine the task dependencies. The example works with MasterTicketsPlugin. If these fields are not configured, no dependencies are shown. 329 330 * When `fields.parent` is configured, it is the field which holds the parent ticket number. The example works with SubticketsPlugin. If this field is not configured, no parent/child relationship will be displayed. If it is configured, the Gantt can be collapsed by the user to show or hide subtasks. The `parent_format` determines the format of the content of the `parent` field. Use "%s" (default) for SubticketsPlugin, or "#%s" for ChildTicketsPlugin. 331 332 * When `fields.start` and `fields.finish` are configured, the plugin uses them to set task start and finish dates. The `date_format` field is a Python `strptime()` format specifier which describes the contents of `fields.start` and `fields.finish`. If these fields are not configured, all tasks end today and have a 1-day duration. 333 334 * When `fields.estimate` and `fields.finish` are both configured, and `fields.start` is not configured or not on the ticket, the plugin attempts to determine the start of the task from `fields.finish` and `fields.estimate` as `start = fields.finish - fields.estimate` with consideration for weekends and hours per day. 335 336 * The `goal_ticket_type` may be used to have a custom ticket type show up as milestones on the chart. If this field is not specified, only Trac milestones are displayed as milestones. 337 338 == Bugs/Feature Requests 341 339 342 340 Existing bugs and feature requests for !TracJsGanttPlugin are [report:9?COMPONENT=TracJsGanttPlugin here]. … … 344 342 If you have any issues, create a [/newticket?component=TracJsGanttPlugin&owner=ChrisNelson new ticket]. 345 343 346 === Known issues === 347 344 [[TicketQuery(component=TracJsGanttPlugin&group=type,format=progress)]] 345 346 === Known issues 347 348 The following is a list of known issues: 348 349 [[TicketQuery(status=accepted&status=assigned&status=new&status=reopened&type=defect&component=TracJsGanttPlugin&col=id&col=summary&col=component&col=status&col=owner&col=type&col=priority&order=priority)]] 349 350 350 === Planned enhancements ===351 352 1. Display a legend of task colors and their meaning (e.g., which milestone or owner they represent).351 === Planned enhancements 352 353 1. Display a legend of task colors and their meaning, eg which milestone or owner they represent. 353 354 1. Allow some tasks to be open or closed by default. 354 1. Display critical path 355 1. Display slack time 356 357 == Source & Download ==355 1. Display critical path. 356 1. Display slack time. 357 358 == Source & Download 358 359 359 360 You can check out !TracJsGanttPlugin from [http://trac-hacks.org/svn/tracjsganttplugin here] using Subversion, or [source:tracjsganttplugin browse the source] with Trac. … … 361 362 Download the zipped source from [download:tracjsganttplugin here]. 362 363 363 === Recent Changes ===364 365 [[ChangeLog(tracjsganttplugin, 10)]]366 367 == Author/Contributors ==364 === Recent Changes 365 366 [[ChangeLog(tracjsganttplugin, 3)]] 367 368 == Author/Contributors 368 369 369 370 '''Author:''' [wiki:ChrisNelson] [[BR]] 370 '''Maintainer:''' [ wiki:ChrisNelson] [[BR]]371 '''Maintainer:''' [[Maintainer]] [[BR]] 371 372 '''Contributors:''' [wiki:rjollos], [wiki:bof], Matt Sable