[Mpuls-commits] r64 - in trunk: . formed waskaweb/controllers waskaweb/i18n/de/LC_MESSAGES waskaweb/lib waskaweb/model waskaweb/templates/casemanagement

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


Author: thomas
Date: 2008-08-13 15:18:37 +0200 (Wed, 13 Aug 2008)
New Revision: 64

Modified:
   trunk/ChangeLog.txt
   trunk/formed/waska-hilfetexte.xhtml
   trunk/waskaweb/controllers/case.py
   trunk/waskaweb/controllers/case_overview.py
   trunk/waskaweb/controllers/error.py
   trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
   trunk/waskaweb/lib/evaluation.py
   trunk/waskaweb/model/agency.py
   trunk/waskaweb/model/case.py
   trunk/waskaweb/model/statement.py
   trunk/waskaweb/templates/casemanagement/new.mako
Log:
Load e0ab0c455763 into trunk.


Modified: trunk/ChangeLog.txt
===================================================================
--- trunk/ChangeLog.txt	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/ChangeLog.txt	2008-08-13 13:18:37 UTC (rev 64)
@@ -1,9 +1,73 @@
+2008-07-22	Sascha L. Teichmann	<sascha.teichmann at intevation.de>
+
+	* waskaweb/templates/casemanagement/new.mako: Added id to label
+	  sign statement correctly.
+
+2008-07-22 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	* waskaweb/controllers/case.py: Fixed confirmation dialog on
+	  anonymisation
+
+	Fixed Issue502
+
+	* waskaweb/controllers/case.py,
+	  waskaweb/model/case.py,
+	  waskaweb/model/statement.py: Set state of EE to undefined on
+	  restoring a case if EE is declined (anonymisation).
+
+2008-07-22 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Tagged as "1.0.3rc9"
+
+	* waskaweb/controllers/error.py: Fixed indention error
+	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: New version string
+
+2008-07-21  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Security fix (http://wiki.pylonshq.com/display/pylonsdocs/0.9.6.2)
+
+	* waskaweb/controllers/error.py: Applied changes suggested in URL above.
+	  TODO: Upgrade to Routes 1.7.3.
+	  Rated impact: We do not use error.py in production. 
+	  Static content is served by Apache. We may need to have a deeper look at
+	  serving documents, XML, XSL and CSV.
+
+2008-07-21  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Fixed issue501
+
+	* waskaweb/controllers/case.py, waskaweb/controllers/case_overview.py:
+	  Used wrong message constants for mark anonymize and anonymized.
+
+2008-07-18  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Fixed issue499
+
+	* waskaweb/controllers/case.py: load case after successful creation.
+
 2008-07-17  Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
+	* waskaweb/lib/evaluation.py, waskaweb/model/agency.py: Fix
+	  for the evaluation server. freie_doku_abschlussbewertung must be NULL
+	  and evaluation server was mispelled.
+	  
+2008-07-17  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
+	Tagged as "1.0.3rc8"
+
+	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: Tagged as "1.0.3rc8"
+
+2008-07-17  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
 	* formed/formedtree_web.xml: Synced with FormEd tree from DB setup.
 
 2008-07-15	Frank Koormann <frank.koormann at intevation.de>
 
+	* formed/waska-hilfetexte.xhtml: Fixed help text reference for 
+	"freie_dokumentation_abschlussbewertung"
+
+2008-07-15	Frank Koormann <frank.koormann at intevation.de>
+
 	* formed/waska-hilfetexte.xhtml: Added help texts for free
 	documentation fields and diseases.
 

Modified: trunk/formed/waska-hilfetexte.xhtml
===================================================================
--- trunk/formed/waska-hilfetexte.xhtml	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/formed/waska-hilfetexte.xhtml	2008-08-13 13:18:37 UTC (rev 64)
@@ -279,7 +279,7 @@
       automatisch bewertet werden kann.</p>
     </div>
 
-    <div id="freiedokumentationzurabschlussbewertung">
+    <div id="freie_dokumentation_abschlussbewertung">
       <h2>Freie Dokumentation zur Abschlußbewertung</h2>
       <p>Die freie Dokumentation gibt Ihnen Raum, den Fall aus professioneller
       Sicht umfangreicher zu bewerten.

Modified: trunk/waskaweb/controllers/case.py
===================================================================
--- trunk/waskaweb/controllers/case.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/controllers/case.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -338,6 +338,8 @@
                 new_params = request.params.dict_of_lists()
                 new_params['ds'] = [case.id]
 
+                load_case(case.id)
+
             except formencode.Invalid, error:
                 c.form_result = error.value
                 c.form_errors = error.error_dict or {}
@@ -1047,7 +1049,7 @@
         c.ds_id   = id
         if confirmed == 1:
             case = self._loadCase(id)
-            case.setState(1)
+            case.restore()
             c.success_for   =   u'Fallakte wiederhergestellt!' 
             c.success_text  =   u'Bitte klicken Sie "OK", um fortzufahren.' 
             c.url_ok        =   h.url_for(controller="/case_overview")
@@ -1111,7 +1113,7 @@
             if confirmed == 1:
                 state = case.getState().setState(4)
                 if state:
-                    c.success_for   =  ANONYMIZE_SUCCESS
+                    c.success_for   =  MARKANONYMIZE_SUCCESS
                     c.success_text  =  MARKANONYMIZE_SUCCESS_TEXT
                     c.url_ok        =  h.url_for(controller="/case_overview")
                     return render('/casemanagement/dialogs/success_markanonymize.mako')
@@ -1135,7 +1137,7 @@
             if confirmed == 1:
                 state = case.getState().setState(4)
                 if state:
-                    c.success_for   =  ANONYMIZE_SUCCESS
+                    c.success_for   =  MARKANONYMIZE_SUCCESS
                     c.success_text  =  MARKANONYMIZE_SUCCESS_TEXT
                     c.url_ok        =  h.url_for(controller="/case_overview")
                     return render('/casemanagement/dialogs/success_markanonymize.mako')
@@ -1158,7 +1160,7 @@
             case = self._loadCase(id)
             if case.anonymize():
                 c.success_for   =  ANONYMIZE_SUCCESS
-                c.success_text  =  MARKANONYMIZE_SUCCESS_TEXT
+                c.success_text  =  ANONYMIZE_SUCCESS_TEXT
                 c.url_ok        =  h.url_for(controller="/case_overview")
                 return render('/casemanagement/dialogs/success_anonymize.mako')
             # TODO: Create Errorpage

Modified: trunk/waskaweb/controllers/case_overview.py
===================================================================
--- trunk/waskaweb/controllers/case_overview.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/controllers/case_overview.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -65,7 +65,7 @@
 
 BUNDLE_NOTIFICATION_NOACTION_HEADER = u"""Keine Aktion für die Auswahl angegeben!"""
 BUNDLE_NOTIFICATION_NOACTION = u"""Sie haben keine Aktion für die Auswahl angegeben. Bitte klicken Sie auf OK, um zur Fallaktenübersicht zu gelangen und dort eine Aktion aus dem Auswahlfeld auszuwählen."""
-MARKANONYMIZE_SUCCESS_HEADER = u"""Fallakten anonymisiert!"""
+MARKANONYMIZE_SUCCESS_HEADER = u"""Fallakte wurde zur Anonymisierung freigegeben!"""
 MARKANONYMIZE_SUCCESS_TEXT = u"""Es wurden %s Fallakten zur Anonymisierung freigegeben. Sie liegen der Administration zur endgültigen Anonymisierung vor. Bitte klicken Sie auf "Ok", um fortzufahren."""
 MARKANONYMIZE_NOTIFICATION_ERROR = u"""Bei dem Freigeben zur Anonymisieren der Fallakten ist ein Fehler aufgetreten. Bitte klicken Sie auf "OK", um fortzufahren.""" 
 ANONYMIZE_SUCCESS_HEADER = u"""Fallakten anonymisiert!"""

Modified: trunk/waskaweb/controllers/error.py
===================================================================
--- trunk/waskaweb/controllers/error.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/controllers/error.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -1,6 +1,8 @@
 import os.path
 
-import paste.fileapp
+#import paste.fileapp
+from paste.urlparser import StaticURLParser
+
 from pylons.middleware import error_document_template, media_path
 
 from waskaweb.lib.base import *
@@ -22,18 +24,36 @@
         """Render the error document"""
         page = error_document_template % \
             dict(prefix=request.environ.get('SCRIPT_NAME', ''),
-                 code=request.params.get('code', ''),
-                 message=request.params.get('message', ''))
+            code=request.params.get('code', ''),
+            message=request.params.get('message', ''))
         return page
 
     def img(self, id):
         """Serve Pylons' stock images"""
