Allow configuration of owner link in child tickets table. #13

Open
ChrisNelsonPE opened this Issue Nov 2, 2010 · 0 comments

Comments

Projects
None yet
1 participant

Used to always go to a custom query of all the owner's open tickets. Now can be redirected to any URL that contains the owner's ID, e.g., "/trac/report/99?USER=%s".


diff --git a/tracsubtickets/web_ui.py b/tracsubtickets/web_ui.py
index 5832a37..f45af09 100644
--- a/tracsubtickets/web_ui.py
+++ b/tracsubtickets/web_ui.py
@@ -180,6 +180,7 @@ class SubTicketsModule(Component):
                 div.append(tag.table(tbody, class_='subtickets'))
 
                 columns = self.config.getlist('subtickets', '%s.table_columns' % ticket['type'], default=['type','status','owner'])
+                owner_url = self.config.get('subtickets', 'owner_url')
 
                 # tickets
                 def _func(children, depth=0):
@@ -201,8 +202,11 @@ class SubTicketsModule(Component):
                         # Add other columns as configured.
                         for column in columns:
                             if column == 'owner':
-                                href = req.href.query(status='!closed',
-                                              owner=ticket['owner'])
+                                if owner_url:
+                                    href = req.href(owner_url % ticket['owner'])
+                                else:
+                                    href = req.href.query(status='!closed',
+                                                          owner=ticket['owner'])
                                 e = tag.td(tag.a(ticket['owner'], href=href))
                             else:
                                 e = tag.td(ticket[column])

@roandbox roandbox pushed a commit to roandbox/trac-subtickets-plugin that referenced this issue Jan 11, 2017

@thenor57 thenor57 Fix #13: Use of Options interface everywhere, Fix #8: Milestone query…
… added when milestone field is shown, provide equivalent functionality for pull request #13: control of recursion depth.
dc6d97f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment