Changes between Initial Version and Version 1 of CondFieldsGenshiPlugin


Ignore:
Timestamp:
May 31, 2012, 3:51:32 PM (12 years ago)
Author:
Reinhard Wobst
Comment:

New hack CondFieldsGenshiPlugin, created by Reinhard

Legend:

Unmodified
Added
Removed
Modified
  • CondFieldsGenshiPlugin

    v1 v1  
     1[[PageOutline(2-5,Contents,pullout)]]
     2
     3= Conditionally display fields based on ticket type =
     4
     5== Description ==
     6
     7With the help of this Trac plugin you can hide or show fields when
     8creating or viewing a ticket, depending on the ticket type. Only the
     9presentation changes, not the contents of the ticket.
     10
     11CondField2 is derived from the CondFieldsPlugin ("Dynamic fields by ticket type"), but it is completely based on Genshi now instead of using
     12Javascript. Moreover, you can select whether selected fields are hidden
     13or shown by default.
     14
     15This plugin is "standalone"; the patch
     16"blackmagic-conditionalfields.patch" in [1] did not match with newer
     17releases of Trac 0.11.
     18
     19Some problems reported about the more powerful DynamicFieldsPlugin (bad scaling
     20for many fields, malfunction if fields are internally sorted, clearing
     21value of hidden fields) should not occur here.
     22
     23It should be easy to extend this plugin, e.g. for dependence on other parameters
     24than ticket type.
     25
     26The plugin was tested under Trac 0.12 but should work under Trac 0.11, too.
     27
     28== Bugs/Feature Requests ==
     29
     30Existing bugs and feature requests for CondFieldsGenshiPlugin are
     31[report:9?COMPONENT=CondFieldsGenshiPlugin here].
     32
     33If you have any issues, create a
     34[http://trac-hacks.org/newticket?component=CondFieldsGenshiPlugin&owner=Reinhard new ticket].
     35
     36== Download ==
     37
     38Download the zipped source from [download:condfieldsgenshiplugin here].
     39
     40== Source ==
     41
     42You can check out CondFieldsGenshiPlugin from [http://trac-hacks.org/svn/condfieldsgenshiplugin here] using Subversion, or [source:condfieldsgenshiplugin browse the source] with Trac.
     43
     44== Example ==
     45
     46First, configure trac.ini as in this example:
     47
     48  [components]
     49  condfield2.* = enabled
     50
     51  ...
     52
     53  [condfield2]
     54  tweaks = field1, field2
     55  default = disable
     56  field1.type_cond = defect
     57  field2.type_cond = task
     58
     59
     60Effect:
     61
     62Now field1 will be shown only if the ticket type is "defect", field2
     63only if the ticket type is "task".
     64
     65The entry "default = disable" means that the field listed under "tweaks"
     66are NOT shown by default.
     67The default value is "default = enable".
     68
     69To disable/enable a field independent of the ticket type, simply write a line
     70like
     71
     72  field1.type_cond = None
     73
     74(supposed there is no "None" type :-).
     75
     76When you change the ticket type, you must type "preview" resp. "submit"
     77before you can see the effect of of condfield2.
     78
     79
     80Bug fix done for "type" field
     81-----------------------------
     82
     83When the ticket type is given as an URL parameter only:
     84
     85.../newticket?type=task
     86
     87and the ticket type field is disabled, this plugin works nevertheless
     88(in contrast to the Dynamic fields by ticket type plugin, cf. [1]).
     89
     90The type field label is extended by "(Fixed)" in this case now.
     91
     92== Recent Changes ==
     93
     94[[ChangeLog(condfieldsgenshiplugin, 3)]]
     95
     96== Author/Contributors ==
     97
     98'''Author:''' [wiki:Reinhard] [[BR]]
     99'''Maintainer:''' [wiki:Reinhard] [[BR]]
     100'''Contributors:'''