Changes between Version 47 and Version 48 of DynamicFieldsPlugin


Ignore:
Timestamp:
Aug 1, 2016, 9:23:45 PM (8 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • DynamicFieldsPlugin

    v47 v48  
    88
    99Key features:
    10  * Hide a field based on another field's value
    11  * Default a field's value per user preference
    12  * Clear a field's value when another field's value changes
    13  * Copy one field's value to another field
    14  * Validate a field's value
    15  * Set a field's value based on another field's value
     10 * Hide a field based on another field's value.
     11 * Default a field's value per user preference.
     12 * Clear a field's value when another field's value changes.
     13 * Copy one field's value to another field.
     14 * Validate a field's value.
     15 * Set a field's value based on another field's value.
    1616
    1717== Bugs/Feature Requests
     
    3838
    3939 1. Install the plugin after downloading and unzipping:
    40     {{{#!sh
    41     cd dynamicfieldsplugin/0.11
    42     sudo python setup.py bdist_egg
    43     sudo cp dist/TracDynamicFields*.egg /your/trac/location/plugins/
    44     }}}
    45 
    46     See TracPlugins for more installation details and options. You will likely need to restart Trac's web server after installation.
     40 {{{#!sh
     41cd dynamicfieldsplugin/0.11
     42sudo python setup.py bdist_egg
     43sudo cp dist/TracDynamicFields*.egg /your/trac/location/plugins/
     44}}}
     45
     46 See TracPlugins for more installation details and options. You will likely need to restart Trac's web server after installation.
    4747
    4848 2. Enable the plugin:
    49     {{{#!ini
    50     [components]
    51     dynfields.* = enabled
    52     }}}
    53 
    54     You can alternatively use the Trac Web Admin GUI to enable any or all rules.
     49 {{{#!ini
     50[components]
     51dynfields.* = enabled
     52}}}
     53
     54 You can alternatively use the Trac Web Admin GUI to enable any or all rules.
    5555
    5656See the examples section [wiki:DynamicFieldsPlugin#Examples below] for how to specify rules.
     
    5858== Examples
    5959
    60 This plugin currently includes six rules.  Each rule is specified by modifying the {{{[ticket-custom]}}} section of {{{trac.ini}}}. Below are several examples to motivate using each rule.
    61 
    62 ==== Hide rule
     60This plugin currently includes six rules. Each rule is specified by modifying the {{{[ticket-custom]}}} section of your {{{trac.ini}}} file. Below are several examples to each rule.
     61
     62=== Hide rule
    6363
    6464Let'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'':
     
    100100}}}
    101101
    102 The default is that hidden fields are ''not'' enabled to be shown, ie {{{link_to_show}}} defaults to ''false''. The "Show hidden fields" link is only shown when there are hidden fields and at least one of them is enabled to be shown.
    103 
    104 ==== Clear rule
     102The default is that hidden fields are '''not''' enabled to be shown, ie {{{link_to_show}}} defaults to ''false''. The "Show hidden fields" link is only shown when there are hidden fields and at least one of them is enabled to be shown.
     103
     104=== Clear rule
    105105
    106106In the version/milestone example above, if the {{{milestone}}} changes then we want the {{{version}}} field to be cleared:
     
    112112Note that 'clearing' a select field will actually reset it to its default value if no 'empty' option is available.
    113113
    114 ==== Copy rule
     114=== Copy rule
    115115
    116116Let'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:
     
    120120}}}
    121121
    122 The default copy behavior is to not overwrite a value if one already exists.  To always copy the value, add {{{(overwrite)}}} as follows:
     122The default copy behavior is to not overwrite a value if one already exists. To always copy the value, add {{{(overwrite)}}} as follows:
    123123{{{#!ini
    124124[ticket-custom]
     
    126126}}}
    127127
    128 ==== Default rule
     128=== Default rule
    129129
    130130Let'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}}}:
     
    145145The above example introduces the plugin's user preference facility described below.
    146146
    147 ==== Validate rule
     147=== Validate rule
    148148
    149149Some fields may be required, ie can't be empty, or must not contain some specific values. For example:
     
    165165}}}
    166166
    167 The above example is for the [wiki:CodeReviewerPlugin CodeReviewer plugin] when using its ticket reference macro to prevent a ticket moving a custom {{{phase}}} field past "codereview" if there are either pending reviews or the last changeset has not passed review. The value is a jQuery selector - if it returns one or more items then the validation is applied, else it's skipped. The {{{.1}}} and {{{.2}}} suffix for the option keys are to group the {{{invalid_if}}} and {{{invalid_when}}} parts together.
    168 
    169 ==== Set rule
    170 
    171 When a developer starts working on a ticket, you may want to make sure she sets the milestone accordingly:
     167The above example is for the [wiki:CodeReviewerPlugin CodeReviewer plugin] when using its ticket reference macro to prevent a ticket moving a custom {{{phase}}} field past "codereview" if there are either pending reviews or the last changeset has not passed review. The value is a jQuery selector and if it returns one or more items then the validation is applied, else it's skipped. The {{{.1}}} and {{{.2}}} suffix for the option keys are to group the {{{invalid_if}}} and {{{invalid_when}}} parts together.
     168
     169=== Set rule
     170
     171When a developer starts working on a ticket, you may want to make sure (s)he sets the milestone accordingly:
    172172{{{#!ini
    173173[ticket-custom]
     
    175175}}}
    176176
    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:
     177When 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:
    178178{{{#!ini
    179179milestone.set_to_!_when_phase = implementation|verifying|releasing
     
    190190}}}
    191191
    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:
     192Learn 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:
    193193{{{#!ini
    194194[ticket-custom]
     
    226226But English message texts are still the (POSIX) default. If this isn't your preferred language, you can
    227227 1. check 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.
     228 1. do it yourself: see the [trac:wiki:CookBook/PluginL10N#Dotranslatorswork l10n cookbook page for Trac plugins] for more details.
    229229
    230230Contributing your translation is highly appreciated!