diff -r 511085f6ca61 trac/ticket/roadmap.py
a
|
b
|
def milestone_stats_data(req, stat, name
|
277 | 277 | args = {'milestone': name, grouped_by: group, 'group': 'status'} |
278 | 278 | args.update(extra_args) |
279 | 279 | return req.href.query(args) |
| 280 | if grouped_by == 'component' and group is not None: |
| 281 | group = '^' + group |
280 | 282 | return {'stats': stat, |
281 | 283 | 'stats_href': query_href(stat.qry_args), |
282 | 284 | 'interval_hrefs': [query_href(interval['qry_args']) |
… |
… |
class MilestoneModule(Component):
|
729 | 731 | "ORDER BY %s" % (by, by)) |
730 | 732 | groups = [row[0] for row in cursor] |
731 | 733 | |
| 734 | # Special case if we are sorting by component. |
| 735 | if by == 'component': |
| 736 | previous = '' |
| 737 | newgroups = [] |
| 738 | for component in groups: |
| 739 | previous = component.split('/')[0] |
| 740 | if previous not in newgroups: |
| 741 | newgroups.append(previous) |
| 742 | groups = newgroups; |
| 743 | |
732 | 744 | max_count = 0 |
733 | 745 | group_stats = [] |
734 | 746 | |
735 | 747 | for group in groups: |
736 | | group_tickets = [t for t in tickets if t[by] == group] |
| 748 | if by != 'component': |
| 749 | group_tickets = [t for t in tickets if t[by] == group] |
| 750 | else: |
| 751 | group_tickets = [t for t in tickets if group in t[by]] |
737 | 752 | if not group_tickets: |
738 | 753 | continue |
739 | 754 | |