You can disable the existing component admin panel by adding the following to your trac.ini file:
[components] trac.ticket.admin.componentadminpanel = disabled Then you can write your own custom admin panel that is basically the same, but incorporates your custom behaviour by extending the IAdminPanelProvider interface that Noah mentioned or by extending TicketAdminPanel like the built-in admin panels do. Maybe you want to also extend the IEnvironmentSetupParticipant interface so you add a table to the database that maps components to a disabled flag. Your custom admin panel would mark the component as disabled instead of deleting it. And then you might need to extend the ITicketManipulator interface so you add an extra ticket validation step that stops users from choosing a component that is disabled. If your feeling really adventurous, you could extend ITemplateStreamFilter to add some fancy javascript to the new ticket page that actually hides the disabled components from view. Everything you want can be done with a plugin and you can find example implementations of all these interfaces on trac-hacks. Indeed, studying stuff on trac-hacks is how I learned all this ;-) I hope this helps. Regards, Mat On Tue, May 26, 2009 at 5:00 PM, Salvio Sergi wrote: > > I think I better clarify my requirements. Maybe I jumped in a solution > which just isn't right... > > > I have configured our trac instance as a single trac project. > > The component field is used exactly as in trac-hacks : basically the > meaning of the component field is "project". This is ok for us because > normally our projects have a limited number of tickets and a short lifespan. > > The list of components is evergrowing but some components can be hidden > once that project is closed. > > Deleting those components is a no-no because it would delete all the > references from the db as well leaving a bunch of "orphaned" tickets... > this is why I want to "hide" components. > > As a complement to this, when a new component is created in the admin > gui it would be nice to fire a simple svn command that would prepare the > basic layout trunk/tags/branches instead of having to create it manually. > > > Hope I'm clear - apologize if this is not the correct list to discuss this. > > > Thanks very much, > - salvio > > > > Noah Kantrowitz wrote: >> That would be doable, but even more complicated. I wouldn't. Trac >> isn't designed as a frontend for svn administration. There are several >> plugins for that as well as other tools that are far better suited to >> the task. If you really want to do this, look at all of the >> trac.admin.api.* interfaces. >> >> --Noah >> >> On May 26, 2009, at 8:44 AM, Salvio Sergi wrote: >> >> >>> OK thanks for the pointer Noah. >>> >>> thing is I want the changes to apply globally both for the web gui and >>> the command line... >>> every time you try to delete a component it should instead mark it as >>> hidden - same goes for the add action... >>> >>> if I go for the new admin GUI can I disable the old one? >>> >>> maybe writing a patch for trac.ticket.model.Component can be easier? I >>> know that every upgrade will be more complex... >>> >>> - salvio >>> >>> ps >>> hey are you the coderanger I see everywhere in trac-hacks? >>> >>> >>> Noah Kantrowitz wrote: >>> -- Mat Booth www.matbooth.co.uk --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" 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-dev?hl=en -~----------~----~----~----~------~----~------~--~---