-        return self._serve_file(os.path.join(media_path, 'img', id))
+        return self._serve_file(os.path.join(media_path, 'img'), id)
 
     def style(self, id):
         """Serve Pylons' stock stylesheets"""
-        return self._serve_file(os.path.join(media_path, 'style', id))
+        return self._serve_file(os.path.join(media_path, 'style'), id)
 
+    def _serve_file(self, root, path):
+        """Call Paste's FileApp (a WSGI application) to serve the file
+        at the specified path
+        """
+        static = StaticURLParser(root)
+        request.environ['PATH_INFO'] = '/%s' % path
+        return static(request.environ, self.start_response)
+
+#   Removed for security reasons: http://wiki.pylonshq.com/display/pylonsdocs/0.9.6.2
+#
+#    def img(self, id):
+#        """Serve Pylons' stock images"""
+#        return self._serve_file(os.path.join(media_path, 'img', id))
+#
+#    def style(self, id):
+#        """Serve Pylons' stock stylesheets"""
+#        return self._serve_file(os.path.join(media_path, 'style', id))
+#
     def _serve_file(self, path):
         """Call Paste's FileApp (a WSGI application) to serve the file
         at the specified path

Modified: trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
===================================================================
--- trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:18:37 UTC (rev 64)
@@ -524,7 +524,7 @@
 
 #: waskaweb/templates/main.mako:197
 msgid "footer_version"
-msgstr "09.07.2008 | Version 1.0.3rc6"
+msgstr "22.07.2008 | Version 1.0.3rc9"
 
 #: waskaweb/templates/main_login.mako:38
 #: waskaweb/templates/start/responsible.mako:149

Modified: trunk/waskaweb/lib/evaluation.py
===================================================================
--- trunk/waskaweb/lib/evaluation.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/lib/evaluation.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -86,8 +86,8 @@
         time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date AND coalesce(%(start_field)s, '1970-01-01'::date) <= coalesce(%(end_field)s, now()) AND coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)" % fields
 
         # Indicator for inconsistent cases (only for evaluation server)
-        if c.isEvalutaionServer:
-            valid_data = "freie_dokumentation_abschlussbewertung IS NOT NULL"
+        if c.isEvaluationServer:
+            valid_data = "freie_dokumentation_abschlussbewertung IS NULL"
         else:
             valid_data = "TRUE"
 

Modified: trunk/waskaweb/model/agency.py
===================================================================
--- trunk/waskaweb/model/agency.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/model/agency.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -38,8 +38,8 @@
 class AgencyBundle:
     def __init__(self, ids=None):
         self.list = []
-        factory = AgencyFactory()
         if ids:
+            factory = AgencyFactory()
             for id in ids:
                 self.list.append(factory.loadByFkz(id))
 

Modified: trunk/waskaweb/model/case.py
===================================================================
--- trunk/waskaweb/model/case.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/model/case.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -171,10 +171,10 @@
         for id in self.case_list:
             case = factory.loadById(id)
             try:
-                case.getState().setState(1)
+                case.restore()
                 num += 1
-            except:
-                print >> sys.stderr, "Could not restore case in bundle"
+            except StandardError, e:
+                print >> sys.stderr, "Could not restore case in bundle: %s" % e
         return num
 
     def markAnonymize(self):
@@ -938,9 +938,15 @@
             return True
         except:
             traceback.print_exc(file=sys.stderr)
-
         return False
 
+    def restore(self):
+        #If case has no EE then set EE to undefined on restore
+        ps = self.getPrivacyStatement()
+        if not ps.isSigned():
+            ps.keepUndefined()
+        self.getState().setState(1)
+
 class State(object):
     '''This class store the state and the last accesstime of the case.
     Possible states are:
@@ -993,7 +999,7 @@
                 self.id          = result.get('id')
                 self.state       = result.get('status')
                 self.access      = result.get('zugriff')
-                self._last_date   = result.get('letzer_termin')
+                self._last_date  = result.get('letzer_termin')
                 self.cm_finished = result.get('cm_beendet')
                 self.cm_canceled = result.get('cm_abbruch')
             finally:

Modified: trunk/waskaweb/model/statement.py
===================================================================
--- trunk/waskaweb/model/statement.py	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/model/statement.py	2008-08-13 13:18:37 UTC (rev 64)
@@ -11,7 +11,7 @@
 import waskaweb.lib.filters as F
 
 GET_STATEMENT_FLAG_SQL = """SELECT einverstaendniserklaerung from page_einverstaendnis_view WHERE id = %(id)s"""
-SET_STATEMENT_FLAG_SQL = """UPDATE page_einverstaendnis_view SET einverstaendniserklaerung = %(value)s WHERE id = %(id)s"""
+SET_STATEMENT_FLAG_SQL = """SELECT set_ee_status(%(id)s, %(value)s)"""
 class Statement:
     def __init__(self, id=None):
         self.case_id = id
@@ -35,6 +35,9 @@
     def sign(self):
         pass
 
+    def keepUndefined(self):
+        pass
+
     def isSigned(self):
         return False
 
@@ -92,6 +95,16 @@
         finally:
             db.recycleConnection(conn, cur)
 
+    def keepUndefined(self):
+        conn, cur = None, None
+        try:
+            conn = db.getConnection()
+            cur = conn.cursor()
+            cur.execute(SET_STATEMENT_FLAG_SQL, {'id': self.case_id, 'value': -1})
+            conn.commit()
+        finally:
+            db.recycleConnection(conn, cur)
+
     def decline(self):
         conn, cur = None, None
         try:

Modified: trunk/waskaweb/templates/casemanagement/new.mako
===================================================================
--- trunk/waskaweb/templates/casemanagement/new.mako	2008-08-13 13:18:06 UTC (rev 63)
+++ trunk/waskaweb/templates/casemanagement/new.mako	2008-08-13 13:18:37 UTC (rev 64)
@@ -32,7 +32,7 @@
 <p>${_('cm_new_p_please_consider_statement')}</p>
 </div>
 <div class="waska_form_element w100">
-<input type="checkbox" name="statement_signed"><label for="statement">${_('cm_new_con_acceptance_statement_true')}</label></div>
+<input type="checkbox" id="statement_signed" name="statement_signed"><label for="statement_signed">${_('cm_new_con_acceptance_statement_true')}</label></div>
 <div class="input_space">
 <input type="hidden" name="page" value="page_1"> 
 <input type="submit" value="Erklärung drucken" name="print">



More information about the Mpuls-commits mailing list