[Mpuls-commits] r3308 - base/trunk/mpulsweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Aug 3 09:40:34 CEST 2010
Author: torsten
Date: 2010-08-03 09:40:33 +0200 (Tue, 03 Aug 2010)
New Revision: 3308
Modified:
base/trunk/mpulsweb/model/phase.py
Log:
Return a tuple with a dictionary holding the pages with its fields, and a order list which defines the order in which the pages will be renderered.
Modified: base/trunk/mpulsweb/model/phase.py
===================================================================
--- base/trunk/mpulsweb/model/phase.py 2010-08-03 07:40:18 UTC (rev 3307)
+++ base/trunk/mpulsweb/model/phase.py 2010-08-03 07:40:33 UTC (rev 3308)
@@ -306,13 +306,25 @@
return (str(phase )in self.suc) or (str(phase )in self.pre)
def getLinks(self):
- out = []
+ pages = {}
+ order = []
if len(self.fields) > 0:
+ p2 = {}
for field in [field for field in self.fields]:
- out.append(field.get_link())
- if len(out) == 0:
- out.append(_('No required fields found'))
- return ", ".join(out)
+ link = field.get_link()
+ if not p2.has_key(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()
+ pages[key] = f
+ order.append(key)
+ order.sort()
+ return pages, order
def getTime(self):
return self.date
More information about the Mpuls-commits
mailing list