Changes between Initial Version and Version 1 of TracTicketsCustomFields


Ignore:
Timestamp:
Oct 11, 2005, 12:16:57 AM (19 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracTicketsCustomFields

    v1 v1  
     1= Custom Ticket Fields =
     2Trac supports adding custom, user-defined fields to the ticket module. Using custom fields, you can add typed, site-specific properties to tickets.
     3
     4'''Note: In Trac 0.8, this feature is still experimental.'''
     5
     6== Configuration ==
     7Configuring custom ticket fields is done in the TracIni config file.
     8
     9All field definitions should be under a section named '''{{{[ticket-custom]}}}''' in the ini-file.
     10
     11The syntax of each field definition is:
     12{{{
     13 FIELD_NAME = TYPE
     14 (FIELD_NAME.OPTION = VALUE)
     15 ...
     16}}}
     17The example below should help to explain the syntax.
     18
     19=== Available Field Types and Options ===
     20 * '''text''': A simple (one line) text field.
     21   * label: Descriptive label.
     22   * value: Default value.
     23   * order: Sort order placement. (Determines relative placement in forms.)
     24 * '''checkbox''': A boolean value check box.
     25   * label: Descriptive label.
     26   * value: Default value (0 or 1).
     27   * order: Sort order placement.
     28 * '''select''': Drop-down select box. Uses a list of values.
     29   * options: List of values, separated by '''|''' (vertical pipe).
     30   * value: Default value (Item #, starting at 0).
     31   * order: Sort order placement.
     32 * '''radio''': Radio buttons. Essentially the same as '''select'''.
     33   * label: Descriptive label.
     34   * options: List of values, separated by '''|''' (vertical pipe).
     35   * value: Default value (Item #, starting at 0).
     36   * order: Sort order placement.
     37 * '''textarea''': Multi-line text area.
     38   * label: Descriptive label.
     39   * value: Default text.
     40   * cols: Width in columns.
     41   * rows: Height in lines.
     42   * order: Sort order placement.
     43
     44=== Sample Config ===
     45{{{
     46[ticket-custom]
     47
     48test_one = text
     49test_one.label = Just a text box
     50
     51test_two = text
     52test_two.label = Another text-box
     53test_two.value = Just a default value
     54
     55test_three = checkbox
     56test_three.label = Some checkbox
     57test_three.value = 1
     58
     59test_four = select
     60test_four.label = My selectbox
     61test_four.options = one|two|third option|four
     62test_four.value = 2
     63
     64test_five = radio
     65test_five.label = Radio buttons are fun
     66test_five.options = uno|dos|tres|cuatro|cinco
     67test_five.value = 1
     68
     69test_six = textarea
     70test_six.label = This is a large textarea
     71test_six.value = Default text
     72test_six.cols = 60
     73test_six.rows = 30
     74}}}
     75
     76=== Notes ===
     77Do not insert space characters between '{{{|}}}'-separated option values for ''radio'' and ''select'' fields.
     78 * ok: {{{FIELD_NAME.options = un|deux|trois}}}
     79 * invalid: {{{FIELD_NAME.options = un | deux | trois}}}
     80
     81----
     82See also: TracTickets, TracIni, TracIniReportCustomFieldSample