Changes between Version 1 and Version 2 of TracTicketsCustomFields
- Timestamp:
- Jun 21, 2008, 6:11:58 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracTicketsCustomFields
v1 v2 1 = カスタムチケット属性=2 Trac ではチケットにユーザ定義の属性を追加できます。カスタムチケット属性を使用すると、定型で、プロジェクト特有のプロパティをチケットに持たせることができます。1 = Custom Ticket Fields = 2 Trac supports adding custom, user-defined fields to the ticket module. Using custom fields, you can add typed, site-specific properties to tickets. 3 3 4 == 設定方法==5 カスタムチケット属性を設定するためには、 [wiki:TracIni trac.ini] ファイルを変更します。カスタムフィールドは、 trac.ini ファイルの `[ticket-custom]` セクションに書く必要があります。 4 == Configuration == 5 Configuring custom ticket fields is done in the [wiki:TracIni trac.ini] file. All field definitions should be under a section named `[ticket-custom]`. 6 6 7 各属性の定義は以下のように記述します:7 The syntax of each field definition is: 8 8 {{{ 9 属性名 = タイプ10 ( 属性名.オプション = 値)9 FIELD_NAME = TYPE 10 (FIELD_NAME.OPTION = VALUE) 11 11 ... 12 12 }}} 13 構文の詳細は以下の例を見てください。 13 The example below should help to explain the syntax. 14 14 15 === 属性のタイプとオプション===16 * '''text''': シンプルな(1行の)テキスト。17 * label: 説明となるラベル18 * value: デフォルト値19 * order: ソート時の並び順 (フォーム内での相対的位置を決定します。)20 * '''checkbox''': ブーリアン値をもつチェックボックス。21 * label: 説明となるラベル。22 * value: デフォルト値 (0 または1).23 * order: ソート時の並び順24 * '''select''': ドロップダウンするリストボックス。25 * label: 説明となるラベル。26 * options: リストに表示する値を '''|''' (vertical pipe) 区切りで記述。27 * value: デフォルト値 (0から始まるリスト内での番号) 。28 * order: ソート時の並び順29 * '''radio''': ラジオボタン。 HTML の '''select''' 要素と同じ。30 * label: 説明となるラベル。31 * options: リストに表示する値を '''|''' (vertical pipe) 区切りで記述。32 * value: デフォルト値 (0から始まるリスト内での番号) 。33 * order: ソート時の並び順34 * '''textarea''': 複数行のテキストエリア。35 * label: 説明となるラベル。36 * value: デフォルトで設定されるテキスト。37 * cols: 入力領域のカラム幅。38 * rows: 入力領域の行数。39 * order: ソート時の並び順15 === Available Field Types and Options === 16 * '''text''': A simple (one line) text field. 17 * label: Descriptive label. 18 * value: Default value. 19 * order: Sort order placement. (Determines relative placement in forms.) 20 * '''checkbox''': A boolean value check box. 21 * label: Descriptive label. 22 * value: Default value (0 or 1). 23 * order: Sort order placement. 24 * '''select''': Drop-down select box. Uses a list of values. 25 * label: Descriptive label. 26 * options: List of values, separated by '''|''' (vertical pipe). 27 * value: Default value (Item #, starting at 0). 28 * order: Sort order placement. 29 * '''radio''': Radio buttons. Essentially the same as '''select'''. 30 * label: Descriptive label. 31 * options: List of values, separated by '''|''' (vertical pipe). 32 * value: Default value (Item #, starting at 0). 33 * order: Sort order placement. 34 * '''textarea''': Multi-line text area. 35 * label: Descriptive label. 36 * value: Default text. 37 * cols: Width in columns. 38 * rows: Height in lines. 39 * order: Sort order placement. 40 40 41 === サンプル===41 === Sample Config === 42 42 {{{ 43 43 [ticket-custom] … … 71 71 }}} 72 72 73 ''Note: `select` タイプのフィールドを非必須 (optional) にしたい場合、 `フィールド名.options` オプションの先頭に `バーティカルパイプ (|)` を設定してください。''73 ''Note: To make entering an option for a `select` type field optional, specify a leading `|` in the `fieldname.options` option.'' 74 74 75 === カスタム属性を含むレポート===75 === Reports Involving Custom Fields === 76 76 77 カスタム属性を含む TracReports では比較的 SQL を間違えやすいです。 `ticket_custom` 表の `JOIN` はカスタム属性ごとにそれぞれ必要です。 77 The SQL required for TracReports to include custom ticket fields is relatively hard to get right. You need a `JOIN` with the `ticket_custom` field for every custom field that should be involved. 78 78 79 以下の例は `progress` という名前のカスタム属性を含むレポートです:79 The following example includes a custom ticket field named `progress` in the report: 80 80 {{{ 81 81 #!sql … … 94 94 }}} 95 95 96 この `LEFT OUTER JOIN` ステートメントに特に注意してください。 96 Note in particular the `LEFT OUTER JOIN` statement here. 97 97 98 98 ----