Changes between Version 44 and Version 45 of DynamicFieldsPlugin


Ignore:
Timestamp:
May 31, 2015, 6:24:09 PM (9 years ago)
Author:
Ryan J Ollos
Comment:

Page cleanup. Project-relative links.

Legend:

Unmodified
Added
Removed
Modified
  • DynamicFieldsPlugin

    v44 v45  
    2121
    2222If you have any issues, create a
    23 [http://trac-hacks.org/newticket?component=DynamicFieldsPlugin&owner=robguttman new ticket].
     23[/newticket?component=DynamicFieldsPlugin new ticket].
    2424
    2525[[TicketQuery(component=DynamicFieldsPlugin&group=type,format=progress)]]
     
    3131== Source ==
    3232
    33 You can check out DynamicFieldsPlugin from [http://trac-hacks.org/svn/dynamicfieldsplugin here] using Subversion, or [source:dynamicfieldsplugin browse the source] with Trac.
     33You can check out DynamicFieldsPlugin from [/svn/dynamicfieldsplugin here] using Subversion, or [source:dynamicfieldsplugin browse the source] with Trac.
    3434
    3535Install from the [source:dynamicfieldsplugin/trunk trunk] when running Trac 1.0 and later.
     
    3838
    3939 1. Install the plugin after downloading and unzipping:
    40     {{{
    41     #!sh
     40    {{{#!sh
    4241    cd dynamicfieldsplugin/0.11
    4342    sudo python setup.py bdist_egg
     
    4544    }}}
    4645
    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.
    4847
    4948 2. Enable the plugin:
    50     {{{
    51     #!ini
     49    {{{#!ini
    5250    [components]
    5351    dynfields.* = enabled
     
    6563
    6664Let'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
    6966[ticket-custom]
    7067effort.show_when_type = enhancement
     
    7269
    7370If 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
    7672[ticket-custom]
    7773effort.show_when_type = enhancement|defect
     
    7975
    8076If 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
    8378[ticket-custom]
    8479version.hide_when_milestone =
     
    8681
    8782You 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
    9084[ticket-custom]
    9185duedate.show_if_group = production
     
    9387
    9488Some of your fields may be auto-generated or used by very few people. To always hide a field:
    95 {{{
    96 #!ini
     89{{{#!ini
    9790[ticket-custom]
    9891alwayshidden.hide_always = true
     
    10194
    10295Fields 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
    10597[ticket-custom]
    10698mostlyhidden.show_when_type = enhancement
     
    113105
    114106In the version/milestone example above, if the {{{milestone}}} changes then we want the {{{version}}} field to be cleared:
    115 {{{
    116 #!ini
     107{{{#!ini
    117108[ticket-custom]
    118109version.clear_on_change_of = milestone
     
    124115
    125116Let'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
    128118[ticket-custom]
    129119captain.copy_from = owner
     
    131121
    132122The 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
    135124[ticket-custom]
    136125captain.copy_from = owner (overwrite)
     
    140129
    141130Let'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
    144132[ticket-custom]
    145133type.default_value = (pref)
     
    147135
    148136For 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
    151138[ticket-custom]
    152139cc.default_value = (pref)
     
    161148
    162149Some fields may be required, ie can't be empty, or must not contain some specific values. For example:
    163 {{{
    164 #!ini
     150{{{#!ini
    165151[ticket-custom]
    166152owner.invalid_if =
     
    171157
    172158You can also specify a condition under which the validation should be applied:
    173 {{{
    174 #!ini
     159{{{#!ini
    175160[ticket-custom]
    176161phase.invalid_if.1 = verifying
     
    185170
    186171When a developer starts working on a ticket, you may want to make sure she sets the milestone accordingly:
    187 {{{
    188 #!ini
     172{{{#!ini
    189173[ticket-custom]
    190174milestone.set_to_milestone3_when_phase = implementation|verifying|releasing
     
    192176
    193177When 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
    196179milestone.set_to_!_when_phase = implementation|verifying|releasing
    197180}}}
     
    203186
    204187If 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
    207189milestone.set_to_?_when_phase = implementation|verifying|releasing (pref)
    208190}}}
    209191
    210192Learn 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
    213194[ticket-custom]
    214195milestone.set_to_!_when_phase = implementation|verifying|releasing (overwrite) (pref)
     
    220201
    221202Any 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
    224204[ticket-custom]
    225205alwayshidden.show_when_type = invalid_value (pref)
     
    227207
    228208The ''(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
    231210[ticket-custom]
    232211alwayshidden.show_when_type = invalid_value (pref:disable)
     
    246225The 0.12 branch of this plugin is prepared for localization.[[BR]]
    247226But 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
     230Contributing your translation is highly appreciated!
     231
    252232You could send it to the plugin's maintainer or contribute to [TracPluginTranslation Trac plugin l10n project]
    253233via [http://www.transifex.net/projects/p/Trac_Plugin-L10N/ Transifex]:
    254234
    255235Top 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/)]]
     237Kindly 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)]]
    258238
    259239Preparing 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
    262241cd dynamicfieldsplugin
    263242python ./setup.py bdist_egg
     
    266245
    267246Only 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
    270248cd dynamicfieldsplugin
    271249python ./setup.py compile_catalog -f