[Mpuls-commits] r1910 - in wasko/branches/1.0: . formed waskaweb/controllers waskaweb/i18n waskaweb/i18n/de/LC_MESSAGES waskaweb/model waskaweb/templates/administration

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 8 13:04:23 CET 2010


Author: roland
Date: 2010-03-08 13:04:18 +0100 (Mon, 08 Mar 2010)
New Revision: 1910

Modified:
   wasko/branches/1.0/ChangeLog.txt
   wasko/branches/1.0/formed/waska-hilfetexte.xhtml
   wasko/branches/1.0/waskaweb/controllers/case.py
   wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.mo
   wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
   wasko/branches/1.0/waskaweb/i18n/waskaweb.pot
   wasko/branches/1.0/waskaweb/model/agencysettings.py
   wasko/branches/1.0/waskaweb/model/case.py
   wasko/branches/1.0/waskaweb/model/datapage.py
   wasko/branches/1.0/waskaweb/templates/administration/edit_settings.mako
   wasko/branches/1.0/waskaweb/templates/administration/show_settings.mako
Log:
Added support for evaluation-ID

Modified: wasko/branches/1.0/ChangeLog.txt
===================================================================
--- wasko/branches/1.0/ChangeLog.txt	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/ChangeLog.txt	2010-03-08 12:04:18 UTC (rev 1910)
@@ -1,3 +1,16 @@
+2010-03-08	Roland Geider <roland.geider at intevation.de>
+
+        Added support for evaluation-ID
+
+        * waskaweb/i18n/waskaweb.pot
+        * waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: update translation files
+        * waskaweb/model/agencysettings.py: new function getEvaluationId()
+        * waskaweb/controllers/case.py autogenerate an ID if none is set
+        * waskaweb/templates/administration/show_settings.mako
+        * waskaweb/templates/administration/edit_settings.mako: adapted templates
+        * formed/waska-hilfetexte.xhtml: added content to help files
+
+
 2010-03-04	Frank Koormann <frank.koormann at intevation.de>
 
 	* formed/formedtree_web.xml: Added "Evaluation"

Modified: wasko/branches/1.0/formed/waska-hilfetexte.xhtml
===================================================================
--- wasko/branches/1.0/formed/waska-hilfetexte.xhtml	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/formed/waska-hilfetexte.xhtml	2010-03-08 12:04:18 UTC (rev 1910)
@@ -641,6 +641,18 @@
 	selbständiger Planung und selbständigen Handeln.
       </p>
     </div>
+    <div id="evaluation">
+      <h2>Teilnahme an Evaluation</h2>
+      <p>Wir bitten, die Evaluationsnummer unbedingt einzutragen, wenn der junge
+        Mensch bereit ist, an der Evaluation teilzunehmen und zustimmt, dass die
+        anonymisierten Angaben der Fallakte personenbezogen mit ausgewertet werden
+        dürfen</p>
+       <p>Die Evaluationsnummer setzt sich aus zwei Teilen zusammen, dem
+        Förderkennzeichen der Koordinierungsstelle (bzw. Kompetenzagentur) und
+        einer individuellen Ergänzung für den jungen Menschen</p>
+        <p>Vergleiche hierzu die von der Evaluation per E-Mail versendete
+        ausführliche Beschreibung des gewünschten Vorgehens</p>
+    </div>
     <div id="umgangmitproblemen">
       <h2>Umgang mit Problemen im Sinne von Abhängigkeiten oder
       Verpflichtungen</h2>

Modified: wasko/branches/1.0/waskaweb/controllers/case.py
===================================================================
--- wasko/branches/1.0/waskaweb/controllers/case.py	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/controllers/case.py	2010-03-08 12:04:18 UTC (rev 1910)
@@ -664,15 +664,38 @@
                 session.save()
             except KeyError:
                 print >> sys.stderr, "Error! Could not update Infofield"
-
+        
+        # Special logic for field "teilnahme_evaluation"
+        request_data = request.params.dict_of_lists()
+        
+        # If the young adult does not take part in the evaluation, the evaluation number
+        ## is (re)set to null
+        if ti.name == 'page-2':
+            #print >> sys.stderr, g.formedTree.getData('teilnahme_evaluation')
+            if request.params['teilnahme_evaluation'] in [u'-1', u'1', u'3', u'4', u'5']:
+                request_data['evaluation_nummer'] = ['']
+            # Generate the ID (we do not check for uniqueness)
+            # ID is created from the evaluation abbreviation and a (manually entered) number or sequence
+            elif request_data['evaluation_nummer'] == [u'']:
+                agency = Agency()
+                request_data['evaluation_nummer'] = [u"%s-(bitte ergaenzen)" % (agency.getEvaluationId())]
+        
         # Get old formerrors, save data and store new formdata
         old_errors = case_session.getFormErrors()
         ds_id = request.params["ds"]
         new_errors, page = self.__save(
             ti.name,
-            request.params.dict_of_lists(),
+            request_data,
             old_errors,
             ds_id)
+            
+        # this extra ugly!! (again)
+        if ti.name == 'page-2':
+            new_errors, page = self.__save(
+            ti.name,
+            request_data,
+            old_errors,
+            ds_id)
 
         if new_errors:
             c.status_msg = h.status_message("Eingabedaten fehlerhaft! Daten wurden nicht gespeichert.")

Modified: wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.mo
===================================================================
(Binary files differ)

Modified: wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
===================================================================
--- wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2010-03-08 12:04:18 UTC (rev 1910)
@@ -577,6 +577,11 @@
 msgid "adm_form_settings_fkz"
 msgstr "Antragsnummer der Einrichtung"
 
