[Mpuls-commits] r3717 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 17 11:01:04 CEST 2010


Author: torsten
Date: 2010-09-17 11:01:04 +0200 (Fri, 17 Sep 2010)
New Revision: 3717

Modified:
   base/trunk/mpulsweb/controllers/case.py
Log:
* mpulsweb/controllers/case.py (CaseController._markForAnonymize): Add information if phase is finished or running after anonymisation.


Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2010-09-17 08:58:09 UTC (rev 3716)
+++ base/trunk/mpulsweb/controllers/case.py	2010-09-17 09:01:04 UTC (rev 3717)
@@ -13,7 +13,8 @@
 from mpulsweb.lib.security import checkRole
 from mpulsweb.lib.dialogs import checkPrivacyStatement
 from mpulsweb.lib.validators import SetStandinForm, SetEditorForm, NewCaseForm
-from mpulsweb.lib.anonymize import determineAnonymizedCaseEndPhaseName
+from mpulsweb.lib.anonymize import determineAnonymizedCaseEndPhaseName, \
+determineAnonymizedCaseEndPhase
 from mpulsweb.lib.db import  PostgresDBInterface
 from mpulsweb.model.case import ConsistenceCheckException, SessionCase, \
      MPulsXMLImporter, XMLImportException
@@ -201,12 +202,20 @@
                 return render('/casemanagement/dialogs/failed_markanonymize.mako')
         else:
             # Get description of the phase which will be set after anonymisation
+            phase_name = []
             pdescriptions = g.mpuls_config.get('phases', 'description')[0]
-            
             phase = pdescriptions.get(determineAnonymizedCaseEndPhaseName(case))
+            end_phase = determineAnonymizedCaseEndPhase(case)
+            for ph, pairs in g.mpuls_config.get('phases', 'pairs')[0].iteritems():
+                if str(end_phase) in pairs:
+                    phase_name.append(phase)
+                    if str(end_phase) == pairs[0]:
+                        phase_name.append("(%s)" % _('Running'))
+                    else:
+                        phase_name.append("(%s)" % _('Finished'))
             
             c.dialog_title = ANONYMIZE_CONFIRM
-            c.dialog_text = MARKANONYMIZE_CONFIRM_TEXT % phase
+            c.dialog_text = MARKANONYMIZE_CONFIRM_TEXT % " ".join(phase_name) 
             c.url_yes = h.url_for(controller='/case', action='markForAnonymize',
                                   id=id, confirmed=1)
             c.url_no = url



More information about the Mpuls-commits mailing list