Changes between Version 44 and Version 45 of DynamicFieldsPlugin
- Timestamp:
- May 31, 2015, 6:24:09 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicFieldsPlugin
v44 v45 21 21 22 22 If you have any issues, create a 23 [ http://trac-hacks.org/newticket?component=DynamicFieldsPlugin&owner=robguttman new ticket].23 [/newticket?component=DynamicFieldsPlugin new ticket]. 24 24 25 25 [[TicketQuery(component=DynamicFieldsPlugin&group=type,format=progress)]] … … 31 31 == Source == 32 32 33 You can check out DynamicFieldsPlugin from [ http://trac-hacks.org/svn/dynamicfieldsplugin here] using Subversion, or [source:dynamicfieldsplugin browse the source] with Trac.33 You can check out DynamicFieldsPlugin from [/svn/dynamicfieldsplugin here] using Subversion, or [source:dynamicfieldsplugin browse the source] with Trac. 34 34 35 35 Install from the [source:dynamicfieldsplugin/trunk trunk] when running Trac 1.0 and later. … … 38 38 39 39 1. Install the plugin after downloading and unzipping: 40 {{{ 41 #!sh 40 {{{#!sh 42 41 cd dynamicfieldsplugin/0.11 43 42 sudo python setup.py bdist_egg … … 45 44 }}} 46 45 47 See [http://trac.edgewall.org/wiki/TracPlugins TracPlugins]for more installation details and options. You will likely need to restart Trac's web server after installation.46 See TracPlugins for more installation details and options. You will likely need to restart Trac's web server after installation. 48 47 49 48 2. Enable the plugin: 50 {{{ 51 #!ini 49 {{{#!ini 52 50 [components] 53 51 dynfields.* = enabled … … 65 63 66 64 Let's say that your team only specifies effort for enhancements, but not for defects or other ticket types. This rule shows a custom {{{effort}}} field only when the {{{type}}} field's value is ''enhancement'': 67 {{{ 68 #!ini 65 {{{#!ini 69 66 [ticket-custom] 70 67 effort.show_when_type = enhancement … … 72 69 73 70 If effort is specified for either enhancement or defect ticket types, then use pipe-delimited syntax to list both of them: 74 {{{ 75 #!ini 71 {{{#!ini 76 72 [ticket-custom] 77 73 effort.show_when_type = enhancement|defect … … 79 75 80 76 If your version field is based upon the milestone, then this rule hides the {{{version}}} field when the {{{milestone}}} field's value is empty: 81 {{{ 82 #!ini 77 {{{#!ini 83 78 [ticket-custom] 84 79 version.hide_when_milestone = … … 86 81 87 82 You may also hide fields based on group membership. For example, if only members of the production team should see a custom {{{duedate}}} field: 88 {{{ 89 #!ini 83 {{{#!ini 90 84 [ticket-custom] 91 85 duedate.show_if_group = production … … 93 87 94 88 Some of your fields may be auto-generated or used by very few people. To always hide a field: 95 {{{ 96 #!ini 89 {{{#!ini 97 90 [ticket-custom] 98 91 alwayshidden.hide_always = true … … 101 94 102 95 Fields that are always hidden will also be hidden on the custom query ({{{/query}}}) page. The {{{clear_on_hide}}} option above specifies that the field's value should not be cleared when hidden (clearing is the default behavior). Sometimes you want to allow users to get access to hidden fields. You can enable specific fields to be shown in ticket views when a user clicks a "Show hidden fields" link: 103 {{{ 104 #!ini 96 {{{#!ini 105 97 [ticket-custom] 106 98 mostlyhidden.show_when_type = enhancement … … 113 105 114 106 In the version/milestone example above, if the {{{milestone}}} changes then we want the {{{version}}} field to be cleared: 115 {{{ 116 #!ini 107 {{{#!ini 117 108 [ticket-custom] 118 109 version.clear_on_change_of = milestone … … 124 115 125 116 Let's say your workflow includes reassigning a ticket's {{{owner}}} to someone else for review or verification but maintain the person responsible for the work in a custom {{{captain}}} field. Initially the {{{captain}}} should be set to the {{{owner}}}, so to reduce data entry in making this so: 126 {{{ 127 #!ini 117 {{{#!ini 128 118 [ticket-custom] 129 119 captain.copy_from = owner … … 131 121 132 122 The default copy behavior is to not overwrite a value if one already exists. To always copy the value, add {{{(overwrite)}}} as follows: 133 {{{ 134 #!ini 123 {{{#!ini 135 124 [ticket-custom] 136 125 captain.copy_from = owner (overwrite) … … 140 129 141 130 Let's say your QA team usually creates defect tickets and your product managers usually create enhancement tickets. Here's how to allow each user to set the default value for the ticket {{{type}}}: 142 {{{ 143 #!ini 131 {{{#!ini 144 132 [ticket-custom] 145 133 type.default_value = (pref) … … 147 135 148 136 For text fields, if the field's value is not empty, the default value will not be applied unless you set an {{{append}}} option to ''true'': 149 {{{ 150 #!ini 137 {{{#!ini 151 138 [ticket-custom] 152 139 cc.default_value = (pref) … … 161 148 162 149 Some fields may be required, ie can't be empty, or must not contain some specific values. For example: 163 {{{ 164 #!ini 150 {{{#!ini 165 151 [ticket-custom] 166 152 owner.invalid_if = … … 171 157 172 158 You can also specify a condition under which the validation should be applied: 173 {{{ 174 #!ini 159 {{{#!ini 175 160 [ticket-custom] 176 161 phase.invalid_if.1 = verifying … … 185 170 186 171 When a developer starts working on a ticket, you may want to make sure she sets the milestone accordingly: 187 {{{ 188 #!ini 172 {{{#!ini 189 173 [ticket-custom] 190 174 milestone.set_to_milestone3_when_phase = implementation|verifying|releasing … … 192 176 193 177 When the {{{phase}}} field changes to either ''implementation'', ''verifying'', or ''releasing'', then the {{{milestone}}} will get set to ''milestone3''. To avoid needing to update the current milestone's value in the rule, you can alternatively use the special ''"!"'' value which specifies to set the field to the first non-empty value: 194 {{{ 195 #!ini 178 {{{#!ini 196 179 milestone.set_to_!_when_phase = implementation|verifying|releasing 197 180 }}} … … 203 186 204 187 If you want to enable each user to set the value as a preference, you set to a question mark {{{?}}} as follows: 205 {{{ 206 #!ini 188 {{{#!ini 207 189 milestone.set_to_?_when_phase = implementation|verifying|releasing (pref) 208 190 }}} 209 191 210 192 Learn more about user preferences below. The default set behavior is to not overwrite a value if one already exists. To always set the value, add {{{(overwrite)}}} as follows: 211 {{{ 212 #!ini 193 {{{#!ini 213 194 [ticket-custom] 214 195 milestone.set_to_!_when_phase = implementation|verifying|releasing (overwrite) (pref) … … 220 201 221 202 Any rule expressed above can be configured to allow users to set preferences for them by appending ''(pref)'' to the end of the rule. For example, here's one of the hide rules from above: 222 {{{ 223 #!ini 203 {{{#!ini 224 204 [ticket-custom] 225 205 alwayshidden.show_when_type = invalid_value (pref) … … 227 207 228 208 The ''(pref)'' will cause this rule to be added to a new '''Dynamic Fields''' preference panel where the user can disable the rule by unchecking the rule's checkbox. Some rules require user input such as the default value rule above. In that example, the user can both enable/disable the rule as well as set the field's default value for him/her. If you wish to disable a rule as the default preference, append ''(pref:disable)'' to the end of the rule like so: 229 {{{ 230 #!ini 209 {{{#!ini 231 210 [ticket-custom] 232 211 alwayshidden.show_when_type = invalid_value (pref:disable) … … 246 225 The 0.12 branch of this plugin is prepared for localization.[[BR]] 247 226 But English message texts are still the (POSIX) default. If this isn't your preferred language, you can 248 1. look if it's already available from the [TracPluginTranslation Trac plugin l10n project] at [http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields Transifex] or 249 2. do it yourself (see the [http://trac.edgewall.org/wiki/CookBook/PluginL10N#Dotranslatorswork l10n cookbook page for Trac plugins] for more details). 250 251 Contributing your translation is highly appreciated![[BR]] 227 1. look if it's already available from the [TracPluginTranslation Trac plugin l10n project] at [https://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields Transifex] or 228 2. do it yourself (see the [trac:wiki:CookBook/PluginL10N#Dotranslatorswork l10n cookbook page for Trac plugins] for more details). 229 230 Contributing your translation is highly appreciated! 231 252 232 You could send it to the plugin's maintainer or contribute to [TracPluginTranslation Trac plugin l10n project] 253 233 via [http://www.transifex.net/projects/p/Trac_Plugin-L10N/ Transifex]: 254 234 255 235 Top translations: Trac_Plugin-L10N » [http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields/ dynfields][[BR]] 256 [[Image(http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields/chart/image_png, title=Go to Trac_Plugin-L10N project page on Transifex.net, link=http ://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields/)]]257 Kindly provided by [[Image(https://ds0k0en9abmn1.cloudfront.net/static/charts/images/tx-logo-micro.png, link=http ://www.transifex.net/, title=the open translation platform, valign=bottom)]]236 [[Image(http://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields/chart/image_png, title=Go to Trac_Plugin-L10N project page on Transifex.net, link=https://www.transifex.net/projects/p/Trac_Plugin-L10N/resource/dynfields/)]] 237 Kindly provided by [[Image(https://ds0k0en9abmn1.cloudfront.net/static/charts/images/tx-logo-micro.png, link=https://www.transifex.net/, title=the open translation platform, valign=bottom)]] 258 238 259 239 Preparing the plugin from source now requires the additional step of compiling message catalog files. As long as you stick to the message catalogs served with this plugin directly, there is still nothing special to be done. Just package your plugin from source the standard way: 260 {{{ 261 #!sh 240 {{{#!sh 262 241 cd dynamicfieldsplugin 263 242 python ./setup.py bdist_egg … … 266 245 267 246 Only if you encounter message catalogs with translations marked 'fuzzy', including them would require special treatment, since automatic compilation trashes them by default. Walk through: 268 {{{ 269 #!sh 247 {{{#!sh 270 248 cd dynamicfieldsplugin 271 249 python ./setup.py compile_catalog -f