Changes between Version 24 and Version 25 of DynamicFieldsPlugin


Ignore:
Timestamp:
Sep 19, 2011, 2:50:07 AM (13 years ago)
Author:
Rob Guttman
Comment:

Added ValidateRule

Legend:

Unmodified
Added
Removed
Modified
  • DynamicFieldsPlugin

    v24 v25  
    11[[PageOutline(2-5,Contents,pullout)]]
    22
    3 = Dynamically hide, default, copy, clear, etc. ticket fields =
     3= Dynamically hide, default, copy, clear, validate, etc. ticket fields =
    44
    55'' '''NOTE: I suggest you use the 0.11 branch only even for Trac 0.12 installations.  The Trac 0.12 branch has some issues.  The plan is to merge the two branches to support both Trac 0.11 and 0.12 on one branch.  Thanks. - robguttman''' ''
     
    1313 * Clear a field's value when another field's value changes
    1414 * Copy one field's value to another field
     15 * Validate a field's value
    1516
    1617
     
    131132The above example introduces the plugin's user preference facility described next.
    132133
     134
     135==== Validate rule ====
     136Some fields may be required (i.e., can't be empty) or must not contain some specific values.  For example:
     137{{{
     138[ticket-custom]
     139owner.invalid_if =
     140severity.invalid_if = pick one
     141}}}
     142
     143The above will prevent the ticket from being submitted if either the owner field is empty or the severity field's value equals "pick one".  The value for the {{{invalid_if}}} rule can be empty or any regular expression.
     144
     145
    133146== User preferences ==
    134147Any 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: