[Mpuls-commits] r6028 - base/trunk/mpulsweb/controllers
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Tue Aug 14 14:52:51 CEST 2012
Author: torsten
Date: 2012-08-14 14:52:51 +0200 (Tue, 14 Aug 2012)
New Revision: 6028
Modified:
base/trunk/mpulsweb/controllers/formularpage.py
Log:
show text in hald and fullautomatic phase-change dialogs depending if the
meta-server is enabled and the case is linked.
Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py 2012-08-14 12:52:00 UTC (rev 6027)
+++ base/trunk/mpulsweb/controllers/formularpage.py 2012-08-14 12:52:51 UTC (rev 6028)
@@ -238,19 +238,39 @@
"""Change Phase automatically depending on the state of the case"""
fullautomatic_title = _("Phase automatically changed")
- fullautomatic_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.")
halfautomatic_title = _("Change phase?")
- halfautomatic_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.")
+ case = g.case_factory.loadById(session['case'].id)
+ # Depending if the meta-server is enabled we need different dialogs:
+ if g.mpuls_config.is_enabled('case-module', 'meta-server') \
+ and case.getMeta().is_linked():
+ fullautomatic_text = _("The phase of the case was changed automatically"
+ " after checking the filled out required fields."
+ " The phase changed from '%s' to '%s'. The"
+ " case has been synced with the Meta-Server"
+ " Please click on 'Ok', to proceed editing"
+ " the case.")
+ halfautomatic_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 and sync the case with the"
+ " Meta-Server." " Click on 'No' to perform the"
+ " change later" " manually on the phase"
+ " overview page.")
+ else:
+ fullautomatic_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.")
+ halfautomatic_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