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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 13 15:29:52 CET 2009


Author: torsten
Date: 2009-11-13 15:29:51 +0100 (Fri, 13 Nov 2009)
New Revision: 688

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/case.py
   waska/trunk/waskaweb/model/case.py
   waska/trunk/waskaweb/templates/casemanagement/phase.mako
Log:
Hack: Added hardcoded check if the cm-phase can be startet. Depends on
userdata


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2009-11-13 11:28:26 UTC (rev 687)
+++ waska/trunk/ChangeLog.txt	2009-11-13 14:29:51 UTC (rev 688)
@@ -19,6 +19,13 @@
 	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po,
 	  waskaweb/i18n/de/LC_MESSAGES/waskaweb.mo: New version
 
+	Hack: Disabled start of cm phase in dependency of userdata
+
+	* waskaweb/model/case.py,
+	  waskaweb/controllers/case.py,
+	  waskaweb/templates/casemanagement/phase.mako: Hardcode of check if
+	  the cm phase can be startet. Else: submit-button ist disabled.
+
 2009-11-12 	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Changed phase icons in overview

Modified: waska/trunk/waskaweb/controllers/case.py
===================================================================
--- waska/trunk/waskaweb/controllers/case.py	2009-11-13 11:28:26 UTC (rev 687)
+++ waska/trunk/waskaweb/controllers/case.py	2009-11-13 14:29:51 UTC (rev 688)
@@ -736,8 +736,16 @@
 
         phase = case.getState().getPhase()
 
+
         session_case = session.get('case')
 
+        # Check if the cm can be started
+        v1 = case.letzteschul 
+        v2 = case.prognose
+        c.disable_cm = False
+        if  v1 == 0 or (v1 == 1 and  v2 == 0):
+            c.disable_cm = True 
+
         mode = session_case and session_case.getMode() or "show" 
         link = lambda ti: '"/case/%s/%d/%s"' % (mode, ti.realId(id), ti.key)
 

Modified: waska/trunk/waskaweb/model/case.py
===================================================================
--- waska/trunk/waskaweb/model/case.py	2009-11-13 11:28:26 UTC (rev 687)
+++ waska/trunk/waskaweb/model/case.py	2009-11-13 14:29:51 UTC (rev 688)
@@ -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 from master_tbl_view WHERE id = %(id)s"""
+LOAD_CASE_SQL = """SELECT name_1, vorname_1, bearbeiter_id, kundennummer, erstgespraech, beendigung_5, 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)"""
@@ -399,6 +399,11 @@
         case.cm_end        = result.get('beendigung_5')
         case.editor        = result.get('bearbeiter_id', None)
         case.state         = State(id)
+
+        # Hack. These values are used to determine if the phase of CM can be startet
+        case.letzteschul   = result.get('letzte_jahr_allg_schule')
+        case.prognose      = result.get('prognose_liegt_vor')
+
         return case
 
     def loadByName(self, id, phase, first_name, last_name, knr, bearbeiter_id, einverst, s_id, s_state, s_access, s_cm_finished, s_cm_canceled):
@@ -835,6 +840,10 @@
         self.privacy_statement        = None
         self.aidplan_statement        = None
         self.discretion_statement     = None
+    
+        # Hack. These values are used to check if the cm phase can be started
+        self.letzteschul              = None
+        self.prognose                 = None
 
     def delete(self):
         '''Deletes the case from data base. Returns True if deletion succseeds'''

Modified: waska/trunk/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/phase.mako	2009-11-13 11:28:26 UTC (rev 687)
+++ waska/trunk/waskaweb/templates/casemanagement/phase.mako	2009-11-13 14:29:51 UTC (rev 688)
@@ -45,7 +45,7 @@
       <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))) 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)) 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