[Mpuls-commits] r14 - in trunk: . waskaweb/controllers waskaweb/i18n/de/LC_MESSAGES waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 13 15:04:11 CEST 2008


Author: thomas
Date: 2008-08-13 15:04:10 +0200 (Wed, 13 Aug 2008)
New Revision: 14

Modified:
   trunk/ChangeLog.txt
   trunk/waskaweb/controllers/case.py
   trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
   trunk/waskaweb/lib/casedata.py
   trunk/waskaweb/lib/pdfimporter.py
Log:
Load e09c565b979a into trunk.


Modified: trunk/ChangeLog.txt
===================================================================
--- trunk/ChangeLog.txt	2008-08-13 13:03:49 UTC (rev 13)
+++ trunk/ChangeLog.txt	2008-08-13 13:04:10 UTC (rev 14)
@@ -1,5 +1,33 @@
+2007-12-03  Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: Tagged to Beta 7
+
+2007-12-03  Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/controllers/case.py: Commented out not to
+	  show cases with neglected 'Einverständniserklärung'
+
+	* waskaweb/lib/casedata.py: Commented out debug info.
+
+2007-12-03  Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/casedata.py: Modified not to show cases to
+	  cm_ka where the 'Einverständniserklärung' is set to be
+	  definitely absent. 'admin_ka' sees them all.
+
+	* waskaweb/lib/pdfimporter.py: Modified to handle fields of
+	  'Einverständniserklärung' ('Optionsfeldliste') so that
+	  a 'Nein' is not a definite 'Nein'.
+
 2007-11-30  Torsten Irl�nder <torsten.irlaender at intevation.de>
 
+	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: Tagged Beta 6
+	* waskaweb/model/user.py,
+	* waskaweb/templates/usersettings/edit_settings.py: Reverted change
+	  for non existend standin. Values are now set to "None" instead of "-1"
+
+2007-11-30  Torsten Irl�nder <torsten.irlaender at intevation.de>
+
 	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: Tagged Beta 5
 
 2007-11-30  Torsten Irl�nder <torsten.irlaender at intevation.de>
@@ -16,8 +44,8 @@
 
 2007-11-29  Sascha L. Teichmann <teichmann at intevation.de>
 
-        * waskaweb/config/middleware.py: Removed StaticJavascripts middleware.
-          We don't need this.
+	* waskaweb/config/middleware.py: Removed StaticJavascripts middleware.
+	  We don't need this.
 
 2007-11-29  Torsten Irl�nder <torsten.irlaender at intevation.de>
 

Modified: trunk/waskaweb/controllers/case.py
===================================================================
--- trunk/waskaweb/controllers/case.py	2008-08-13 13:03:49 UTC (rev 13)
+++ trunk/waskaweb/controllers/case.py	2008-08-13 13:04:10 UTC (rev 14)
@@ -578,7 +578,7 @@
             aid_type = request.params.getone('aid_type')
             aid = DataSetAidObject(aid_type)
             ds_id = aid.create(int(case_id))
-            print >> sys.stderr, "aid:%s, %s, %s" % (aid, ds_id, aid.page_id) 
+            #print >> sys.stderr, "aid:%s, %s, %s" % (aid, ds_id, aid.page_id) 
             if ds_id and aid.page_id:
                 return self.edit(str(ds_id), aid.page_id)
             else:

Modified: trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
===================================================================
--- trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:03:49 UTC (rev 13)
+++ trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:04:10 UTC (rev 14)
@@ -128,7 +128,7 @@
 
 #: waskaweb/templates/main.mako:175
 msgid "footer_version"
-msgstr "30.11.07 | Beta 6"
+msgstr "03.12.07 | Beta 7"
 
 #: waskaweb/templates/main_login.mako:38
 #: waskaweb/templates/start/responsible.mako:71

Modified: trunk/waskaweb/lib/casedata.py
===================================================================
--- trunk/waskaweb/lib/casedata.py	2008-08-13 13:03:49 UTC (rev 13)
+++ trunk/waskaweb/lib/casedata.py	2008-08-13 13:04:10 UTC (rev 14)
@@ -15,16 +15,41 @@
 from waskaweb.model.agency import Agency
 from waskaweb.lib.base import session 
 
+import waskaweb.lib.helpers as h
+
 from waskaweb.lib.db import db
 
+
 #sql statements used by the DSFactory
-GET_ALL_DS_SQL = """SELECT id FROM master_tbl_view ORDER by name_1"""
-SEARCH_DS_SQL = """SELECT id FROM master_tbl_view WHERE
-                    vorname_1 ~* %(needle)s OR
-                    name_1 ~* %(needle)s OR
-                    kundennummer ~* %(needle)s 
-                    ORDER by name_1"""
+GET_ALL_DS_SQL = """
+SELECT id FROM master_tbl_view WHERE 
+  einverstaendniserklaerung <> 0
+  ORDER by name_1
+"""
 
