Version 16 (modified by 7 years ago) (diff) | ,
---|
Contents
Default and convert report dynamic variables to dropdowns
Description
This plugin applies to all reports that use dynamic variables. The plugin does the following for dynamic variables whose (uppercase) name exactly matches a built-in or custom (lowercase) select field name:
- Dynamic variables are set to default values if unset.
- The text fields for dynamic variables are converted to dropdown lists.
JavaScript is required for the latter feature.
The only required configuration is in defining SQL reports. For example, a report for a specific milestone
that also queries for a custom queue
select field could be defined like this:
SELECT p.value AS __color__, t.id AS ticket, summary, component, severity, reporter FROM ticket t LEFT OUTER JOIN milestone m ON t.milestone = m.name LEFT JOIN enum p ON p.name = t.severity AND p.type = 'severity' LEFT OUTER JOIN ticket_custom q ON q.ticket = t.id AND q.name = 'queue' WHERE q.value = '$QUEUE' AND milestone = '$MILESTONE' ORDER BY m.due ASC, p.value
The result is as follows:
Before
After
Completed milestones are omitted from the dropdown menu.
Bugs/Feature Requests
Existing bugs and feature requests for DynamicVariablesPlugin are here.
If you have any issues, create a new ticket.
defect |
4 / 4 |
|
---|---|---|
enhancement |
1 / 1 |
Download
Download the zipped source from here.
Source
You can check out DynamicVariablesPlugin from here using Subversion, or browse the source with Trac.
Installation and Configuration
- Install the plugin, after downloading and unzipping:
cd dynamicvariablesplugin/0.12 sudo python setup.py bdist_egg sudo cp dist/TracDynamicVariables*.egg /your/trac/location/plugins/
See TracPlugins for more installation details and options. You will likely need to restart Trac's web server after installation.
- Enable the plugin in your
trac.ini
file:[components] dynvars.* = enabled
You can alternatively use the Trac Web Admin GUI to enable any or all rules.
- (Optional) Set a
[dynvars]
section of field names with explicit option values:[dynvars] daysback.options = 7|30
In the above example,
daysback
is not a custom ticket field, but can set aDAYSBACK
dynamic variable via a dropdown list with the specified options. A[dynvars]
section is not needed to configure dynamic variables that exactly match built-in or custom field names as shown in the screenshots below.
- Create/modify reports so that the names used for dynamic variables exactly match the names of the select field that it corresponds to. See an example below.
Recent Changes
- 16587 by rjollos on 2017-05-14 15:31:58
-
1.2.0dev: Restore argument unintentionally removed in r16586
- 16586 by rjollos on 2017-05-13 17:41:52
-
1.2.0dev: Add branch compatible with Trac 1.2
- 15377 by rjollos on 2016-03-01 01:15:59
-
0.2.0dev: Fix empty select with Trac 0.12
Patch by Jun Omae.
Fixes #12679.
(more)
Author/Contributors
Author: robguttman
Maintainer: none (deprecated)
Contributors:
Attachments (2)
- before.png (16.6 KB) - added by 13 years ago.
- after.png (19.9 KB) - added by 13 years ago.
Download all attachments as: .zip