incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1359201 - /incubator/bloodhound/trunk/trac/trac/db_default.py
Date Mon, 09 Jul 2012 15:02:39 GMT
Author: gjm
Date: Mon Jul  9 15:02:38 2012
New Revision: 1359201

URL: http://svn.apache.org/viewvc?rev=1359201&view=rev
Log:
trac: fixes report 7 for postgres query with patch suggested in trac:ticket:9311 - closes
#30

Modified:
    incubator/bloodhound/trunk/trac/trac/db_default.py

Modified: incubator/bloodhound/trunk/trac/trac/db_default.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/trac/trac/db_default.py?rev=1359201&r1=1359200&r2=1359201&view=diff
==============================================================================
--- incubator/bloodhound/trunk/trac/trac/db_default.py (original)
+++ incubator/bloodhound/trunk/trac/trac/db_default.py Mon Jul  9 15:02:38 2012
@@ -300,13 +300,22 @@ USER dynamic variable, replaced with the
 logged in user when executed.
 """,
 """\
-SELECT DISTINCT
-       p.value AS __color__,
+SELECT  __color__, __group,
        (CASE
-         WHEN owner = $USER AND status = 'accepted' THEN 'Accepted'
-         WHEN owner = $USER THEN 'Owned'
-         WHEN reporter = $USER THEN 'Reported'
+         WHEN __group = 1 THEN 'Accepted'
+         WHEN __group = 2 THEN 'Owned'
+         WHEN __group = 3 THEN 'Reported'
          ELSE 'Commented' END) AS __group__,
+       ticket, summary, component, version, milestone,
+       type, priority, created, _changetime, _description,
+       _reporter
+FROM (
+ SELECT DISTINCT """ + db.cast('p.value', 'int') + """ AS __color__,
+      (CASE
+         WHEN owner = $USER AND status = 'accepted' THEN 1
+         WHEN owner = $USER THEN 2
+         WHEN reporter = $USER THEN 3
+         ELSE 4 END) AS __group,
        t.id AS ticket, summary, component, version, milestone,
        t.type AS type, priority, t.time AS created,
        t.changetime AS _changetime, description AS _description,
@@ -317,9 +326,8 @@ SELECT DISTINCT
                                 AND tc.field = 'comment'
   WHERE t.status <> 'closed'
         AND (owner = $USER OR reporter = $USER OR author = $USER)
-  ORDER BY (owner = $USER AND status = 'accepted') DESC,
-           owner = $USER DESC, reporter = $USER DESC,
-           """ + db.cast('p.value', 'int') + """, milestone, t.type, t.time
+) AS sub
+ORDER BY __group, __color__, milestone, type, created
 """),
 #----------------------------------------------------------------------------
 ('Active Tickets, Mine first',



Mime
View raw message