转自:http://blog.csdn.net/phphot/article/details/3490623
最近开始使用trac进行项目管理,和svn同步。使用过程中解决了两个并不常见的问题,贴出来和大家分享。
trac ticket的assign to下拉列表中的名单,没有保存在配置文件里头。读一下TracFaq有下面发现:
This will change the Assign To ticket filed into a select box that only contains existing users. However as it says on the TracTickets page, the user must have logged, in at least once, and set their email address.
If you run multiple Trac sites, and have a set of common users across all Trac sites, it gets annoying to have to log into each one and set the email.
So, what is one to do? Well, there are two things that need to be entered into the database: a session record, and an email record.
所以我们只需要对trac的session表做操作就可以修改assign to的下拉菜单列表。session的表结构如下:
Table "session" Column | Type | Modifiers ---------------+---------+----------- sid | text | not null authenticated | integer | not null last_visit | integer |
缺省配置下,trac ticket的状态和bugzilla的bug状态不一样,只有new,fixed,invalid,wontfix,duplicate,worksforme这几种。在trac 0.11之后,可以自己定义workflow,只需要将trac.ini的[ticket-workflow]章节修改一下,就可以支持verify状态:
accept = new -> assigned
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
reassign = new,assigned,reopened -> new
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reopen = resolved,verified,closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = new,assigned,reopened -> resolved
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY
verify = resolved -> verified
verify.permissions = TICKET_MODIFY
close = verified -> closed
close.permissions = TICKET_MODIFY