Changes between Version 10 and Version 11 of DynamicVariablesPlugin
- Timestamp:
- Aug 25, 2015, 9:20:30 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicVariablesPlugin
v10 v11 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Default and convert report dynamic variables to pulldowns =3 = Default and convert report dynamic variables to pulldowns 4 4 5 == Description ==5 == Description 6 6 7 7 This plugin applies to all [http://trac.edgewall.org/wiki/TracReports#AdvancedReports:DynamicVariables reports that use dynamic variables]. The plugin does two things for dynamic variables whose (uppercase) name exactly matches a built-in or custom (lowercase) ''select'' field name: … … 12 12 !JavaScript is required for the second feature above. 13 13 14 == Configuration == 14 == Bugs/Feature Requests 15 16 Existing bugs and feature requests for DynamicVariablesPlugin are 17 [report:9?COMPONENT=DynamicVariablesPlugin here]. 18 19 If you have any issues, create a 20 [/newticket?component=DynamicVariablesPlugin new ticket]. 21 22 [[TicketQuery(component=DynamicVariablesPlugin&group=type,format=progress)]] 23 24 == Download 25 26 Download the zipped source from [download:dynamicvariablesplugin here]. 27 28 == Source 29 30 You can check out DynamicVariablesPlugin from [http://trac-hacks.org/svn/dynamicvariablesplugin here] using Subversion, or [source:dynamicvariablesplugin browse the source] with Trac. 31 32 == Installation and Configuration 33 15 34 1. Install the plugin (after downloading and unzipping): 16 {{{ 17 #!sh 35 {{{#!sh 18 36 cd dynamicvariablesplugin/0.12 19 37 sudo python setup.py bdist_egg … … 21 39 }}} 22 40 23 41 See [http://trac.edgewall.org/wiki/TracPlugins TracPlugins] for more installation details and options. You'll likely need to restart Trac's web server after installation. 24 42 25 43 2. Enable the plugin: 26 {{{ 27 #!ini 44 {{{#!ini 28 45 [components] 29 46 dynvars.* = enabled 30 47 }}} 31 48 32 49 You can alternatively use the Trac Web Admin GUI to enable any or all rules. 33 50 34 51 3. (Optional) Set a {{{[dynvars]}}} section of field names with explicit option values. Example: 35 {{{ 36 #!ini 52 {{{#!ini 37 53 [dynvars] 38 54 daysback.options = 7|30 39 55 }}} 40 56 41 In the above example, {{{daysback}}} is not a custom ticket field but can set a {{{DAYSBACK}}} dynamic variable via a pulldown 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.57 In the above example, {{{daysback}}} is not a custom ticket field but can set a {{{DAYSBACK}}} dynamic variable via a pulldown 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. 42 58 43 4. Create/modify reports so that the names used for dynamic variables exactly match the names of the select field that it corresponds to. 59 4. 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. 44 60 45 == Bugs/Feature Requests ==61 == Example 46 62 47 Existing bugs and feature requests for DynamicVariablesPlugin are 48 [report:9?COMPONENT=DynamicVariablesPlugin here]. 49 50 If you have any issues, create a 51 [http://trac-hacks.org/newticket?component=DynamicVariablesPlugin&owner=robguttman new ticket]. 52 53 == Download == 54 55 Download the zipped source from [download:dynamicvariablesplugin here]. 56 57 == Source == 58 59 You can check out DynamicVariablesPlugin from [http://trac-hacks.org/svn/dynamicvariablesplugin here] using Subversion, or [source:dynamicvariablesplugin browse the source] with Trac. 60 61 == Example == 62 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: 63 {{{ 64 #!sql 65 SELECT p.value AS __color__, 66 t.id AS ticket, summary, component, severity, reporter 63 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: 64 {{{#!sql 65 SELECT p.value AS __color__, t.id AS ticket, summary, component, severity, reporter 67 66 FROM ticket t 68 67 LEFT OUTER JOIN milestone m ON t.milestone = m.name 69 68 LEFT JOIN enum p ON p.name = t.severity AND p.type = 'severity' 70 LEFT OUTER JOIN ticket_custom q ON q.ticket = t.id andq.name = 'queue'69 LEFT OUTER JOIN ticket_custom q ON q.ticket = t.id AND q.name = 'queue' 71 70 WHERE q.value = '$QUEUE' 72 71 AND milestone = '$MILESTONE' … … 74 73 }}} 75 74 76 Here's what this report would look like both before and after this plugin is installed and enabled:75 The result is as follows: 77 76 78 === Before === 77 === Before 78 79 79 [[Image(before.png)]] 80 80 81 === After === 81 === After 82 82 83 [[Image(after.png)]] 83 84 84 85 Completed milestones are omitted from the pulldown menu. 85 86 86 == Recent Changes ==87 == Recent Changes 87 88 88 89 [[ChangeLog(dynamicvariablesplugin, 3)]] 89 90 90 == Author/Contributors ==91 == Author/Contributors 91 92 92 93 '''Author:''' [wiki:robguttman] [[BR]] 93 '''Maintainer:''' [ wiki:robguttman] [[BR]]94 '''Maintainer:''' [[Maintainer]] [[BR]] 94 95 '''Contributors:'''