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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 16 11:32:16 CET 2010


Author: torsten
Date: 2010-11-16 11:32:16 +0100 (Tue, 16 Nov 2010)
New Revision: 4186

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py
	(_handle_automatic_phase_change): Define translated string in function
	instead of importing them from model/phase.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2010-11-16 10:31:03 UTC (rev 4185)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2010-11-16 10:32:16 UTC (rev 4186)
@@ -15,6 +15,7 @@
 from formed.instance.tree import SetDataException, RepeatInstanceContainerNode
 
 
+from mpulsweb.lib.translation import _
 from mpulsweb.lib.security import checkRole
 from mpulsweb.lib.db import  PostgresDBInterface
 from mpulsweb.lib.navigation import  mark_folderopen
@@ -23,9 +24,7 @@
 from mpulsweb.lib.renderer import ViewRenderer, RepeatGroupRenderer, \
      ErrorRenderer, apply_hidden_booleans, get_child_num
 from mpulsweb.lib.helpers import url_for, dd_mm_YYYY as format_date
-from mpulsweb.model.phase import PhaseFactory, PC_MANUAL, PC_FULLAUTO, \
-     DIALOG_FULLAUTOMATIC_CHANGE_TITLE, DIALOG_FULLAUTOMATIC_CHANGE_TEXT, \
-     DIALOG_HALFAUTOMATIC_CHANGE_TITLE, DIALOG_HALFAUTOMATIC_CHANGE_TEXT
+from mpulsweb.model.phase import PhaseFactory, PC_MANUAL, PC_FULLAUTO
 
 
 log = logging.getLogger(__name__)
@@ -236,6 +235,17 @@
 
     def _handle_automatic_phase_change(self, page_id):
         """Change Phase automatically depending on the state of the case"""
+
+        DIALOG_FULLAUTOMATIC_CHANGE_TITLE=_("Phase automatically changed")
+        DIALOG_FULLAUTOMATIC_CHANGE_TEXT=_("The phase of the case was changed automatically \
+            after checking the filled out required fields. The phase changed from '%s' to '%s'. \
+            Please click on 'Ok', to proceed editing the case.")
+        DIALOG_HALFAUTOMATIC_CHANGE_TITLE=_("Change phase?")
+        DIALOG_HALFAUTOMATIC_CHANGE_TEXT=_("After checking the filled out required fields, it \
+            seems that a phase change can be done from phase '%s' to '%s'. Please click on 'Yes' \
+            to perform the change. Click on 'No' to perform the change later manually on \
+            the phase overview page.")
+
         changemode = g.mpuls_config.get('phases', 'changemode')
         if changemode != PC_MANUAL:
             phases = PhaseFactory().load(session['case'].id)



More information about the Mpuls-commits mailing list