Opened 21 years ago
Last modified 8 years ago
#925 new enhancement
[PATCH] Allow wiki syntax in labels for custom fields
| Reported by: | pkou <pkou at ua.fm> | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | unscheduled |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | custom fields |
| Cc: | m@…, shishz@… | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
The proposal is to add a possibility to use Wiki syntax in labels for custom fields.
Example 1: We need to put emphasis on Platform field
[ticket-custom] platform = select platform.order = 1 platform.label = '''Platform''' platform.options = |Intel P4|Intel XEON|AMD Athlon 64|Other
Example 2: We need to define a link to help screen for Platform field
[ticket-custom] platform = select platform.order = 1 platform.label = [wiki:HelpPlatform Platform] platform.options = |Intel P4|Intel XEON|AMD Athlon 64|Other
Attached patch contains an implementation for the proposal.
Attachments (5)
Change History (21)
by , 21 years ago
| Attachment: | patch-customlabelwiki-r1049.diff added |
|---|
comment:1 by , 20 years ago
Thank to refactoring in Trac 0.9, updated patch is the following:
-
trac/ticket/api.py
21 21 22 22 from trac import perm, util 23 23 from trac.core import * 24 from trac.wiki import wiki_to_oneliner 24 25 25 26 26 27 class TicketSystem(Component): … … 107 108 'name': name, 108 109 'type': self.config.get('ticket-custom', name), 109 110 'order': int(self.config.get('ticket-custom', name + '.order', '0')), 110 'label': self.config.get('ticket-custom', name + '.label', ''),111 'label': wiki_to_oneliner(self.config.get('ticket-custom', name + '.label', ''), self.env, self.env.get_db_cnx()), 111 112 'value': self.config.get('ticket-custom', name + '.value', '') 112 113 } 113 114 if field['type'] == 'select' or field['type'] == 'radio':
It is easy :)
comment:2 by , 20 years ago
| Cc: | added |
|---|
This is the patch against [2678]. Why hasn't this been implemented yet?
-
trac/ticket/api.py
18 18 from trac.core import * 19 19 from trac.perm import IPermissionRequestor 20 20 from trac.wiki import IWikiSyntaxProvider 21 from trac.wiki import wiki_to_oneliner 21 22 from trac.Search import ISearchSource, query_to_sql, shorten_result 22 23 23 24 … … 108 109 'name': name, 109 110 'type': self.config.get('ticket-custom', name), 110 111 'order': int(self.config.get('ticket-custom', name + '.order', '0')), 111 'label': self.config.get('ticket-custom', name + '.label', ''),112 'label': wiki_to_oneliner(self.config.get('ticket-custom', name + '.label', ''), self.env, self.env.get_db_cnx()), 112 113 'value': self.config.get('ticket-custom', name + '.value', '') 113 114 } 114 115 if field['type'] == 'select' or field['type'] == 'radio':
by , 20 years ago
| Attachment: | ticket-custom-field-label-with-wiki-syntax-r2678.patch added |
|---|
comment:3 by , 20 years ago
| Milestone: | → 0.10 |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
Any objection?
by , 20 years ago
| Attachment: | ticket-custom-field-label-with-wiki-syntax-r2894.patch added |
|---|
Updated patch for r2894
comment:4 by , 20 years ago
| Cc: | added |
|---|
comment:5 by , 20 years ago
| Keywords: | workflow added |
|---|
For info, that's currently done in the WorkFlow branch.
comment:6 by , 20 years ago
| Milestone: | 0.10 → 0.11 |
|---|
comment:7 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Status: | assigned → new |
comment:8 by , 20 years ago
| Status: | new → assigned |
|---|
by , 19 years ago
| Attachment: | ticket-custom-field-label-with-wiki-syntax-r3931.patch added |
|---|
Updated patch for r3931
by , 19 years ago
| Attachment: | ticket-custom-field-label-with-wiki-syntax-r4458.patch added |
|---|
Updated patch for r4458
comment:12 by , 17 years ago
I wanted to tackle this yesterday evening, but it is a lot trickier than it looks. Field labels are not only used on the ticket page, but also in the custom query page, in the query form headers and controls, and in the result table header. Some of these locations can manage HTML, and others require text only.
So this functionality actually requires the hypothetical wiki_to_text function I have seen mentioned in #1502 and on trac-dev.
comment:13 by , 15 years ago
| Milestone: | next-major-0.1X → unscheduled |
|---|
comment:14 by , 11 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:15 by , 10 years ago
| Keywords: | patch added |
|---|
comment:16 by , 8 years ago
| Keywords: | custom fields added; patch workflow removed |
|---|



Patch for the changes