I tried this a couple of weeks back.  I wanted to rearrange the order
the standard and custom fields showed when creating new tickets and
updating existing tickets (both in the ticket details at the top and
the modify the tickets at the bottom of the ticket).  I found one idea
through google (not in this group or on trac-hacks, etc).  Take the
ticket.html out of the trac egg in the python site library and put it
in your trac templates folder and add the following code to
ticket.html to change the order of the fields on the create ticket and
modify ticket.

<?python
  # define the order
  field_types = [ "program",            "priority",
                  "component",          "severity",
                  "subcomponent",       "category",
                  "milestone",          "funding",
                  "percentcomplete",    "mandate",
                  "totalhours",         "phase",
                  "loehours",           "trstep",
                  "trstep",             "cc",
                  "trstatus",
                  "solution",
                  "keywords",           "cc"
                  "estimatedhours",     "tr"
                  ]

  # Sorting function
  def sort_nicely(field1, field2):
    try:
        idx1 = field_types.index(field1['name'])
    except ValueError:
        idx1 = 1000 # no match, push to the end
    try:
        idx2 = field_types.index(field2['name'])
    except ValueError:
        idx2 = 1000 # no match, push to the end
    return cmp(idx1, idx2)
  fields.sort(cmp=sort_nicely)
?>

What you'll notice is that it doesn't include the fields reporter,
owner, and description.  Those 3 fields are hard wired into
ticket.html so they can't be resorted using this trick.  But you can
hack ticket.html to rearrange the order of description to move it
around.  Of course, then you'll have to deal with re-doing that hack
when you upgrade Trac itself.  That's why I wish a more generic plugin
existed to do this.  If you're using 0.12, be aware the the fields at
to the top of the edit ticket page are in a separate ticket_box.html
file.

FYI, this is incompatible with the plug-in DynamicFields that tries to
show/hide fields based on another field (such as ticket type).  That
plugin would mess up the layout when you changed the order they were
expected to be in with this trick.

On Apr 7, 12:43 pm, Tina Phan <[email protected]> wrote:
> Hello there
> Below is the default ticket in Trac. I would like to modify to it by  add 
> more components to the Trac Ticket, or moving the Description section to the 
> bottom of the page.
> I have been install the workflow, Ticket modified plugins, etc.. but it still 
> does not work. What should I do?
>
> [cid:[email protected]]
>
> Thank you
> Pink
>
>  image001.png
> 23KViewDownload

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to