+SEARCH_DS_SQL = """
+SELECT id FROM master_tbl_view WHERE
+  einverstaendniserklaerung <> 0 AND
+  (vorname_1 ~* %(needle)s OR
+   name_1 ~* %(needle)s OR
+   kundennummer ~* %(needle)s)
+   ORDER by name_1
+"""
+
+# admin_ka is supposed to see all cases
+ADM_GET_ALL_DS_SQL = """
+SELECT id FROM master_tbl_view
+  ORDER by name_1
+"""
+
+ADM_SEARCH_DS_SQL = """
+SELECT id FROM master_tbl_view WHERE
+  vorname_1 ~* %(needle)s OR
+  name_1 ~* %(needle)s OR
+  kundennummer ~* %(needle)s
+  ORDER by name_1
+"""
+
 #other sql statements
 LOAD_DS_SQL = """SELECT bearbeiter_id FROM master_tbl_view WHERE id = %(id)s"""
 LOAD_STANDIN_SQL = """SELECT n.benutzer_id FROM nm_benutzer_master_tbl_view n
@@ -654,11 +679,16 @@
         try:
             con = db.getConnection()
             cur = con.cursor()
+            # XXX: This is an ugly hack!
+            #isAdm = h.hasRole('admin_ka')
             if search_str:
-                fields = {'needle': search_str}
-                cur.execute(SEARCH_DS_SQL, fields)
+                #query = isAdm and ADM_SEARCH_DS_SQL or SEARCH_DS_SQL
+                query = ADM_SEARCH_DS_SQL
+                cur.execute(query, {'needle': search_str})
             else:
-                cur.execute(GET_ALL_DS_SQL)
+                #query = isAdm and ADM_GET_ALL_DS_SQL or GET_ALL_DS_SQL
+                query = ADM_GET_ALL_DS_SQL
+                cur.execute(query)
             result = cur.fetchall()
             for r in result:
                 ids.append(r[0])

Modified: trunk/waskaweb/lib/pdfimporter.py
===================================================================
--- trunk/waskaweb/lib/pdfimporter.py	2008-08-13 13:03:49 UTC (rev 13)
+++ trunk/waskaweb/lib/pdfimporter.py	2008-08-13 13:04:10 UTC (rev 14)
@@ -519,7 +519,37 @@
                 fe.addMessage(u"Kann Feld 'Begleitung' nicht finden")
         #fe.addMessage(u"exit %s" % self.name)
 
+# In case we find the field 'Optionsfeldliste' we have to check
+# if its value is explicit 'ja'. 'nein' is interpreted as 'noch nicht'.
+class EinverstaendnisErklaerung(ContextAction):
+    def __init__(self, name):
+        ContextAction.__init__(self, name)
+        self.value = None
 
+    def enter(self, xfa_traverser, element):
+        pass
+        #xfa_traverser.fieldExtractor.addMessage(u"enter %s" % self.name)
+
+    def consume(self, xfa_traverser, element, value):
+        fe = xfa_traverser.fieldExtractor
+
+        if element.nodeName == u"Optionsfeldliste":
+            if value.lower() == "ja":
+                self.value = "ja"
+        else:
+            fe.consume(element, value)
+
+    def exit(self, xfa_traverser, element):
+        fe = xfa_traverser.fieldExtractor
+        if not self.value is None:
+            try:
+                match = fe.formularname2widgets[u"Optionsfeldliste"][0]
+                fe.addToRelation(match, self.value)
+            except (IndexError, KeyError):
+                fe.addMessage(u"Kann Feld 'Optionsfeldliste' nicht finden")
+
+        #fe.addMessage(u"exit %s" % self.name)
+
 class XFATraverser:
 
     def __init__(self, fieldExtractor):
@@ -751,10 +781,12 @@
         familiaereSituation = FamiliaereSituation(u"Familiäre_Situation")
         beratungsbedarf     = Beratungsbedarf(u"Beratungsbedarf")
         sozioOeko           = SozioOekonomischLage(u"Sozioökonomische_Lage")
+        einverstaendnis     = EinverstaendnisErklaerung(u"Text")
 
         xfaTraverser.addContextAction(familiaereSituation)
         xfaTraverser.addContextAction(beratungsbedarf)
         xfaTraverser.addContextAction(sozioOeko)
+        xfaTraverser.addContextAction(einverstaendnis)
 
         stdContext = StandardContext("")
         xfaTraverser.traverse(xfaTree, stdContext)



More information about the Mpuls-commits mailing list