[Mpuls-commits] r2036 - wasko/branches/2.0/jmdweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 19 12:46:08 CET 2010


Author: torsten
Date: 2010-03-19 12:46:07 +0100 (Fri, 19 Mar 2010)
New Revision: 2036

Modified:
   wasko/branches/2.0/jmdweb/model/case.py
Log:
* jmdweb/model/case.py (State.getPhaseDescription): Use new phasemodel
  to get decription and state of current phase.


Modified: wasko/branches/2.0/jmdweb/model/case.py
===================================================================
--- wasko/branches/2.0/jmdweb/model/case.py	2010-03-19 11:43:41 UTC (rev 2035)
+++ wasko/branches/2.0/jmdweb/model/case.py	2010-03-19 11:46:07 UTC (rev 2036)
@@ -45,6 +45,7 @@
 from mpulsweb.lib.db import db
 
 from mpulsweb.model.user import UserObject
+from mpulsweb.model.phase import PhaseFactory
 from mpulsweb.model.agencysettings import Agency
 from mpulsweb.model.case import MpulsCase, MpulsCaseFactory, MpulsCaseOverview, \
     MpulsCaseBundle, MpulsCaseStandin
@@ -477,7 +478,15 @@
         return self.phase
 
     def getPhaseDescription(self):
-        return phase_description(self.phase)
+        desc = []
+        phases = PhaseFactory().load(self.master_id)
+        phase = phases.get_current_phase()
+        desc.append(g.mpuls_config.get('phases', 'description')[0].get(phase.phase))
+        if phase.is_active():
+            desc.append(_('Running'))
+        else:
+            desc.append(_('Finished'))
+        return " ".join(desc)
 
     def phasesAreConsistent(self):
         """Returns True when the required fields for the current phase are



More information about the Mpuls-commits mailing list