[Mpuls-commits] r1613 - in waska/trunk/waskaweb: controllers model templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 16 12:42:55 CET 2010


Author: roland
Date: 2010-02-16 12:42:53 +0100 (Tue, 16 Feb 2010)
New Revision: 1613

Modified:
   waska/trunk/waskaweb/controllers/case.py
   waska/trunk/waskaweb/model/case.py
   waska/trunk/waskaweb/templates/casemanagement/phase.mako
Log:
Block post-care if Phase was aborted

Modified: waska/trunk/waskaweb/controllers/case.py
===================================================================
--- waska/trunk/waskaweb/controllers/case.py	2010-02-16 11:04:32 UTC (rev 1612)
+++ waska/trunk/waskaweb/controllers/case.py	2010-02-16 11:42:53 UTC (rev 1613)
@@ -737,13 +737,20 @@
         case   = self._loadCase(id)
 
         # Check if the cm can be started
-        v1 = case.letzteschul 
+        v1 = case.letzteschul
         v2 = case.prognose
         v3 = case.zugang
         c.disable_cm = False
-        c.zugang     = v3 
+        c.zugang     = v3
         if v3 == 23 and (v1 == 0 or (v1 == 1 and  v2 == 0)):
-            c.disable_cm = True 
+            c.disable_cm = True#
+        
+        # Check if we should block the phase
+        v1 = case.phase
+        v2 = case.beendigung
+        c.disable_phase = False
+        if (v1 == 2 or v1 == 3) and (v2 == 1):
+            c.disable_phase = True
 
         fields = case.getRequiredFields()
 

Modified: waska/trunk/waskaweb/model/case.py
===================================================================
--- waska/trunk/waskaweb/model/case.py	2010-02-16 11:04:32 UTC (rev 1612)
+++ waska/trunk/waskaweb/model/case.py	2010-02-16 11:42:53 UTC (rev 1613)
@@ -119,7 +119,7 @@
 FROM master_tbl_view WHERE id = %(id)s
 """
 
-LOAD_CASE_SQL = """SELECT name_1, vorname_1, bearbeiter_id, kundennummer, erstgespraech, beendigung_5, zugang_kompetenzagentur, letzte_jahr_allg_schule, prognose_liegt_vor from master_tbl_view WHERE id = %(id)s"""
+LOAD_CASE_SQL = """SELECT name_1, vorname_1, bearbeiter_id, kundennummer, erstgespraech, beendigung_5, art_beendigung, phase, zugang_kompetenzagentur, letzte_jahr_allg_schule, prognose_liegt_vor from master_tbl_view WHERE id = %(id)s"""
 DELETE_CASE_SQL = """select delete_master_ds(%(id)s)""" 
 
 CREATE_CASE_SQL = """SELECT create_master_ds(%(uuid)s)"""
@@ -409,6 +409,9 @@
         case.zugang        = result.get('zugang_kompetenzagentur')
         case.letzteschul   = result.get('letzte_jahr_allg_schule')
         case.prognose      = result.get('prognose_liegt_vor')
+        
+        case.beendigung    = result.get('art_beendigung')
+        case.phase         = result.get('phase')
 
         return case
 

Modified: waska/trunk/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/phase.mako	2010-02-16 11:04:32 UTC (rev 1612)
+++ waska/trunk/waskaweb/templates/casemanagement/phase.mako	2010-02-16 11:42:53 UTC (rev 1613)
@@ -45,7 +45,19 @@
       <td>${h.dd_mm_YYYY(p1.getTime(), '-/-')}</td>
       <td style="text-align:right">
         % if is_allowed:
-            % if (p1.isRecursiveComplete() and not p1.isRunning()) and (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1)) and not (c.disable_cm and c.current_phase.phase == 1 and p1.phase == 2) or not session.get('case').isYoungerThan('2008-09-01'):
+        % if (
+            (
+                (p1.isRecursiveComplete() and not p1.isRunning())
+                and
+                (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1))
+                and not
+                (c.disable_cm and c.current_phase.phase == 1 and p1.phase == 2)
+                and not
+                (c.disable_phase and c.current_phase.phase == 3 and p1.phase == 4)
+            )
+            or not
+            session.get('case').isYoungerThan('2008-09-01')
+        ):
                 <input type="submit" value="Start" name="${p1.getLabel()|h}">
             % else:
                 <input type="submit" value="Start" name="${p1.getLabel()|h}"



More information about the Mpuls-commits mailing list