[Mpuls-commits] r4912 - in base/trunk: . mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 15 12:39:14 CEST 2011


Author: torsten
Date: 2011-04-15 12:39:12 +0200 (Fri, 15 Apr 2011)
New Revision: 4912

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/phase.py
Log:
Issue2019: Fixed ordering of pages in phase overview. Ordering is now based on appereance of pages in formedtree insted of lexical sorting.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-04-15 10:37:11 UTC (rev 4911)
+++ base/trunk/ChangeLog	2011-04-15 10:39:12 UTC (rev 4912)
@@ -34,6 +34,9 @@
 	number. 
 	* mpulsweb/controllers/case.py (newAction): Call _add_custom_fields to
 	add custom fields when creating a new case.
+	* mpulsweb/model/phase.py (getLinks): Issue2019: Fixed ordering of pages in phase
+	overview. Ordering is now based on appereance of pages in formedtree
+	insted of lexical sorting.
 
 2011-04-11  Torsten Irlaender <torsten at intevation.de>
 

Modified: base/trunk/mpulsweb/model/phase.py
===================================================================
--- base/trunk/mpulsweb/model/phase.py	2011-04-15 10:37:11 UTC (rev 4911)
+++ base/trunk/mpulsweb/model/phase.py	2011-04-15 10:39:12 UTC (rev 4912)
@@ -336,23 +336,28 @@
         return (str(phase )in self.suc) or (str(phase )in self.pre)
 
     def getLinks(self):
+        case_id = self.it.getRootNode().getIdentifier()
         pages = {}
+        key2page = {}
+        tree_order = []
         order = []
         p2 = {}
         if len(self.fields) > 0:
             for field in [field for field in self.fields]:
                 if not p2.has_key(field.page):
+                    tree_order.append(field.page)
                     p2[field.page] = []
                 p2[field.page].append(field)
         for p, f in p2.iteritems():
             if p == 'ee': continue #(hidden)
-            case_id = self.it.getRootNode().getIdentifier()
             realid = "%s:%s" % (p, case_id)
             item = self.it.getItem(realid)
             key = item.getMeta().getDescription()
+            key2page[p] = key
             pages[key] = f
-            order.append(key)
-        order.sort()
+        # Ordering based of treestructure
+        for o in tree_order:
+            order.append(key2page.get(o))
         return pages, order
 
     def getTime(self):



More information about the Mpuls-commits mailing list