Trac is being migrated to new services! Issues can be found in our new
YouTrack instance and WIKI pages can be found on our
website.
File daa_simpleticket_0.11.patch, 1.7 KB (added by datallah, 15 years ago) |
SimpleTicketPlugin patch for 0.11
|
-
|
|
|
2 | 2 | # Copyright (c) 2008 Noah Kantrowitz. All rights reserved. |
3 | 3 | |
4 | 4 | from trac.core import * |
5 | | from trac.web.api import IRequestFilter |
| 5 | from trac.web import IRequestFilter |
6 | 6 | from trac.perm import IPermissionRequestor |
7 | 7 | from trac.config import ListOption, BoolOption |
8 | | from trac.util.compat import set |
9 | 8 | |
10 | 9 | class SimpleTicketModule(Component): |
11 | 10 | """A request filter to implement the SimpleTicket reduced ticket entry form.""" |
… |
… |
|
32 | 31 | do_filter = req.session.get('simpleticket.do_filter', do_filter) |
33 | 32 | |
34 | 33 | if do_filter: |
35 | | hide_fields = set(self.hide_fields) |
36 | | self.log.debug('SimpleTicket: Filtering new ticket form for %s', req.authname) |
37 | | data['fields'] = [f for f in data['fields'] if f['name'] not in hide_fields] |
38 | | |
| 34 | #self.env.log.info(data) |
| 35 | for f in self.hide_fields: |
| 36 | if data.has_key('fields'): |
| 37 | for dict in data['fields']: |
| 38 | if (dict['name'] == f ): |
| 39 | # self.env.log.info(dict['name']) |
| 40 | dict['skip'] = True |
| 41 | dict['rendered'] = 'no' |
| 42 | |
39 | 43 | return template, data, content_type |
40 | 44 | |
41 | 45 | # IPermissionRequestor methods |
42 | 46 | def get_permission_actions(self): |
43 | | yield 'TICKET_CREATE_SIMPLE', ['TICKET_CREATE'] |
44 | | No newline at end of file |
| 47 | yield 'TICKET_CREATE_SIMPLE', ['TICKET_CREATE'] |
| 48 | |
Download in other formats:
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!