+#: waskaweb/templates/administration/edit_settings.mako:52
+#: waskaweb/templates/administration/show_settings.mako:38
+msgid "adm_form_settings_evaluation_id"
+msgstr "Evaluationskennzeichen der Kompetenzagentur"
+
 #: waskaweb/templates/administration/edit_settings.mako:6
 #: waskaweb/templates/administration/edit_settings.mako:55
 #: waskaweb/templates/administration/show_settings.mako:34

Modified: wasko/branches/1.0/waskaweb/i18n/waskaweb.pot
===================================================================
--- wasko/branches/1.0/waskaweb/i18n/waskaweb.pot	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/i18n/waskaweb.pot	2010-03-08 12:04:18 UTC (rev 1910)
@@ -538,6 +538,11 @@
 msgid "adm_form_settings_fkz"
 msgstr ""
 
+#: waskaweb/templates/administration/edit_settings.mako:52
+#: waskaweb/templates/administration/show_settings.mako:38
+msgid "adm_form_settings_evaluation_id"
+msgstr ""
+
 #: waskaweb/templates/administration/edit_settings.mako:6
 #: waskaweb/templates/administration/edit_settings.mako:55
 #: waskaweb/templates/administration/show_settings.mako:34

Modified: wasko/branches/1.0/waskaweb/model/agencysettings.py
===================================================================
--- wasko/branches/1.0/waskaweb/model/agencysettings.py	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/model/agencysettings.py	2010-03-08 12:04:18 UTC (rev 1910)
@@ -86,6 +86,9 @@
 
     def getName(self):
        return unicode(str(self.conf.get('ka_name', '')), 'utf-8')
+    
+    def getEvaluationId(self):
+       return unicode(str(self.conf.get('evaluation_id', '')), 'utf-8')
 
     def getMaxSavetime(self):
        return unicode(str(self.conf.get('max_speicherdauer', '')), 'utf-8')

Modified: wasko/branches/1.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/1.0/waskaweb/model/case.py	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/model/case.py	2010-03-08 12:04:18 UTC (rev 1910)
@@ -1181,12 +1181,12 @@
         return True
 
 class State(object):
-    '''This class store the state and the last accesstime of the case.
+    '''This class stores the state and the last accesstime of the case.
     Possible states are:
         * Open (1)
-        * Closes (2)
+        * Closed (2)
         * outstanding deletion (3)
-        * outstanding anonymision (4)
+        * outstanding anonymisation (4)
         * anonymised (5)'''
 
     def getLastDateFromDB(self):

Modified: wasko/branches/1.0/waskaweb/model/datapage.py
===================================================================
--- wasko/branches/1.0/waskaweb/model/datapage.py	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/model/datapage.py	2010-03-08 12:04:18 UTC (rev 1910)
@@ -183,6 +183,7 @@
         to_be_set = {}
 
         for k, v in params.iteritems():
+            #print >> sys.stderr, "params.iteritems(): %s %s " % (k, v)
             if k.startswith("__"):
                 continue
             try:
@@ -207,9 +208,9 @@
             except KeyError, inst:
                 pass
 
+        #print >> sys.stderr, to_be_set
         # flag to indicate if we should flush the page
         dirty = False
-
         # remove variable from dataset which are set to ""
         for wname in widgets.keys() + delete_vars:
             dbPage.setData(wname, None)

Modified: wasko/branches/1.0/waskaweb/templates/administration/edit_settings.mako
===================================================================
--- wasko/branches/1.0/waskaweb/templates/administration/edit_settings.mako	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/templates/administration/edit_settings.mako	2010-03-08 12:04:18 UTC (rev 1910)
@@ -48,6 +48,14 @@
 	        <input type="text" id="fkz" name="fkz" value="${c.form_result.get('fkz', c.agency.getFKZ())| h}" maxlength="60">
               % endif
             </div>
+            <div class="waska_form_element w30">
+	      <label for="evaluation_id">${_('adm_form_settings_evaluation_id')}</label>
+              <input type="text"
+                     id="evaluation_id"
+                     name="evaluation_id"
+                     value="${c.form_result.get('fkz', c.agency.getEvaluationId())| h}"
+                     maxlength="60">
+            </div>
         </fieldset>
         <fieldset>
           <legend>Angaben zu den Fallakten</legend>

Modified: wasko/branches/1.0/waskaweb/templates/administration/show_settings.mako
===================================================================
--- wasko/branches/1.0/waskaweb/templates/administration/show_settings.mako	2010-03-08 09:57:47 UTC (rev 1909)
+++ wasko/branches/1.0/waskaweb/templates/administration/show_settings.mako	2010-03-08 12:04:18 UTC (rev 1910)
@@ -35,8 +35,12 @@
   <td class="table_row_v">${c.agency.getMaxSavetime()| F.NA, h}</td>
 </tr>
 <tr>
-  <td class="label table_header">${_('adm_form_settings_anontransfer')}</td>
-  <td class="table_row_v_2">
+  <td class="label table_header">${_('adm_form_settings_evaluation_id')}</td>
+  <td class="table_row_v_2">${c.agency.getEvaluationId()| F.NA, h}</td>
+</tr>
+<tr>
+  <td class="label table_header_v">${_('adm_form_settings_anontransfer')}</td>
+  <td class="table_row_v">
     % if c.agency.isAnonTransfer():
       ${_('adm_form_settings_anontransfer_yes')}
     % else:



More information about the Mpuls-commits mailing list