Ilias Lazaridis wrote:
> Christian Boos wrote:
> > Ilias Lazaridis wrote:
> > > ...
> > > All patches can be refined during a further rework (e.g. in
> > > collaboration with cboos during introduction of the datetime changes to
> > > the query system).
> >
> > Those changes are in trunk now
> > (http://trac.edgewall.org/changeset/4045), you may want to refresh your
> > patches against them, and I'll take a look
>
> Only one patch has to be changed (the UI one to use http_date).
An initial observation on your #45: it overwrites the "cols" list which
has been previously created, which is probably not what you want to do.
I checked the patches to add the "Created" and "Modified" fields, but a
side effect is that "Created" and "Modified" become available in the
"Add filter" list, since it now thinks they're "text" fields of the
ticket. I believe that the "workflow" branch contained at least the
basis for supporting date fields, though I don't know what the status
was, and it looks like it's going to take some work to get that branch
back in sync with the trunk.
This patch will allow the use of "changetime" and "time" fields for
sorting without putting them in "get_ticket_fields", so it avoids
unwanted side effects:
Index: trac/ticket/query.py
===================================================================
--- trac/ticket/query.py (revision 4062)
+++ trac/ticket/query.py (working copy)
@@ -25,7 +25,7 @@
from trac.perm import IPermissionRequestor
from trac.ticket.api import TicketSystem
from trac.ticket.model import Ticket
-from trac.util.datefmt import to_timestamp, utc
+from trac.util.datefmt import to_timestamp, utc, format_datetime
from trac.util.html import escape, html, unescape
from trac.util.text import shorten_line, CRLF
from trac.web import IRequestHandler
@@ -54,7 +54,7 @@
self.fields = TicketSystem(self.env).get_ticket_fields()
self.cols = [] # lazily initialized
- if self.order != 'id' \
+ if self.order not in ('id', 'changetime', 'time') \
and self.order not in [f['name'] for f in
self.fields]:
# order by priority by default
self.order = 'priority'
@@ -370,6 +370,8 @@
cols = self.get_columns()
labels = dict([(f['name'], f['label']) for f in self.fields])
+ labels['changetime'] = 'Modified'
+ labels['time'] = 'Created'
headers = [{
'name': col, 'label': labels.get(col, 'Ticket'),
'href': self.get_href(req, order=col, desc=(col ==
self.order and
@@ -414,6 +416,8 @@
groups.setdefault(group_key, []).append(ticket)
if not groupsequence or groupsequence[-1] !=
group_key:
groupsequence.append(group_key)
+ ticket['time'] = format_datetime(ticket['time'])
+ ticket['changetime'] =
format_datetime(ticket['changetime'])
description = ticket.get('description')
if description:
ticket['description'] = wiki_to_html(description,
self.env,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/trac-dev
-~----------~----~----~----~------~----~------~--~---