Modify

Opened 11 years ago

Last modified 11 years ago

#11063 new enhancement

Allow effective passing of URL parameters to /newticket

Reported by: Steffen Hoffmann Owned by: Reinhard Wobst
Priority: normal Component: CondFieldsGenshiPlugin
Severity: normal Keywords: hide passthrough
Cc: falkb Trac Release: 0.12

Description

Fields handled by this plugin (tweaks option) get totally removed from the ticket page.

To be able to still set an invisible ticket field the field needs to be preserved in the ticket Modify form at the bottom of ticket page. This feature is proposed here as per user request.

Suggested implementation: Introduce a new option in addition to tweaks, that specifically holds names of ticket fields, that should be hidden instead of removed.

Attachments (2)

passthrough.patch (3.8 KB) - added by Steffen Hoffmann 11 years ago.
patch for a minimal implementation for hidden - not removed - fields
20130513_condfieldsgenshi_newticket_desc-with-preliminary-patch.png (24.4 KB) - added by Steffen Hoffmann 11 years ago.
visual result of calling /newticket?type=Foo&description=[[Include(PageTemplates/Foo/V1)]] in Trac 1.0.1 - German localization

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by Steffen Hoffmann

Attachment: passthrough.patch added

patch for a minimal implementation for hidden - not removed - fields

comment:1 Changed 11 years ago by Steffen Hoffmann

(From patch comment - see original format of that file): CondFieldsGenshiPlugin: New option to pass field values to Trac even for disabled fields.

Important code fragments have been taken from timingandestimationplugin/blackmagic.py in branch 'trac0.11-Permissions' of TimingAndEstimationPlugin.

Fields given by new option 'hide' are transformed to hidden fields instead of totally removing them from the ticket form, what makes them effectively immutable. Hidden fields can receive values via parameters given in the URL to '/newticket' for promotion into submitted tickets.

comment:2 Changed 11 years ago by Steffen Hoffmann

Issues/comments:

  • note different way of Trac Option definition - this way will truly register, visible effect: added documentation for this plugin in <env>/wiki/TracIni, after successful install
  • note duplication of field names - need to add to tweaks AND hide, IMHO this is hackish and should improved towards putting field names only once, but don't rush, because there is another duplication in type_cond clauses (do we really need tweaks option at all?)
  • description ticket field is not properly removed yet (not at all from top ticket box, visual reminders left in bottom editor box), and some users may even rely on that, so it'll require extra care when fixing it

This is up for initial discussion. If you're happy with this (my) way of proposals by filing tickets per issue, I would continue to submit more tickets with patches for various other aspects including the issues mentions above.

comment:3 Changed 11 years ago by falkb

sorry for the delay, now I'm back from the past 4 free days. I applied hasienda's (great!) patch for testing, and I added hide = description in trac.ini:

[condfieldsgenshi]
description.type_cond = !Foo
tweaks = description
hide = description

Then I clicked a custom menu entry which provides this URL, just to open the 'New ticket' form with predefined values for type and description: ticket_foo.href = /newticket?type=Foo&description=[[Include(PageTemplates/Foo/V1)]]

Now what I see for ticket types Foo is: The label of the description field is hidden but not the description input field, which means hiding works but does not hide all what must be hidden. Do you see the bit that is wrong?

comment:4 Changed 11 years ago by Steffen Hoffmann

No, actually I only see a remaining box (shadow of an fieldset), no input. At least not in Trac 1.0, so it ooked rather like a cosmetic issue.

But you may use a different version. Even subtle changes to the template could matter, so I'll do further testing. What Trac version did you use for your test?

I wanted to address more issues once you gave a thumb-up for my way of contributions. Seems like you did it with previous comment, thanks. So I'll continue.

Changed 11 years ago by Steffen Hoffmann

visual result of calling /newticket?type=Foo&description=[[Include(PageTemplates/Foo/V1)]] in Trac 1.0.1 - German localization

comment:5 in reply to:  4 Changed 11 years ago by falkb

Replying to hasienda:

What Trac version did you use for your test?

1.0.1

As soon as I remove hide = description it appears here in exactly the same way as you described in attachment:20130513_condfieldsgenshi_newticket_desc-with-preliminary-patch.png

I wanted to address more issues once you gave a thumb-up for my way of contributions. Seems like you did it with previous comment, thanks. So I'll continue.

Fine with me. I think Reinhard likes it also.

comment:6 Changed 11 years ago by falkb

default = disable is also set in my trac.ini

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Reinhard Wobst.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.