[Mpuls-commits] r2818 - in waska/branches/1.7/waskaweb: controllers model templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 31 12:01:47 CEST 2010


Author: roland
Date: 2010-05-31 12:01:30 +0200 (Mon, 31 May 2010)
New Revision: 2818

Modified:
   waska/branches/1.7/waskaweb/controllers/case.py
   waska/branches/1.7/waskaweb/model/case.py
   waska/branches/1.7/waskaweb/templates/casemanagement/phase.mako
Log:
fix bug in warning dialog in phase overview

Modified: waska/branches/1.7/waskaweb/controllers/case.py
===================================================================
--- waska/branches/1.7/waskaweb/controllers/case.py	2010-05-31 10:01:03 UTC (rev 2817)
+++ waska/branches/1.7/waskaweb/controllers/case.py	2010-05-31 10:01:30 UTC (rev 2818)
@@ -779,6 +779,7 @@
 
         c.phase_pairs   = phases_pairs(fields, phase, self.getNavigation(), link)
         c.current_phase = Phase(phase, True)
+        c.art_beendigung = case.art_beendigung
 
         c.form_navigation  = self._getFormNavigation()
         return render('/casemanagement/phase.mako')

Modified: waska/branches/1.7/waskaweb/model/case.py
===================================================================
--- waska/branches/1.7/waskaweb/model/case.py	2010-05-31 10:01:03 UTC (rev 2817)
+++ waska/branches/1.7/waskaweb/model/case.py	2010-05-31 10:01:30 UTC (rev 2818)
@@ -116,11 +116,12 @@
     email_1,
     art_beendigung,
     vermittlung,
+    art_beendigung,
     ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = %(id)s) as tags
 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, ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = %(id)s) as tags 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, ARRAY(SELECT tag_id from nm_tags_cases_view where case_id = %(id)s) as tags, art_beendigung 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)"""
@@ -398,15 +399,15 @@
         finally:
             db.recycleConnection(conn, c)
 
-        case.id = int(id)
-        case.last_name     = unicode(str(result.get('name_1', '')), 'utf-8')
-        case.first_name    = unicode(str(result.get('vorname_1', '')), 'utf-8')
-        case.knr           = unicode(str(result.get('kundennummer', '')), 'utf-8')
-        case.first_meeting = result.get('erstgespraech')
-        case.cm_end        = result.get('beendigung_5')
-        case.editor        = result.get('bearbeiter_id', None)
-        case.tags          = result.get('tags')
-        case.state         = State(id)
+        case.id             = int(id)
+        case.last_name      = unicode(str(result.get('name_1', '')), 'utf-8')
+        case.first_name     = unicode(str(result.get('vorname_1', '')), 'utf-8')
+        case.knr            = unicode(str(result.get('kundennummer', '')), 'utf-8')
+        case.first_meeting  = result.get('erstgespraech')
+        case.cm_end         = result.get('beendigung_5')
+        case.editor         = result.get('bearbeiter_id', None)
+        case.tags           = result.get('tags')
+        case.state          = State(id)
 
         # Hack. These values are used to determine if the phase of CM can be startet
         case.zugang        = result.get('zugang_kompetenzagentur')
@@ -415,6 +416,8 @@
         
         case.beendigung    = result.get('art_beendigung')
         case.phase         = result.get('phase')
+        
+        case.art_beendigung = result.get('art_beendigung')
 
         return case
 
@@ -681,6 +684,7 @@
         self.telephone_more  = ''
         self.mobiletel       = ''
         self.statement       = False
+        self.art_beendigung  = ''
 
         # Parents of the children
         self.parent_first_name  = '' 
@@ -722,6 +726,7 @@
             self.age               = result.get('alter') and "%.0f" % result.get('alter') or "0"
             self.statement         = (result.get('einverstaendniserklaerung') >= 0)
             self.tags              = result.get('tags')
+            self.art_beendigung    = result.get('art_beendigung')
 
             # Parents of the kids
             self.parent_first_name  = unicode(str(result.get('vorname_2', '')), 'utf-8')
@@ -774,12 +779,16 @@
         self.cm_end            = None
         self.privacy_statement = False
 
-        self.street = None 
-        self.plz = None 
-        self.city = None
+        self.street         = None
+        self.plz            = None
+        self.city           = None
+        self.art_beendigung = None
 
     def getState(self):
         return self.state
+    
+    def getArtBeendigung(self):
+        return self.art_beendigung
 
     def getEditor(self):
         return self.state
@@ -859,6 +868,8 @@
         # Hack. These values are used to check if the cm phase can be started
         self.letzteschul              = None
         self.prognose                 = None
+        
+        self.art_beendigung           = None
 
     def delete(self):
         '''Deletes the case from data base. Returns True if deletion succseeds'''
@@ -900,6 +911,7 @@
         session.state             = self.state
         session.first_meeting     = self.first_meeting
         session.cm_end            = self.cm_end
+        session.art_beendigung    = self.art_beendigung
         privacy_statement         = self.getPrivacyStatement()
         session.privacy_statement = privacy_statement.isSigned() 
         return session

Modified: waska/branches/1.7/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- waska/branches/1.7/waskaweb/templates/casemanagement/phase.mako	2010-05-31 10:01:03 UTC (rev 2817)
+++ waska/branches/1.7/waskaweb/templates/casemanagement/phase.mako	2010-05-31 10:01:30 UTC (rev 2818)
@@ -44,12 +44,10 @@
       </td>
       <td>${h.dd_mm_YYYY(p1.getTime(), '-/-')}</td>
       <td style="text-align:right">
-      <% phase_disabled = False %>
         % 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) 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:
-                <% phase_disabled = True %>
                 <input type="submit" value="Start" name="${p1.getLabel()|h}"
                   disabled="disabled">
             % endif
@@ -82,8 +80,7 @@
 </form>
 </div>
 
-
-% if phase_disabled:
+% if c.current_phase.phase == 3 and not c.current_phase.isComplete() and c.art_beendigung == 1:
     <div class="form_errors">
       <h1>Start der Nachbetreeung wurde deaktiviert</h1>
         <p>Der Start der Nachbetreeung wurde deaktiviert, weil die Phase Case Mananagement mit <em>Abbruch</em>



More information about the Mpuls-commits mailing list