Commits

Olemis Lang committed 7f21713

BH_Dashboard: Initial patch to group tickets by datetime field

  • Participants
  • Parent commits 528f01c
  • Branches bh_dashboard_bootstrap

Comments (0)

Files changed (2)

File bh/dashboard/query_groups_datetime.diff

+Use day to group tickets in queries
+
+diff --git a/trac/ticket/query.py b/trac/ticket/query.py
+--- a/trac/ticket/query.py
++++ b/trac/ticket/query.py
+@@ -34,8 +34,9 @@
+ from trac.ticket.api import TicketSystem
+ from trac.ticket.model import Milestone, group_milestones
+ from trac.util import Ranges, as_bool
+-from trac.util.datefmt import format_datetime, from_utimestamp, parse_date, \
+-                              to_timestamp, to_utimestamp, utc, user_time
++from trac.util.datefmt import format_date, format_datetime, from_utimestamp, \
++                              parse_date, to_timestamp, to_utimestamp, utc, \
++                              user_time
+ from trac.util.presentation import Paginator
+ from trac.util.text import empty, shorten_line, quote_query_string
+ from trac.util.translation import _, tag_, cleandoc_
+@@ -752,6 +753,9 @@
+                     ticket['changed'] = True
+             if self.group:
+                 group_key = ticket[self.group]
++                # If grouping by datetime field use days rather than time
++                if self.group in ('changetime', 'time'):
++                    group_key = format_date(group_key)
+                 groups.setdefault(group_key, []).append(ticket)
+                 if not groupsequence or group_key not in groupsequence:
+                     groupsequence.append(group_key)
 tho/themeengine/t-9580-tc-infinite-recursion.diff
 tho/themeengine/t-9580-infinite-recursion.diff
 bh/theme/bootstrap.diff
+bh/dashboard/query_groups_datetime.diff
 # Placed by Bitbucket