[Mpuls-commits] r52 - in trunk: . waskaweb/config waskaweb/controllers waskaweb/i18n waskaweb/i18n/de/LC_MESSAGES waskaweb/lib waskaweb/model waskaweb/templates waskaweb/templates/casemanagement waskaweb/templates/start

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


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

Added:
   trunk/waskaweb/lib/sql_helper.py
Removed:
   trunk/waskaweb/model/help.py
Modified:
   trunk/ChangeLog.txt
   trunk/waskaweb/config/routing.py
   trunk/waskaweb/controllers/CaseBase.py
   trunk/waskaweb/controllers/agency_overview.py
   trunk/waskaweb/controllers/case.py
   trunk/waskaweb/controllers/case_overview.py
   trunk/waskaweb/controllers/waska.py
   trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
   trunk/waskaweb/i18n/waskaweb.pot
   trunk/waskaweb/lib/csv.py
   trunk/waskaweb/lib/renderer.py
   trunk/waskaweb/lib/validators.py
   trunk/waskaweb/lib/xmlimport.py
   trunk/waskaweb/model/appointment.py
   trunk/waskaweb/model/case.py
   trunk/waskaweb/model/casedocument.py
   trunk/waskaweb/model/datapage.py
   trunk/waskaweb/templates/casemanagement/agency_overview.mako
   trunk/waskaweb/templates/casemanagement/caselist.mako
   trunk/waskaweb/templates/casemanagement/main.mako
   trunk/waskaweb/templates/casemanagement/overview.mako
   trunk/waskaweb/templates/main.mako
   trunk/waskaweb/templates/start/start.mako
Log:
Load fa663481689a into trunk.


Modified: trunk/ChangeLog.txt
===================================================================
--- trunk/ChangeLog.txt	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/ChangeLog.txt	2008-08-13 13:14:42 UTC (rev 52)
@@ -1,3 +1,137 @@
+2008-05-29	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/csv.py: Build list of used row indices once
+	  instead of repeated field lookup in black list.
+	  
+2008-05-29 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Deactivated Appointments and Reminders on Blackboard for the
+	evaluation server
+
+	* waskaweb/controllers/waska.py,
+	  waskaweb/templates/start/start.mako: Display some information
+	  regarding to the evaluation server instead of reminders and
+	  appointments. 
+
+	Support bundled Actions for all agency at once.
+
+	* waskaweb/config/routing.py: Added new route for agency_overview with
+	  reset parameter
+	* waskaweb/controllers/agency_overview.py: Support doing an bundled
+	  action for all agencys
+	* waskaweb/lib/validators.py,
+          waskaweb/templates/casemanagement/agency_overview.mako: Add new
+	  checkbox to select all agencys.
+	* waskaweb/templates/casemanagement/overview.mako: Add label to a
+	  formular element.
+	* waskaweb/templates/main.mako: Reset agency selection when selection
+	  agencyoverview in the main menue
+
+2008-05-29	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/csv.py: Removed stupid creation of key/value
+	  tuples which resulted in heavy memory loads.
+
+2008-05-28	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/csv.py: Removed stupid sorting of rows. TODO:
+	  Do the same in XML and XSL export.
+
+	* waskaweb/model/case.py: Removed usage of psycopg2.extras.DictCursor
+	  in CSV export.
+
+2008-05-28	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/csv.py: interned column names to save some memory.
+
+2008-05-28	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/csv.py: Make it O(N*logN) instead of O(N^2)
+
+2008-05-28 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Performance improvment on caseoverview.
+
+	* waskaweb/controllers/case_overview.py,
+	  waskaweb/controllers/waska.py,
+	  waskaweb/model/appointment.py,
+	  waskaweb/model/case.py: Do not load the State of an case for every
+	  case. Do it in one search query!.
+
+2008-05-27 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Implemented xml and xsl export for the evaluation server
+
+	* waskaweb/controllers/agency_overview.py: Implemented xml and xls
+	  export.  	
+ 	* waskaweb/templates/casemanagement/agency_overview.mako: Added options for xml and
+	  xsl export to the choice list.
+	* waskaweb/controllers/waska.py: Fixed permission to open start page
+	for users with pb_ka role.
+
+2008-05-27	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/sql_helper.py: New. Optimizes WHERE id clauses.
+
+	* waskaweb/lib/csv.py: Optimized export. TODO: get rid of needless
+	  sorts() and header info for each data set.
+
+2008-05-27	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/lib/xmlimport.py: Do not call UPDATE on a dataset
+	  which has no fields to change.
+
+2008-05-26 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Removed time in caselisting
+
+	* waskaweb/controllers/case.py,
+	  waskaweb/model/case.py,
+	  waskaweb/templates/casemanagement/caselist.mako: The caselisting
+	  does not longer contain the last access time to make the listing
+	  more compact. Reactivated custom formating in model/case.py. This
+	  was deavitvated due to problems with dates before 1900. Added
+	  try-except block to handle this.
+
+	Fixed issue385
+
+	* waskaweb/config/routing.py,
+	  waskaweb/controllers/CaseBase.py,
+	  waskaweb/controllers/case.py,
+	  waskaweb/i18n/de/LC_MESSAGES/waskaweb.po,
+	  waskaweb/i18n/waskaweb.pot,
+	  waskaweb/lib/renderer.py,
+	  waskaweb/model/casedocument.py,
+	  waskaweb/model/datapage.py,
+	  waskaweb/templates/casemanagement/main.mako: Basically inhertied a
+	  new class from DataPage which does not hold any data and therefor
+	  results in an empty formularpage. Drawback: An existend case is
+	  needed.
+
+2008-05-20	Sascha L. Teichmann <teichmann at intevation.de>
+
+	* waskaweb/model/help.py: Removed. Unused duplicate of 
+	  waskaweb/lib/formular_help.py
+
+2008-05-23 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Fixed issue267, Fixed bug that users can set standin without beeing
+	the editor:
+
+	* waskaweb/model/case.py: Add filtering of cases.
+	* waskaweb/templates/casemanagement/caselist.mako: Some cleaup
+	* waskaweb/templates/casemanagement/overview.mako: Added new checkbox
+	  to select all cases for bundled actions.
+	* waskaweb/controllers/case_overview.py: Added logic to fetch alle
+	  cases if the user selects all cases. Filter out cases in set-standin
+	  bundled action if the user is not the editor
+	* waskaweb/lib/validators.py: add new checkbox as valid form param.
+
+	Fixed fix for issue267
+
+	* waskaweb/controllers/case_overview.py: Fixed issue with merging two
+	dctionarys in a session. Before merging the dic is now copied
+
 2008-05-21 	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Another Fix for issue387

Modified: trunk/waskaweb/config/routing.py
===================================================================
--- trunk/waskaweb/config/routing.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/config/routing.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -27,6 +27,7 @@
     map.connect('case/open/:id/:confirmed', controller="case", action="open")
     map.connect('case/close/:id/:confirmed', controller="case", action="close")
     map.connect('case/select/:id/:confirmed', controller="case", action="select")
+    map.connect('case/printAll/:id/:empty', controller="case", action="printAll", empty=0)
     map.connect('case/showAppointment/:id/:confirmed', controller="case", action="showAppointment", confirmed=1)
     map.connect('case/anonymize/:id/:confirmed', controller="case", action="anonymize")
     map.connect('case/:action/:ds_id/:page_id/:form', controller="case") 
@@ -38,7 +39,7 @@
     map.connect('digest', 'case/digest/:id', controller="case", action="digest")
     map.connect('case_overview/overview/:reset', controller="case_overview", action="overview") #for bundles actions in case_overview
     map.connect('case_overview/:action/:confirmed', controller="case_overview") #for bundles actions in case_overview
-    map.connect('agency_overview/:action/:confirmed', controller="agency_overview") #for bundles actions in agency_overview
+    map.connect('agency_overview/overview/:reset', controller="agency_overview", action="overview") #for bundles actions in agency_overview
     map.connect(':controller/:action/:id/:confirmed')
     map.connect(':controller/:action/:id')
     map.connect(':controller/:action/*(file).csv')

Modified: trunk/waskaweb/controllers/CaseBase.py
===================================================================
--- trunk/waskaweb/controllers/CaseBase.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/controllers/CaseBase.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -37,17 +37,17 @@
         if self.navigation: return self.navigation
         redirect_to(h.url_for(controller='/case_overview'))
 
-    def _getRenderdFormElements(self, ti, ds_id, page_id=None, ro_mode=False):
+    def _getRenderdFormElements(self, ti, ds_id, page_id=None, ro_mode=False, no_data=False):
         # Determine if we have an repeat group or a formular page
         what = int(ti.key) == 14 and "rg_aid_overview" or "formular"
         if what == "rg_aid_overview":
             navigation = self._getFormNavigation(selected_key="14")
-            renderer = AidListRenderer(AidList(ds_id), ro_mode)
+            renderer = AidListRenderer(AidList(ds_id), ro_mode, no_data)
             content = renderer.render(ds_id, page_id) 
         else:
             navigation        = self._getFormNavigation(selected_key=ti.key)
             real_id           = ti.realId(ds_id)
-            formdata          = self._getFormdata(ti, real_id)
+            formdata          = self._getFormdata(ti, real_id, no_data)
             vr                = ViewRenderer(formdata, ro_mode)
             content           = vr.renderView(
                 ti.key, 
@@ -68,13 +68,13 @@
         toggle_url = lambda r: '/navigation/toggle/%s/%s' % (id, r.key)
         return self.navigation.render(select_url, toggle_url, selected_key) 
 
-    def _getFormdata(self, treeItem, ds_id):
+    def _getFormdata(self, treeItem, ds_id, no_data=False):
         case = session.get('case')
         if not case:
             redirect_to(controller="/case_overview")
         doc  = g.formedTree
         help = g.helpData
-        page = doc.getPageStore(treeItem.page, ds_id)
+        page = doc.getPageStore(treeItem.page, ds_id, no_data=no_data)
 
         form_errors = case.getFormErrors()
         formdata = FormDataImpl(

Modified: trunk/waskaweb/controllers/agency_overview.py
===================================================================
--- trunk/waskaweb/controllers/agency_overview.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/controllers/agency_overview.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -17,6 +17,14 @@
 from waskaweb.model.agency  import AgencyOverview, AgencyFactory, AgencyBundle
 from waskaweb.model.case  import CaseBundle
 
+from waskaweb.controllers.case_overview import EXPORT_SUCCESS, \
+                                               EXPORT_SUCCESS_EXPLAINATION, \
+                                               EXPORT_SUCCESS_XLS, \
+                                               EXPORT_SUCCESS_XLS_EXPLAINATION, \
+                                               EXPORT_SUCCESS_XML, \
+                                               EXPORT_SUCCESS_XML_EXPLAINATION
+
+
 log = logging.getLogger(__name__)
 
 DELETE_CONFIRM      = u'''Fallakten der Agentur löschen?''' 
@@ -31,9 +39,6 @@
 DIALOG_CONFIRM_DELETE = u'''Fallakten löschen?'''
 DIALOG_CONFIRM_DELETE_EXPLAINATION = u'''Wollen Sie wirklich die Fallakten der folgenden Agenturen löschen?%s'''
 
-EXPORT_SUCCESS = u'''Export erfolgreich - CSV-Datei erstellt!''' 
-EXPORT_SUCCESS_EXPLAINATION = u'''Die Fallakten wurden erfolgreich als CSV-Datei exportiert und stehen zum herunterladen bereit. ''' 
-
 EXPORT_ERROR = u'''Es ist ein Fehler aufgetreten''' 
 EXPORT_ERROR_EXPLAINATION = u'''Bei dem Exportieren der Fallakten ist ein Fehler aufgetreten. Klicken Sie auf "OK", um zur Agenturenübersicht zu gelangen.''' 
 
@@ -51,13 +56,17 @@
         return self.overview()
 
     @checkRole(('pb_ka'))
-    def overview(self):
+    def overview(self, reset=0):
         c.agencys = AgencyOverview()
         user = session['USER_AUTHORIZED']
-        c.form_defaults = {}
-        #c.form_defaults = {'show_own': 1, 'show_other': 0, 'show_open': 1, 'show_closed': 0, 'show_markdelete': 0} 
+
+        if reset:
+            session['CASE_OVERVIEW_SELECTION'] = {}
+            session.save()
+
+        form_defaults = session.get('CASE_OVERVIEW_SELECTION', {})
         overview = render('/casemanagement/agency_overview.mako')
-        return formencode.htmlfill.render(unicode(overview, 'utf-8'),defaults=c.form_defaults)
+        return formencode.htmlfill.render(unicode(overview, 'utf-8'),defaults=form_defaults)
 
     @checkRole(('pb_ka'))
     def delete(self, id, confirmed):
@@ -91,8 +100,14 @@
         try:
             data        = formencode.variabledecode.variable_decode(request.params)
             form_result = validator.to_python(data)
+            session['CASE_OVERVIEW_SELECTION'] = form_result
+            session.save()
             action      = form_result.get('action') 
-            agency_bundle = AgencyBundle(form_result.get('agency_id', []))
+            if form_result.get('all_cases'):
+                agency_ids = [a.fkz for a in AgencyOverview().getDatasets()]
+                agency_bundle = AgencyBundle(agency_ids)
+            else:
+                agency_bundle = AgencyBundle(form_result.get('agency_id', []))
 
             if action == 'no_action':
                 return self.overview() 
@@ -104,10 +119,15 @@
 
             if action == 'delete':
                 return self.deleteBundle(0)
-            if action == 'export':
+            if action == 'exportCSV':
                 # We do not need confirmation here i think as no data will be
                 # modified.
-                return self.exportBundle(1)
+                #return self.exportBundle(1)
+                return self.downloadCSV()
+            if action == 'exportXML':
+                return self.downloadXML()
+            if action == 'exportXLS':
+                return self.downloadXLS()
             else:
                 raise HTTPNotFound()
 
@@ -120,11 +140,29 @@
 
     @checkRole(('pb_ka'))
     def downloadCSV(self):
+        c.success_for  = EXPORT_SUCCESS
+        c.success_text = EXPORT_SUCCESS_EXPLAINATION
         c.download_link = h.url_for(action="downloadCSVAction")
         c.overview_link = h.url_for(action="overview")
         return render('casemanagement/downloadCSV.mako')
 
     @checkRole(('pb_ka'))
+    def downloadXML(self):
+        c.success_for  = EXPORT_SUCCESS_XML
+        c.success_text = EXPORT_SUCCESS_XML_EXPLAINATION
+        c.download_link = h.url_for(action="downloadXMLAction")
+        c.overview_link = h.url_for(action="overview")
+        return render('casemanagement/downloadXML.mako')
+
+    @checkRole(('pb_ka'))
+    def downloadXLS(self):
+        c.success_for  = EXPORT_SUCCESS_XLS
+        c.success_text = EXPORT_SUCCESS_XLS_EXPLAINATION
+        c.download_link = h.url_for(action="downloadXLSAction")
+        c.overview_link = h.url_for(action="overview")
+        return render('casemanagement/downloadXLS.mako')
+
+    @checkRole(('pb_ka'))
     def downloadCSVAction(self):
         agency_bundle = session.get('agencybundle')
         case_ids = []
@@ -144,29 +182,71 @@
         except:
             return render('/tests/trace.mako')
 
-    @checkRole(('pb_ka', 'cm_ka'))
-    def exportBundle(self, confirmed):
-        confirmed           = self._checkBool(confirmed)
-        agency_bundle       = session.get('agencybundle')
-        c.context           = "../main.mako"
-        if confirmed == 1:
-            try:
-                c.success_for  = EXPORT_SUCCESS
-                c.success_text = EXPORT_SUCCESS_EXPLAINATION
-                return render('/casemanagement/downloadCSV.mako')
-            except StandardError, err:
-                c.failed_for  = EXPORT_ERROR
-                c.failed_test = EXPORT_ERROR_EXPLAINATION
-                c.url_ok      = "/agency_overview/"
-                return render('/casemanagement/dialogs/failed_export_agency.mako')
-        else:
-            c.confirm_for = DIALOG_CONFIRM_EXPORT
-            c.question    = DIALOG_CONFIRM_EXPORT_EXPLAINATION % "\n".join(self._buildAgencyList(agency_bundle))
-            c.url_yes     = "/agency_overview/exportBundle/1"
-            c.url_no      = "/agency_overview/"
-            return render('/casemanagement/dialogs/confirm.mako')
+    @checkRole(('pb_ka'))
+    def downloadXMLAction(self):
+        agency_bundle = session.get('agencybundle')
+        case_ids = []
+        for agency in agency_bundle.getAgencys():
+            case_ids.extend(agency.getCaseBundle().listDatasetIds())
+        try:
+            if case_ids:
+                case_bundle = CaseBundle(case_ids)
+                xml = case_bundle.exportAsXML()
+                data = paste.fileapp.DataApp(
+                    xml,
+                    content_type        = 'application/xml',
+                    content_encoding    = 'UTF-8',
+                    cache_control       = 'must-revalidate',
+                    content_disposition = 'attachment; filename="fallakten-export.xml"',
+                    pragma              = 'public')
+                return data(request.environ, self.start_response)
+        except:
+            return render('/tests/trace.mako')
 
     @checkRole(('pb_ka'))
+    def downloadXLSAction(self):
+        agency_bundle = session.get('agencybundle')
+        case_ids = []
+        for agency in agency_bundle.getAgencys():
+            case_ids.extend(agency.getCaseBundle().listDatasetIds())
+        try:
+            if case_ids:
+                case_bundle = CaseBundle(case_ids)
+                xls = case_bundle.exportAsXLS()
+                data = paste.fileapp.DataApp(
+                    xls,
+                    content_type        = 'application/msexcel',
+                    content_disposition = 'attachment; filename="fallakten-export.xls"',
+                    cache_control       = 'must-revalidate',
+                    pragma              = 'public')
+                return data(request.environ, self.start_response)
+        except:
+            return render('/tests/trace.mako')
+
+
+    #@checkRole(('pb_ka', 'cm_ka'))
+    #def exportBundle(self, confirmed):
+    #    confirmed           = self._checkBool(confirmed)
+    #    agency_bundle       = session.get('agencybundle')
+    #    c.context           = "../main.mako"
+    #    if confirmed == 1:
+    #        try:
+    #            c.success_for  = EXPORT_SUCCESS
+    #            c.success_text = EXPORT_SUCCESS_EXPLAINATION
+    #            return render('/casemanagement/downloadCSV.mako')
+    #        except StandardError, err:
+    #            c.failed_for  = EXPORT_ERROR
+    #            c.failed_test = EXPORT_ERROR_EXPLAINATION
+    #            c.url_ok      = "/agency_overview/"
+    #            return render('/casemanagement/dialogs/failed_export_agency.mako')
+    #    else:
+    #        c.confirm_for = DIALOG_CONFIRM_EXPORT
+    #        c.question    = DIALOG_CONFIRM_EXPORT_EXPLAINATION % "\n".join(self._buildAgencyList(agency_bundle))
+    #        c.url_yes     = "/agency_overview/exportBundle/1"
+    #        c.url_no      = "/agency_overview/"
+    #        return render('/casemanagement/dialogs/confirm.mako')
+
+    @checkRole(('pb_ka'))
     def deleteBundle(self, confirmed):
         confirmed           = self._checkBool(confirmed)
         agency_bundle       = session.get('agencybundle')

Modified: trunk/waskaweb/controllers/case.py
===================================================================
--- trunk/waskaweb/controllers/case.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/controllers/case.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -182,7 +182,7 @@
         case = self._loadCase(id)
         c.digest = case.getDigest()
         c.ds_id = id
-        c.last_access = case.getState().getAccessTime('%d.%m.%y %H:%M')
+        c.last_access = case.getState().getAccessTime('%d.%m.%Y %H:%M')
         c.daysToMaxSavetime = case.getState().daysToMaxSavetime()
         c.maxsavetime = case.getState().getMaxSavetime()
         c.finished = case.getState().isCmFinished()
@@ -206,14 +206,15 @@
             raise HTTPNotFound()
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
-    def printAll(self, id):
+    def printAll(self, id, empty):
         id = self._checkInt(id)
+        empty = self._checkBool(empty)
         case = self._loadCase(id)
         formular = []
         c.print_version = 1
         for ti in self.getNavigation().getAllItems():
             if ti.key in ['27', '28', '29', '30']: continue #ignoring empty aid pages
-            content, navigation = self._getRenderdFormElements(ti, id, ro_mode=True)
+            content, navigation = self._getRenderdFormElements(ti, id, ro_mode=True, no_data=empty)
             formular.append("""<h1>%s</h1>""" % ti.description)
             if not ti.children or ti.key == '14': #Only add leaves
                 formular.append(content)
@@ -221,18 +222,18 @@
                 aid_list = AidList(id)
                 for aid in aid_list.getDatasets():
                     ti_rg   = self.getNavigation().getTreeItem(aid.page_id)
-                    content, navigation = self._getRenderdFormElements(ti_rg, aid.id, ro_mode=True)
+                    content, navigation = self._getRenderdFormElements(ti_rg, aid.id, ro_mode=True, no_data=empty)
                     formular.append("""<h1>%s</h1>""" % ti_rg.description)
                     formular.append(content)
 
         c.formular = "<br>".join(formular)
         return render('/casemanagement/formular.mako')
 
-        c.notification_for = PRINTALL_NOTIFICATION 
-        c.notification_text = PRINTALL_NOTIFICATION_TEXT 
-        c.url_ok = h.url_for(action="digest")
-        c.form_navigation = self._getFormNavigation()
-        return render('/casemanagement/dialogs/notificate_printall.mako')
+        #c.notification_for = PRINTALL_NOTIFICATION 
+        #c.notification_text = PRINTALL_NOTIFICATION_TEXT 
+        #c.url_ok = h.url_for(action="digest")
+        #c.form_navigation = self._getFormNavigation()
+        #return render('/casemanagement/dialogs/notificate_printall.mako')
 
     @checkRole('cm_ka')
     def new(self):

Modified: trunk/waskaweb/controllers/case_overview.py
===================================================================
--- trunk/waskaweb/controllers/case_overview.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/controllers/case_overview.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -18,6 +18,8 @@
 from waskaweb.model.user                    import UserListObject, UserObject, UserGroupList
 from waskaweb.controllers.CaseBase          import CasebaseController
 
+from datetime import datetime
+
 log = logging.getLogger(__name__)
 
 DIALOG_EMPTY_SELECTION = u'''Keine Fallakten ausgewählt.'''
@@ -60,6 +62,10 @@
 MARKDELETE_SUCCESS_TEXT = u"""Es wurden %s Fallakten erfolgreich zum Löschen freigegeben. Bitte klicken Sie auf "OK", um fortzufahren.""" 
 MARKDELETE_NOTIFICATION_ERROR = u"""Bei dem Freigeben zum Löschen der Fallakten ist ein Fehler aufgetreten. Bitte klicken Sie auf "OK", um fortzufahren."""
 
+FORM_DEFAULTS = {'show_own': '1', \
+                 'search_str': '', \
+                 'show_open': '1'}
+
 class CaseOverviewController(CasebaseController):
 
     def __before__(self):
@@ -84,19 +90,19 @@
         c.userlist = ulo.getUserList(filter)
 
         c.cases = CaseOverview()
-        default_search_options = {'show_own': u'1', \
-                        'search_str': u'', \
-                        'show_open': u'1'}
-
-        search_options = session.get('CASE_OVERVIEW_SEARCHOPTIONS') or default_search_options 
-        c.cases.search(";".join(self._parseSearchOptions(search_options)))
+        form_defaults = session.get('CASE_OVERVIEW_SEARCHOPTIONS') or FORM_DEFAULTS
+        search_options = self._parseSearchOptions(form_defaults)
+        c.cases.search(";".join(search_options))
         c.cases.sortByLastname()
         # Load case-selection and merge with default search options
-        form_defaults = self.merge_dict(search_options, session.get('CASE_OVERVIEW_SELECTION', {})) 
+        # Ok please close your eyes now!!! This is.... well ugly
+        form_defaults_copy = form_defaults.copy()
+        form_defaults_copy.update(session.get('CASE_OVERVIEW_SELECTION', {}))
         overview = render('/casemanagement/overview.mako')
-        return formencode.htmlfill.render(unicode(overview, 'utf-8'),defaults=form_defaults)
+        return formencode.htmlfill.render(unicode(overview, 'utf-8'),defaults=form_defaults_copy)
 
-    def _parseSearchOptions(self, options):
+    def _parseSearchOptions(self, options=None):
+
         search_options = []
         user = session['USER_AUTHORIZED']
         if options.get('editor', '-1') != '-1':
@@ -143,7 +149,14 @@
             session.save()
             form_result = validator.to_python(data)
             action      = form_result.get('action') 
-            case_bundle = CaseBundle(form_result.get('case_id', []))
+            if form_result.get('all_cases') > 0:
+                # Narf! Load ids of all cases with the last search option again
+                # as they are not included in the submitted data.
+                search_options = session.get('CASE_OVERVIEW_SEARCHOPTIONS') or FORM_DEFAULTS
+                search_str = ";".join(self._parseSearchOptions(search_options))
+                case_bundle = CaseBundle([case.id for case in CaseOverview().search(search_str)])
+            else:
+                case_bundle = CaseBundle(form_result.get('case_id', []))
 
             if case_bundle.isEmpty():
                 c.notification_for  = DIALOG_EMPTY_SELECTION    
@@ -182,11 +195,11 @@
                 # therefor is not allowed to set the standin.
                 filtered = []
                 for case in case_bundle.getCases():
-                    if case.getEditor().id == c.current_user.id or c.current_user.isAdmin():
+                    if case.getEditor().id != c.current_user.id and not c.current_user.isAdmin():
                         filtered.append(case.id)
 
                 # Fiter out case which are not open(1) or inavtice (2)
-                case_bundle = self._filterBundle(case_bundle, (1,2))
+                case_bundle = self._filterBundle(case_bundle, (1,2), filtered)
                 if case_bundle.isEmpty(): return self._emptyListError()
                 c.case_list = case_bundle.getCases()
                 session['casebundle'] = case_bundle
@@ -234,9 +247,9 @@
             return htmlfill.render(unicode(form, 'utf-8'), c.form_result, c.form_errors, auto_insert_errors=False)
         return self.overview()
 
-    def _filterBundle(self, case_bundle, allowedstates):
+    def _filterBundle(self, case_bundle, allowedstates, filtered_cases=None):
         filtered = []
-        for case in case_bundle.getCases():
+        for case in case_bundle.getCases(filtered_cases):
             if case.getState().getState() in allowedstates:
                 filtered.append(case.id)
         case_bundle = CaseBundle(filtered)
@@ -293,8 +306,8 @@
                 num = case_bundle.setStandin(form_result.get('standin'))
                 c.success_text = SETSTANDIN_NOTIFICATION_SUCCESS % str(num)
             except StandardError, err:
-                c.failed_for  = SETSTANDIN_NOTIFICATION_ERROR_HEADER
-                c.failed_text = SETSTANDIN_NOTIFICATION_ERROR
+                c.success_for  = SETSTANDIN_NOTIFICATION_ERROR_HEADER
+                c.success_text = SETSTANDIN_NOTIFICATION_ERROR
             del session['casebundle']
         except formencode.Invalid, error:
             c.form_result = error.value

Modified: trunk/waskaweb/controllers/waska.py
===================================================================
--- trunk/waskaweb/controllers/waska.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/controllers/waska.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -17,6 +17,7 @@
                                        CaseReminderOverview
 
 import md5
+from datetime import datetime
 
 log = logging.getLogger(__name__)
 
@@ -25,31 +26,37 @@
     def index(self):
         redirect_to(action='start')
 
-    @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
+    @checkRole(('admin_ka', 'cm_ka', 'pb_ka', 'pt_dlr'))
     def start(self):
-        # Get list of cases which were not edited longer than the allowed max
-        # savetime
-        maxsavetimelist   = MaxSaveTimeReminderOverview()
-        remindlist        = CaseReminderOverview()
-        #if h.hasRole(['cm_ka']):
-        #    remindlist.join(maxsavetimelist)
-        #    remindlist.sort()
-        #    c.remindlist  = remindlist
-        #else:
-        #    c.remindlist  = maxsavetimelist 
-        c.remindlist  = maxsavetimelist 
-        # Load case and global appointments
-        caseapp           = CaseAppointmentOverview()
-        globalapp         = GlobalAppointmentOverview()
-        # As we want to display both kind of app. we need to join the lists and
-        # sort them
-        if h.hasRole(['cm_ka']):
-            caseapp.join(globalapp)
-            caseapp.join(remindlist)
-            caseapp.sort()
-            c.appointmentlist = caseapp
+        if config['evaluation_server'] == '1': 
+        # On evaluation server do not try to find out which cases are saved
+        # longer than allowed. This would be a real performance killer and
+        # cases are anonymized anyway
+            pass
         else:
-            c.appointmentlist = globalapp
+            # Get list of cases which were not edited longer than the allowed max
+            # savetime
+            maxsavetimelist   = MaxSaveTimeReminderOverview()
+            remindlist        = CaseReminderOverview()
+            #if h.hasRole(['cm_ka']):
+            #    remindlist.join(maxsavetimelist)
+            #    remindlist.sort()
+            #    c.remindlist  = remindlist
+            #else:
+            #    c.remindlist  = maxsavetimelist 
+            c.remindlist  = maxsavetimelist 
+            # Load case and global appointments
+            caseapp           = CaseAppointmentOverview()
+            globalapp         = GlobalAppointmentOverview()
+            # As we want to display both kind of app. we need to join the lists and
+            # sort them
+            if h.hasRole(['cm_ka']):
+                caseapp.join(globalapp)
+                caseapp.join(remindlist)
+                caseapp.sort()
+                c.appointmentlist = caseapp
+            else:
+                c.appointmentlist = globalapp
         return render('/start/start.mako')
 
     def help(self):

Modified: trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po
===================================================================
--- trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/i18n/de/LC_MESSAGES/waskaweb.po	2008-08-13 13:14:42 UTC (rev 52)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: waskaweb 0.0.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
-"POT-Creation-Date: 2008-05-08 17:07+0200\n"
+"POT-Creation-Date: 2008-05-26 12:05+0200\n"
 "PO-Revision-Date: 2007-10-14 20:33+0200\n"
 "Last-Translator: Torsten Irländer<torsten.irlaender at intevation.de>\n"
 "Language-Team: de <LL at li.org>\n"
@@ -204,7 +204,7 @@
 msgid "cm_eval_summary_header_4"
 msgstr "2.2. Alters- und Geschlechterstruktur in %"
 
-#: waskaweb/lib/evaluation.py:173
+#: waskaweb/lib/evaluation.py:175
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:20
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:20
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:132
@@ -212,32 +212,32 @@
 msgid "cm_eval_summary_header_5"
 msgstr "2.3. Migrationshintergrund"
 
-#: waskaweb/lib/evaluation.py:222
+#: waskaweb/lib/evaluation.py:224
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:58
 msgid "cm_eval_header_access_youngster_to_agency"
 msgstr "1.2.1. Zugang des Jugendlichen zur Kompetenzagentur"
 
-#: waskaweb/lib/evaluation.py:266
+#: waskaweb/lib/evaluation.py:268
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:88
 msgid "cm_eval_head_law_access_agency"
 msgstr "1.2.2. Angaben zum Rechtskreis beim Zugang zur Kompetenzagentur"
 
-#: waskaweb/lib/evaluation.py:316
+#: waskaweb/lib/evaluation.py:318
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:34
 msgid "cm_eval_head_where_to_place_youngster"
 msgstr "3.1.1. Wohin wurden die Jugendlichen vermittlelt?"
 
-#: waskaweb/lib/evaluation.py:366
+#: waskaweb/lib/evaluation.py:363
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:64
 msgid "cm_eval_header_law_changed_after_place"
 msgstr "3.1.2. Angaben zum Rechtskreis nach der Vermittlung"
 
-#: waskaweb/lib/evaluation.py:437
+#: waskaweb/lib/evaluation.py:434
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:100
 msgid "cm_eval_header_on_age"
 msgstr "2.2.2. Angaben zur Altersverteilung"
 
-#: waskaweb/lib/evaluation.py:500
+#: waskaweb/lib/evaluation.py:497
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:21
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:21
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:165
@@ -245,7 +245,7 @@
 msgid "cm_eval_summary_header_6"
 msgstr "2.4. Förderbedarf"
 
-#: waskaweb/lib/evaluation.py:562
+#: waskaweb/lib/evaluation.py:559
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:18
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:18
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:33
@@ -253,87 +253,87 @@
 msgid "cm_eval_summary_header_3"
 msgstr "2.1. Verweildauer im CM"
 
-#: waskaweb/lib/renderer.py:208
+#: waskaweb/lib/renderer.py:209
 msgid "cm_rg_aid_overview_table_institution"
 msgstr "Institution"
 
-#: waskaweb/lib/renderer.py:209
+#: waskaweb/lib/renderer.py:210
 msgid "cm_rg_aid_overview_table_offer_type"
 msgstr "Form"
 
-#: waskaweb/lib/renderer.py:210
+#: waskaweb/lib/renderer.py:211
 msgid "cm_rg_aid_overview_table_actions"
 msgstr "Aktionen"
 
-#: waskaweb/lib/renderer.py:212
+#: waskaweb/lib/renderer.py:213
 msgid "cm_rg_aid_overview_table_edit"
 msgstr "Bearbeiten"
 
-#: waskaweb/lib/renderer.py:215
+#: waskaweb/lib/renderer.py:216
 msgid "cm_rg_aid_overview_table_no_offer_found"
 msgstr "Keine Angebote gefunden"
 
-#: waskaweb/lib/renderer.py:216
+#: waskaweb/lib/renderer.py:217
 msgid "cm_rg_aid_overview_legend_legend"
 msgstr "Legende:"
 
-#: waskaweb/lib/renderer.py:217
+#: waskaweb/lib/renderer.py:218
 msgid "cm_rg_aid_overview_legend_bb"
 msgstr "(BB)"
 
-#: waskaweb/lib/renderer.py:218
+#: waskaweb/lib/renderer.py:219
 msgid "cm_rg_aid_overview_legend_common_educational_area"
 msgstr "Allgemein bildenden Bereich"
 
-#: waskaweb/lib/renderer.py:219
+#: waskaweb/lib/renderer.py:220
 msgid "cm_rg_aid_overview_legend_bv"
 msgstr "(BV)"
 
-#: waskaweb/lib/renderer.py:220
+#: waskaweb/lib/renderer.py:221
 msgid "cm_rg_aid_overview_legend_vocational_preparation"
 msgstr "Bereich der Berufsvorbereitung"
 
-#: waskaweb/lib/renderer.py:221
+#: waskaweb/lib/renderer.py:222
 msgid "cm_rg_aid_overview_legend_bq"
 msgstr "(BQ)"
 
-#: waskaweb/lib/renderer.py:222
+#: waskaweb/lib/renderer.py:223
 msgid "cm_rg_aid_overview_legend_qualifications"
 msgstr "Berufliche Qualifizierung"
 
-#: waskaweb/lib/renderer.py:223
+#: waskaweb/lib/renderer.py:224
 msgid "cm_rg_aid_overview_legend_lb"
 msgstr "(LB)"
 
-#: waskaweb/lib/renderer.py:224
+#: waskaweb/lib/renderer.py:225
 msgid "cm_rg_aid_overview_legend_life_skills"
 msgstr "Lebensbewältigung"
 
-#: waskaweb/lib/renderer.py:225
+#: waskaweb/lib/renderer.py:226
 msgid "cm_rg_aid_overview_legend_new_offer"
 msgstr "Neues Angebot hinzufügen"
 
-#: waskaweb/model/case.py:999
+#: waskaweb/model/case.py:1009
 #: waskaweb/templates/casemanagement/caselist.mako:41
 #: waskaweb/templates/casemanagement/caselist.mako:88
 msgid "case_state_label_open"
 msgstr "Offen"
 
-#: waskaweb/model/case.py:1000
+#: waskaweb/model/case.py:1010
 #: waskaweb/templates/casemanagement/caselist.mako:43
 #: waskaweb/templates/casemanagement/caselist.mako:90
 msgid "case_state_label_closed"
 msgstr "Geschlossen"
 
-#: waskaweb/model/case.py:1001
+#: waskaweb/model/case.py:1011
 msgid "case_state_label_outstanding_delete"
 msgstr "Schwebend gelöscht"
 
-#: waskaweb/model/case.py:1002
+#: waskaweb/model/case.py:1012
 msgid "case_state_label_outstanding_anon"
 msgstr "Schwebend anonymisiert"
 
-#: waskaweb/model/case.py:1003
+#: waskaweb/model/case.py:1013
 msgid "case_state_label_anon"
 msgstr "Anonymisiert"
 
@@ -468,7 +468,7 @@
 
 #: waskaweb/templates/main.mako:185
 msgid "footer_version"
-msgstr "09.05.2008 | Version 1.0"
+msgstr "22.05.2008 | Version 1.0"
 
 #: waskaweb/templates/main_login.mako:38
 #: waskaweb/templates/start/responsible.mako:74
@@ -576,7 +576,7 @@
 "auszuwählen."
 
 #: waskaweb/templates/administration/delete_user_helper.mako:25
-#: waskaweb/templates/casemanagement/bundle_editor.mako:29
+#: waskaweb/templates/casemanagement/bundle_editor.mako:28
 #: waskaweb/templates/casemanagement/organisation.mako:38
 msgid "cm_form_editor_submit"
 msgstr "Fallakte übertragen"
@@ -918,8 +918,9 @@
 #: waskaweb/templates/documents/global_overview.mako:40
 #: waskaweb/templates/documents/global_overview.mako:51
 #: waskaweb/templates/documents/global_overview.mako:52
-#: waskaweb/templates/start/appointmentlist.mako:5
-#: waskaweb/templates/start/appointmentlist.mako:8
+#: waskaweb/templates/start/appointmentlist.mako:6
+#: waskaweb/templates/start/appointmentlist.mako:9
+#: waskaweb/templates/start/appointmentlist.mako:13
 #: waskaweb/templates/start/remindlist.mako:4
 msgid "cm_overview_a_show"
 msgstr "Anzeigen"
@@ -1443,6 +1444,9 @@
 #: waskaweb/templates/casemanagement/dialogs/success_delete_cm.mako:5
 #: waskaweb/templates/casemanagement/dialogs/success_markdelete.mako:5
 #: waskaweb/templates/casemanagement/dialogs/success_restore.mako:5
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:6
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:6
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:6
@@ -1453,14 +1457,8 @@
 msgstr "Case-Management"
 
 #: waskaweb/templates/casemanagement/agency_overview.mako:7
-#: waskaweb/templates/casemanagement/bundle_editor.mako:7
-#: waskaweb/templates/casemanagement/bundle_standin.mako:7
-#: waskaweb/templates/casemanagement/downloadCSV.mako:7
-#: waskaweb/templates/casemanagement/downloadXLS.mako:7
-#: waskaweb/templates/casemanagement/downloadXML.mako:7
 #: waskaweb/templates/casemanagement/main.mako:11
 #: waskaweb/templates/casemanagement/overview.mako:7
-#: waskaweb/templates/casemanagement/dialogs/bundle_noselection.mako:6
 #: waskaweb/templates/casemanagement/dialogs/delete_attachment_success.mako:5
 #: waskaweb/templates/statement/dialogs/missing_statement.mako:6
 msgid "cm_np_overview"
@@ -1524,45 +1522,45 @@
 msgid "cm_np_select"
 msgstr "Ausgewählte Fallakte"
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:8
+#: waskaweb/templates/casemanagement/bundle_editor.mako:7
 #: waskaweb/templates/casemanagement/dialogs/failed_seteditor.mako:5
 #: waskaweb/templates/casemanagement/dialogs/notificate_bundle_seteditor.mako:6
 msgid "cm_np_bundled_editor"
 msgstr "Bearbeitung übertragen"
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:13
-#: waskaweb/templates/casemanagement/bundle_standin.mako:13
+#: waskaweb/templates/casemanagement/bundle_editor.mako:12
+#: waskaweb/templates/casemanagement/bundle_standin.mako:12
 #: waskaweb/templates/casemanagement/organisation.mako:12
 msgid "cm_header_organisation"
 msgstr "Organisation"
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:16
+#: waskaweb/templates/casemanagement/bundle_editor.mako:15
 msgid "cm_bundle_editor_explain"
 msgstr "Bitte wählen Sie den neuen Bearbeiter für die folgenden Akten aus"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:8
+#: waskaweb/templates/casemanagement/bundle_standin.mako:7
 #: waskaweb/templates/casemanagement/dialogs/notificate_bundle_setstandin.mako:6
 msgid "cm_np_bundled_standin"
 msgstr "Vertretung setzen"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:16
+#: waskaweb/templates/casemanagement/bundle_standin.mako:15
 #: waskaweb/templates/casemanagement/organisation.mako:41
 msgid "cm_header_standin"
 msgstr "Vertretung"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:17
+#: waskaweb/templates/casemanagement/bundle_standin.mako:16
 msgid "cm_bundle_standin_explain"
 msgstr "Bitte wählen Sie die neuen Vertreter für die folgenden Akten aus"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:29
+#: waskaweb/templates/casemanagement/bundle_standin.mako:28
 msgid "attention"
 msgstr "Achtung"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:29
+#: waskaweb/templates/casemanagement/bundle_standin.mako:28
 msgid "cm_bundle_standin_explain_attention"
 msgstr "Die bereits existierenden Vertretungsregeln werden überschrieben"
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:51
+#: waskaweb/templates/casemanagement/bundle_standin.mako:50
 #: waskaweb/templates/casemanagement/organisation.mako:72
 msgid "cm_form_standin_submit"
 msgstr "Vertretung ändern"
@@ -1691,12 +1689,17 @@
 msgid "cm_header_digest_parent"
 msgstr "Angaben zum Erziehungsberechtigten"
 
-#: waskaweb/templates/casemanagement/downloadCSV.mako:8
+#: waskaweb/templates/casemanagement/downloadCSV.mako:7
+#: waskaweb/templates/casemanagement/downloadXLS.mako:7
+#: waskaweb/templates/casemanagement/downloadXML.mako:7
 #: waskaweb/templates/casemanagement/export.mako:5
 msgid "cm_np_export"
 msgstr "Fallakte exportieren"
 
 #: waskaweb/templates/casemanagement/evaluation.mako:5
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:7
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:7
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:7
@@ -1803,31 +1806,35 @@
 msgid "cm_menu_link_print"
 msgstr "Gesamte Akte drucken"
 
-#: waskaweb/templates/casemanagement/main.mako:58
+#: waskaweb/templates/casemanagement/main.mako:57
+msgid "cm_menu_link_printempty"
+msgstr "Gesamte Akte leer drucken"
+
+#: waskaweb/templates/casemanagement/main.mako:59
 msgid "cm_menu_link_create_reminder"
 msgstr "Wiedervorlage anlegen"
 
-#: waskaweb/templates/casemanagement/main.mako:65
+#: waskaweb/templates/casemanagement/main.mako:66
 msgid "cm_menu_header_seperator"
 msgstr "Überblick"
 
-#: waskaweb/templates/casemanagement/main.mako:68
+#: waskaweb/templates/casemanagement/main.mako:69
 msgid "cm_menu_link_digest"
 msgstr "Zusammenfassung"
 
-#: waskaweb/templates/casemanagement/main.mako:70
+#: waskaweb/templates/casemanagement/main.mako:71
 msgid "cm_menu_link_organisation"
 msgstr "Organisation"
 
-#: waskaweb/templates/casemanagement/main.mako:71
+#: waskaweb/templates/casemanagement/main.mako:72
 msgid "cm_menu_link_appointment"
 msgstr "Termine"
 
-#: waskaweb/templates/casemanagement/main.mako:72
+#: waskaweb/templates/casemanagement/main.mako:73
 msgid "cm_menu_link_documents"
 msgstr "Anlagen"
 
-#: waskaweb/templates/casemanagement/main.mako:78
+#: waskaweb/templates/casemanagement/main.mako:79
 msgid "cm_menu_header_structure"
 msgstr "Gliederung"
 
@@ -2010,10 +2017,6 @@
 msgid "agency_np_bundled_export_failed"
 msgstr "Exportieren fehlgeschlagen"
 
-#: waskaweb/templates/casemanagement/dialogs/notificate_bundle_setstandin.mako:7
-msgid "cm_np_bundled_standin_success"
-msgstr "Vertretung zugewiesen!"
-
 #: waskaweb/templates/casemanagement/dialogs/notificate_import_dub.mako:7
 msgid "cm_np_import_failed"
 msgstr "Import fehlgeschlagen!"
@@ -2045,12 +2048,18 @@
 msgid "cm_np_restore_success"
 msgstr "Wiederherstellen erfolgreich!"
 
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:8
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:8
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:8
 msgid "cm_np_evaluate_result"
 msgstr "Ergebnis der Auswertung"
 
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:10
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:10
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:10
@@ -2633,6 +2642,9 @@
 msgid "adm_np_changepassword"
 msgstr "Benutzerpasswort geändert!"
 
+#~ msgid "cm_np_bundled_standin_success"
+#~ msgstr "Vertretung zugewiesen!"
+
 #~ msgid "no_usergroups_found"
 #~ msgstr "Keine Benutzergruppe gefunden"
 

Modified: trunk/waskaweb/i18n/waskaweb.pot
===================================================================
--- trunk/waskaweb/i18n/waskaweb.pot	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/i18n/waskaweb.pot	2008-08-13 13:14:42 UTC (rev 52)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: waskaweb 0.0.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
-"POT-Creation-Date: 2008-05-08 17:07+0200\n"
+"POT-Creation-Date: 2008-05-26 12:05+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -175,7 +175,7 @@
 msgid "cm_eval_summary_header_4"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:173
+#: waskaweb/lib/evaluation.py:175
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:20
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:20
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:132
@@ -183,32 +183,32 @@
 msgid "cm_eval_summary_header_5"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:222
+#: waskaweb/lib/evaluation.py:224
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:58
 msgid "cm_eval_header_access_youngster_to_agency"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:266
+#: waskaweb/lib/evaluation.py:268
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:88
 msgid "cm_eval_head_law_access_agency"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:316
+#: waskaweb/lib/evaluation.py:318
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:34
 msgid "cm_eval_head_where_to_place_youngster"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:366
+#: waskaweb/lib/evaluation.py:363
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:64
 msgid "cm_eval_header_law_changed_after_place"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:437
+#: waskaweb/lib/evaluation.py:434
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:100
 msgid "cm_eval_header_on_age"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:500
+#: waskaweb/lib/evaluation.py:497
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:21
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:21
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:165
@@ -216,7 +216,7 @@
 msgid "cm_eval_summary_header_6"
 msgstr ""
 
-#: waskaweb/lib/evaluation.py:562
+#: waskaweb/lib/evaluation.py:559
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:18
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:18
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:33
@@ -224,85 +224,85 @@
 msgid "cm_eval_summary_header_3"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:208
+#: waskaweb/lib/renderer.py:209
 msgid "cm_rg_aid_overview_table_institution"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:209
+#: waskaweb/lib/renderer.py:210
 msgid "cm_rg_aid_overview_table_offer_type"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:210
+#: waskaweb/lib/renderer.py:211
 msgid "cm_rg_aid_overview_table_actions"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:212
+#: waskaweb/lib/renderer.py:213
 msgid "cm_rg_aid_overview_table_edit"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:215
+#: waskaweb/lib/renderer.py:216
 msgid "cm_rg_aid_overview_table_no_offer_found"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:216
+#: waskaweb/lib/renderer.py:217
 msgid "cm_rg_aid_overview_legend_legend"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:217
+#: waskaweb/lib/renderer.py:218
 msgid "cm_rg_aid_overview_legend_bb"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:218
+#: waskaweb/lib/renderer.py:219
 msgid "cm_rg_aid_overview_legend_common_educational_area"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:219
+#: waskaweb/lib/renderer.py:220
 msgid "cm_rg_aid_overview_legend_bv"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:220
+#: waskaweb/lib/renderer.py:221
 msgid "cm_rg_aid_overview_legend_vocational_preparation"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:221
+#: waskaweb/lib/renderer.py:222
 msgid "cm_rg_aid_overview_legend_bq"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:222
+#: waskaweb/lib/renderer.py:223
 msgid "cm_rg_aid_overview_legend_qualifications"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:223
+#: waskaweb/lib/renderer.py:224
 msgid "cm_rg_aid_overview_legend_lb"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:224
+#: waskaweb/lib/renderer.py:225
 msgid "cm_rg_aid_overview_legend_life_skills"
 msgstr ""
 
-#: waskaweb/lib/renderer.py:225
+#: waskaweb/lib/renderer.py:226
 msgid "cm_rg_aid_overview_legend_new_offer"
 msgstr ""
 
-#: waskaweb/model/case.py:999 waskaweb/templates/casemanagement/caselist.mako:41
+#: waskaweb/model/case.py:1009 waskaweb/templates/casemanagement/caselist.mako:41
 #: waskaweb/templates/casemanagement/caselist.mako:88
 msgid "case_state_label_open"
 msgstr ""
 
-#: waskaweb/model/case.py:1000 waskaweb/templates/casemanagement/caselist.mako:43
+#: waskaweb/model/case.py:1010 waskaweb/templates/casemanagement/caselist.mako:43
 #: waskaweb/templates/casemanagement/caselist.mako:90
 msgid "case_state_label_closed"
 msgstr ""
 
-#: waskaweb/model/case.py:1001
+#: waskaweb/model/case.py:1011
 msgid "case_state_label_outstanding_delete"
 msgstr ""
 
-#: waskaweb/model/case.py:1002
+#: waskaweb/model/case.py:1012
 msgid "case_state_label_outstanding_anon"
 msgstr ""
 
-#: waskaweb/model/case.py:1003
+#: waskaweb/model/case.py:1013
 msgid "case_state_label_anon"
 msgstr ""
 
@@ -536,7 +536,7 @@
 msgstr ""
 
 #: waskaweb/templates/administration/delete_user_helper.mako:25
-#: waskaweb/templates/casemanagement/bundle_editor.mako:29
+#: waskaweb/templates/casemanagement/bundle_editor.mako:28
 #: waskaweb/templates/casemanagement/organisation.mako:38
 msgid "cm_form_editor_submit"
 msgstr ""
@@ -877,8 +877,9 @@
 #: waskaweb/templates/documents/global_overview.mako:40
 #: waskaweb/templates/documents/global_overview.mako:51
 #: waskaweb/templates/documents/global_overview.mako:52
-#: waskaweb/templates/start/appointmentlist.mako:5
-#: waskaweb/templates/start/appointmentlist.mako:8
+#: waskaweb/templates/start/appointmentlist.mako:6
+#: waskaweb/templates/start/appointmentlist.mako:9
+#: waskaweb/templates/start/appointmentlist.mako:13
 #: waskaweb/templates/start/remindlist.mako:4
 msgid "cm_overview_a_show"
 msgstr ""
@@ -1402,6 +1403,9 @@
 #: waskaweb/templates/casemanagement/dialogs/success_delete_cm.mako:5
 #: waskaweb/templates/casemanagement/dialogs/success_markdelete.mako:5
 #: waskaweb/templates/casemanagement/dialogs/success_restore.mako:5
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:6
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:6
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:6
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:6
@@ -1412,14 +1416,8 @@
 msgstr ""
 
 #: waskaweb/templates/casemanagement/agency_overview.mako:7
-#: waskaweb/templates/casemanagement/bundle_editor.mako:7
-#: waskaweb/templates/casemanagement/bundle_standin.mako:7
-#: waskaweb/templates/casemanagement/downloadCSV.mako:7
-#: waskaweb/templates/casemanagement/downloadXLS.mako:7
-#: waskaweb/templates/casemanagement/downloadXML.mako:7
 #: waskaweb/templates/casemanagement/main.mako:11
 #: waskaweb/templates/casemanagement/overview.mako:7
-#: waskaweb/templates/casemanagement/dialogs/bundle_noselection.mako:6
 #: waskaweb/templates/casemanagement/dialogs/delete_attachment_success.mako:5
 #: waskaweb/templates/statement/dialogs/missing_statement.mako:6
 msgid "cm_np_overview"
@@ -1483,45 +1481,45 @@
 msgid "cm_np_select"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:8
+#: waskaweb/templates/casemanagement/bundle_editor.mako:7
 #: waskaweb/templates/casemanagement/dialogs/failed_seteditor.mako:5
 #: waskaweb/templates/casemanagement/dialogs/notificate_bundle_seteditor.mako:6
 msgid "cm_np_bundled_editor"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:13
-#: waskaweb/templates/casemanagement/bundle_standin.mako:13
+#: waskaweb/templates/casemanagement/bundle_editor.mako:12
+#: waskaweb/templates/casemanagement/bundle_standin.mako:12
 #: waskaweb/templates/casemanagement/organisation.mako:12
 msgid "cm_header_organisation"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_editor.mako:16
+#: waskaweb/templates/casemanagement/bundle_editor.mako:15
 msgid "cm_bundle_editor_explain"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:8
+#: waskaweb/templates/casemanagement/bundle_standin.mako:7
 #: waskaweb/templates/casemanagement/dialogs/notificate_bundle_setstandin.mako:6
 msgid "cm_np_bundled_standin"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:16
+#: waskaweb/templates/casemanagement/bundle_standin.mako:15
 #: waskaweb/templates/casemanagement/organisation.mako:41
 msgid "cm_header_standin"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:17
+#: waskaweb/templates/casemanagement/bundle_standin.mako:16
 msgid "cm_bundle_standin_explain"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:29
+#: waskaweb/templates/casemanagement/bundle_standin.mako:28
 msgid "attention"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:29
+#: waskaweb/templates/casemanagement/bundle_standin.mako:28
 msgid "cm_bundle_standin_explain_attention"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/bundle_standin.mako:51
+#: waskaweb/templates/casemanagement/bundle_standin.mako:50
 #: waskaweb/templates/casemanagement/organisation.mako:72
 msgid "cm_form_standin_submit"
 msgstr ""
@@ -1648,12 +1646,17 @@
 msgid "cm_header_digest_parent"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/downloadCSV.mako:8
+#: waskaweb/templates/casemanagement/downloadCSV.mako:7
+#: waskaweb/templates/casemanagement/downloadXLS.mako:7
+#: waskaweb/templates/casemanagement/downloadXML.mako:7
 #: waskaweb/templates/casemanagement/export.mako:5
 msgid "cm_np_export"
 msgstr ""
 
 #: waskaweb/templates/casemanagement/evaluation.mako:5
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:7
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:7
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:7
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:7
@@ -1760,31 +1763,35 @@
 msgid "cm_menu_link_print"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:58
+#: waskaweb/templates/casemanagement/main.mako:57
+msgid "cm_menu_link_printempty"
+msgstr ""
+
+#: waskaweb/templates/casemanagement/main.mako:59
 msgid "cm_menu_link_create_reminder"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:65
+#: waskaweb/templates/casemanagement/main.mako:66
 msgid "cm_menu_header_seperator"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:68
+#: waskaweb/templates/casemanagement/main.mako:69
 msgid "cm_menu_link_digest"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:70
+#: waskaweb/templates/casemanagement/main.mako:71
 msgid "cm_menu_link_organisation"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:71
+#: waskaweb/templates/casemanagement/main.mako:72
 msgid "cm_menu_link_appointment"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:72
+#: waskaweb/templates/casemanagement/main.mako:73
 msgid "cm_menu_link_documents"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/main.mako:78
+#: waskaweb/templates/casemanagement/main.mako:79
 msgid "cm_menu_header_structure"
 msgstr ""
 
@@ -1955,10 +1962,6 @@
 msgid "agency_np_bundled_export_failed"
 msgstr ""
 
-#: waskaweb/templates/casemanagement/dialogs/notificate_bundle_setstandin.mako:7
-msgid "cm_np_bundled_standin_success"
-msgstr ""
-
 #: waskaweb/templates/casemanagement/dialogs/notificate_import_dub.mako:7
 msgid "cm_np_import_failed"
 msgstr ""
@@ -1990,12 +1993,18 @@
 msgid "cm_np_restore_success"
 msgstr ""
 
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:8
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:8
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:8
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:8
 msgid "cm_np_evaluate_result"
 msgstr ""
 
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako:10
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_month.mako:10
+#: waskaweb/templates/casemanagement/evaluation/evaluation_result_0_year.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako:10
 #: waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:10

Modified: trunk/waskaweb/lib/csv.py
===================================================================
--- trunk/waskaweb/lib/csv.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/lib/csv.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -4,16 +4,23 @@
 # Authors:
 # Sascha L. Teichmann <teichmann at intevation.de>
 #
-#import psycopg2.extras as extras
 
 from types import StringTypes
 
+from sql_helper import range_compress, where_ids
+
+import sys
+
 SEP = "\t"
 
 SELECT_MASTER_TBL = \
 """SELECT * FROM master_tbl_view
    WHERE id = %(id)s"""
 
+SELECT_MASTER_TBL_WHERE = \
+"""SELECT * FROM master_tbl_view
+   WHERE %s"""
+
 FETCH_ALL_IDS = \
 """SELECT id FROM master_tbl_view"""
 
@@ -27,6 +34,9 @@
 SELECT_RG = \
 """SELECT * FROM %s WHERE master_id = %d"""
 
+SELECT_RG_WHERE = \
+"""SELECT * FROM %s WHERE %s"""
+
 BLACK_LIST = set(['id', 'master_id', 'uuid_id', 'bearbeiter_id'])
 
 def strReplace(x):
@@ -38,61 +48,82 @@
 
 class RepeatGroup:
 
-    def __init__(self, columns):
-        self.columns = columns
+    def __init__(self):
+        self.headers = None
+        self.values  = None
 
     def headerFields(self):
-        return [a[0] for a in self.columns if a[0] not in BLACK_LIST]
+        return self.headers
 
     def valueFields(self):
-        return [strReplace(a[2]) for a in self.columns if a[0] not in BLACK_LIST]
+        return self.values
 
     def numFields(self):
-        s = 0
-        for a in self.columns:
-            if a[0] not in BLACK_LIST:
-                s += 1
-        return s
+        return len(self.values)
 
+    def setColumns(self, headers, values):
+        self.headers = headers
+        self.values  = values
+
 class Case(RepeatGroup):
-    def __init__(self, columns):
-        RepeatGroup.__init__(self, columns)
-        self.rgs = []
 
-    def fetchRepeatGroups(self, cur):
-        master_id = self.columns[0][2]
-        #print >> sys.stderr, "master: %d" % master_id
-        for view in RG_VIEWS:
-            cur.execute(SELECT_RG % (view, int(master_id)))
-            rs = []
-            while True:
-                row = cur.fetchone()
-                if not row: break
-                cs = row._index.items() # XXX: hackish!
-                cs.sort(lambda a, b: cmp(a[1], b[1]))
-                cs = [(a[0], a[1], row[a[1]]) for a in cs]
-                rs.append(RepeatGroup(cs))
-            #print >> sys.stderr, "\t%d %s" % (len(rs), view)
-            self.rgs.append(rs)
+    def __init__(self, orig_pos):
+        RepeatGroup.__init__(self)
+        self.orig_pos = orig_pos
+        self.rgs = [[] for i in range(len(RG_VIEWS))]
+        
+    def appendRepeatGroup(self, rg, index):
+        self.rgs[index].append(rg)
 
 class Cases:
     def __init__(self):
-        self.cases = []
+        self.cases = None
 
     def fetchCases(self, cur, ids):
-        param = {}
-        for mid in ids:
-            param['id'] = mid
-            cur.execute(SELECT_MASTER_TBL, param)
+        case_hash = dict([(x[1], Case(x[0])) for x in enumerate(ids)])
+        ids.sort()
+        ids = range_compress(ids)
+        where = where_ids(ids)
+        cur.execute(SELECT_MASTER_TBL_WHERE % where)
+
+        headers, used_indices = None, None
+
+        while True:
             row = cur.fetchone()
-            if not row: continue
-            columns = row._index.items() # XXX: hackish!
-            columns.sort(lambda a, b: cmp(a[1], b[1]))
-            columns = [(a[0], a[1], row[a[1]]) for a in columns]
-            case = Case(columns)
-            case.fetchRepeatGroups(cur)
-            self.cases.append(case)
+            if not row: break
 
+            if used_indices is None:
+                used_indices = [t[0] for t in enumerate(cur.description) if t[1] not in BLACK_LIST]
+                headers      = [cur.description[i][0] for i in used_indices]
+
+            values = [row[i] for i in used_indices]
+
+            case_hash[row[0]].setColumns(headers, values)
+
+        where = where_ids(ids, "master_id")
+
+        for index, view in enumerate(RG_VIEWS):
+
+            headers, used_indices = None, None
+
+            cur.execute(SELECT_RG_WHERE % (view, where))
+
+            while True:
+                row = cur.fetchone()
+                if not row: break
+                if used_indices is None:
+                    used_indices = [t[0] for t in enumerate(cur.description) if t[1] not in BLACK_LIST]
+                    headers      = [cur.description[i][0] for i in used_indices]
+
+                values = [row[i] for i in used_indices]
+
+                rg = RepeatGroup()
+                rg.setColumns(headers, values)
+                case_hash[row[1]].appendRepeatGroup(rg, index)
+
+        self.cases = list(case_hash.itervalues())
+        self.cases.sort(lambda a, b: cmp(a.orig_pos, b.orig_pos))
+
     def maxRepeatGroups(self):
         mc = [0] * len(RG_VIEWS)
         for rgs in [c.rgs for c in self.cases]:
@@ -142,10 +173,12 @@
                 while count < m:
                     line.extend(fill)
                     count += 1
-            print >> out, "%s" % SEP.join(map(lambda x: u"%s" % x, line))
+            print >> out, "%s" % SEP.join(map(lambda x: u"%s" % strReplace(x), line))
 
 
 def exportAsCSV(cur, out, ids=None):
+    #from datetime import datetime
+    #start = datetime.now()
     cases = Cases()
     if ids is None:
         cur.execute(FETCH_ALL_IDS)
@@ -159,5 +192,7 @@
     cases.maxRepeatGroups()
     cases.generateHeader(out)
     cases.dumpFields(out)
+    #stop = datetime.now()
+    #print >> sys.stderr, "export took: %s" % (stop-start)
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: trunk/waskaweb/lib/renderer.py
===================================================================
--- trunk/waskaweb/lib/renderer.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/lib/renderer.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -196,9 +196,10 @@
         return ""
 
 class AidListRenderer:
-    def __init__(self, aidList=None, ro_mode=True):
+    def __init__(self, aidList=None, ro_mode=True, no_data=False):
         self.aidList = aidList
         self.ro_mode = ro_mode
+        self.no_data = no_data
 
     def render(self, ds_id, page_id):
         from waskaweb.lib.base import _ 
@@ -235,23 +236,24 @@
                 <th class="table_header_h table_action">%s</th>
             </tr>""" % (s_inst, s_type, s_act))
         idset = True
-        for aid in self.aidList.getDatasets():
-            class_str = ""
-            if idset:
-                out.append(u"""<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td>""" %
-                    (F.NA(aid.start_date), F.NA(aid.end_date), F.NA(aid.institution), F.NA(aid.type)))
-            else:
-                out.append(u"""<tr class="table_row_v"><td>%s</td><td>%s</td><td>%s</td><td>%s</td>""" %
-                    (F.NA(aid.start_date), F.NA(aid.end_date), F.NA(aid.institution), F.NA(aid.type)))
-            idset = not idset
-            out.append(u"""<td class="table_action"><a href="/rg_aid/%s/%s/%s">%s</a>""" %
-                    (action,aid.id, aid.page_id, s_show))
-            if not self.ro_mode and h.hasRole(['cm_ka']):
-                out.append(u"""<a href="/rg_aid/delete/%s/%s/0">%s</a>""" % (aid.id, aid.type_id, s_delete))
-            out.append("""</td></tr>""")
+        if not self.no_data:
+            for aid in self.aidList.getDatasets():
+                class_str = ""
+                if idset:
+                    out.append(u"""<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td>""" %
+                        (F.NA(aid.start_date), F.NA(aid.end_date), F.NA(aid.institution), F.NA(aid.type)))
+                else:
+                    out.append(u"""<tr class="table_row_v"><td>%s</td><td>%s</td><td>%s</td><td>%s</td>""" %
+                        (F.NA(aid.start_date), F.NA(aid.end_date), F.NA(aid.institution), F.NA(aid.type)))
+                idset = not idset
+                out.append(u"""<td class="table_action"><a href="/rg_aid/%s/%s/%s">%s</a>""" %
+                        (action,aid.id, aid.page_id, s_show))
+                if not self.ro_mode and h.hasRole(['cm_ka']):
+                    out.append(u"""<a href="/rg_aid/delete/%s/%s/0">%s</a>""" % (aid.id, aid.type_id, s_delete))
+                out.append("""</td></tr>""")
 
-            if self.aidList.numDatasets() <= 0:
-                out.append(u"""<tr><td colspan="5">%s</td></tr>""" % (s_notfound))
+                if self.aidList.numDatasets() <= 0:
+                    out.append(u"""<tr><td colspan="5">%s</td></tr>""" % (s_notfound))
         out.append(u"""</table>""")
         out.append(u"""<div class="legend">
         %s <strong>%s</strong>: %s <strong>%s</strong>: %s <strong>%s</strong>: %s <strong>%s</strong>: %s 

Added: trunk/waskaweb/lib/sql_helper.py
===================================================================
--- trunk/waskaweb/lib/sql_helper.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/lib/sql_helper.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2008 by Intevation GmbH
+# Authors:
+# Sascha L. Teichmann <teichmann at intevation.de>
+#
+
+from types import TupleType
+
+def range_compress(ids):
+    out = []
+    begin, last = None, None
+    for x in ids:
+        if begin is None:
+            begin, last = x, x
+        else:
+            if x != last + 1:
+                if last == begin: out.append(last)
+                else:             out.append((begin, last))
+                begin = x
+            last = x
+
+    if not begin is None:
+        if begin == last: out.append(last)
+        else:             out.append((begin, last))
+
+    return out
+
+def where_ids(compressed, idname="id"):
+    between = "%s BETWEEN %%d AND %%d" % idname
+    single  = "%s = %%d" % idname
+    return " OR ".join([(type(x) is TupleType and between or single) % x 
+        for x in compressed])
+
+def main():
+    import sys
+    ids = [int(x) for x in sys.argv[1:]]
+    compressed = range_compress(ids)
+    print compressed
+    print where_ids(compressed)
+
+if __name__ == '__main__':
+    main()
+    
+
+# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: trunk/waskaweb/lib/validators.py
===================================================================
--- trunk/waskaweb/lib/validators.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/lib/validators.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -156,11 +156,13 @@
 
 class BundleActionForm(BaseFormValidator):
     filter_extra_fields = True 
+    all_cases  = formencode.validators.Int(if_missing=0)
     action  = formencode.validators.String(not_empty=True)
     case_id = formencode.ForEach(formencode.validators.Int())
 
 class AgencyBundleActionForm(BaseFormValidator):
     filter_extra_fields = True 
+    all_cases  = formencode.validators.Int(if_missing=0)
     action  = formencode.validators.String(not_empty=True)
     agency_id = formencode.ForEach(formencode.validators.String())
 

Modified: trunk/waskaweb/lib/xmlimport.py
===================================================================
--- trunk/waskaweb/lib/xmlimport.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/lib/xmlimport.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -489,6 +489,9 @@
     def update(self, cur):
         if self.uuid is None:
             raise StandardError("UUID is not defined")
+
+        if not self.fields: return
+
         sets = []
         values = {}
         for k, v in self.fields:

Modified: trunk/waskaweb/model/appointment.py
===================================================================
--- trunk/waskaweb/model/appointment.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/model/appointment.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -44,23 +44,25 @@
                                 art = %(type)s \
                                 WHERE id = %(id)s"
 
-GET_OLDACTIVE_CASES = "SELECT m.id, s.zugriff, \
-getLastCaseAppointment(m.id) as last_date \
-from master_tbl_view m \
-JOIN ka_status_tbl_view s \
-ON s.master_id = m.id \
-WHERE extract(day from now()-getLastCaseAppointment(m.id)) > %(maxdays)s \
-AND m.zeitraum_nachbetreuung = -1 \
-AND m.art_beendigung <> 1"
+GET_OLDACTIVE_CASES = """SELECT m.id, s.zugriff, 
+getLastCaseAppointment(m.id) as last_date 
+from master_tbl_view m 
+JOIN ka_status_tbl_view s 
+ON s.master_id = m.id 
+WHERE s.status <> 5 
+AND extract(day from now()-getLastCaseAppointment(m.id)) > %(maxdays)s 
+AND m.zeitraum_nachbetreuung = -1 
+AND m.art_beendigung <> 1"""
 
-GET_OLDFINISHED_CASES = "SELECT m.id, s.zugriff, \
-getLastCaseAppointment(m.id) as last_date \
-from master_tbl_view m \
-JOIN ka_status_tbl_view s \
-ON s.master_id = m.id \
-WHERE extract(day from now()-s.zugriff) > %(maxdays)s \
-AND (m.zeitraum_nachbetreuung <> -1 \
-OR m.art_beendigung = 1)"
+GET_OLDFINISHED_CASES = """SELECT m.id, s.zugriff, 
+getLastCaseAppointment(m.id) as last_date 
+from master_tbl_view m 
+JOIN ka_status_tbl_view s 
+ON s.master_id = m.id 
+WHERE s.status <> 5 
+AND extract(day from now()-s.zugriff) > %(maxdays)s 
+AND (m.zeitraum_nachbetreuung <> -1 
+OR m.art_beendigung = 1)"""
 
 #class AppointmentBundle:
 #    def __init__(self, ids):
@@ -238,6 +240,7 @@
             appointment = self.__makeAppointment(case, last, maxage, finished=False)
             self.appointment_list.append(appointment)
 
+
         # 3. filter cases which are finished and not edited and create reminders
         oldAndFinishedSet = set(oldAndFinished)
         old_cases = [case for case in cases.getDatasets() if case.id in oldAndFinishedSet]

Modified: trunk/waskaweb/model/case.py
===================================================================
--- trunk/waskaweb/model/case.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/model/case.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -29,7 +29,7 @@
 from waskaweb.model.statement import PrivacyStatement, AidPlanStatement, DiscretionStatement
 from waskaweb.model.document import listDocuments 
 
-from waskaweb.lib.helpers import dd_mm_yyyy_HH_MM
+from waskaweb.lib.helpers import dd_mm_yyyy_HH_MM, dd_mm_YYYY
 
 from os import tmpnam, unlink
 
@@ -50,6 +50,10 @@
       m.kundennummer,
       m.bearbeiter_id,
       st.status,
+      st.zugriff,
+      st.id as s_id,
+      m.zeitraum_nachbetreuung,
+      m.art_beendigung,
       m.einverstaendniserklaerung
     FROM master_tbl_view m
     JOIN ka_status_tbl_view st ON
@@ -128,10 +132,14 @@
     def numDatasets(self):
         return len(self.case_list) 
 
-    def getCases(self):
+    def getCases(self, filter=None):
         list = []
         factory = CaseFactory()
-        for id in self.case_list:
+        if filter:
+            cases = [id for id in self.case_list if id not in filter]
+        else:
+            cases = self.case_list
+        for id in cases:
             list.append(factory.loadById(id))
         return list
 
@@ -196,7 +204,7 @@
         out = Writer(f, errors='replace')
         try:
             con = db.getConnection()
-            cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
+            cur = con.cursor()
             exportAsCSV(cur, out, self.listDatasetIds())
             out.flush()
             bytes = out.getvalue()
@@ -318,7 +326,12 @@
                     row['name_1'], \
                     row['kundennummer'], \
                     row['bearbeiter_id'], \
-                    row['einverstaendniserklaerung'])
+                    row['einverstaendniserklaerung'], \
+                    row['s_id'], \
+                    row['status'], \
+                    row['zugriff'], \
+                    row['zeitraum_nachbetreuung'], \
+                    row['art_beendigung'])
                 self.ds_list.append(case)
         finally:
             db.recycleConnection(con, cur)
@@ -357,7 +370,7 @@
         case.state      = State(id)
         return case
 
-    def loadByName(self, id, first_name, last_name, knr, bearbeiter_id, einverst):
+    def loadByName(self, id, first_name, last_name, knr, bearbeiter_id, einverst, s_id, s_state, s_access, s_cm_finished, s_cm_canceled):
         '''This method does not actually loads a case from the database. It
         just returns a case object initiated with the provided parameters'''
         case = Case()
@@ -366,7 +379,8 @@
         case.last_name  = unicode(str(last_name),  'utf-8')
         case.knr        = unicode(str(knr),        'utf-8')
         case.editor     = bearbeiter_id
-        case.state      = State(id)
+        case.state      = State()
+        case.state.setData(s_id, id, s_state, s_access, s_cm_finished, s_cm_canceled)
         case.privacy_statement_signed = einverst in (1, -1) and True or False
         return case
 
@@ -965,7 +979,7 @@
 
         return False
 
-class State:
+class State(object):
     '''This class store the state and the last accesstime of the case.
     Possible states are:
         * Open (1)
@@ -974,13 +988,38 @@
         * outstanding anonymision (4)
         * anonymised (5)'''
 
-    def __init__(self, master_id):
+    def getLastDateFromDB(self):
+        if self._last_date:
+            return self._last_date
+        else:
+            # Reload all the data. As fetching the last appointment
+            # for the case is the most expensive part of the operation getting
+            # some more values does not hurt.
+            self._load()
+            return self._last_date
+
+    last_date = property(getLastDateFromDB)
+
+    def __init__(self, master_id=None):
         self.master_id = master_id
         self.id  = None
         self.state = None
         self.access = None
-        self._load()
+        self._last_date = None
 
+        if master_id: 
+            self.master_id = master_id
+            self._load()
+
+
+    def setData(self, id, master_id, state, access, cm_finished, cm_canceled):
+        self.master_id = master_id
+        self.id = id
+        self.state = state
+        self.access = access
+        self.cm_finished = cm_finished
+        self.cm_canceled = cm_canceled
+
     def _load(self):
         conn, cur = None, None
         try:
@@ -992,7 +1031,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:
@@ -1037,13 +1076,19 @@
 
     def getAccessTime(self, format=None):
         if format:
-            return dd_mm_yyyy_HH_MM(self.access)
+            try:
+                return self.access.strftime(format)
+            except:
+                return dd_mm_YYYY(self.access)
         return self.access
 
     def getLastDate(self, format=None):
         '''Returns the last occouring date from appointments, aids, or the last accesstime'''
         if format:
-            return dd_mm_yyyy_HH_MM(self.last_date)
+            try:
+                return self.last_date.strftime(format)
+            except:
+                return dd_mm_YYYY(self.last_date)
         return self.last_date
 
     def setAccessTime(self):

Modified: trunk/waskaweb/model/casedocument.py
===================================================================
--- trunk/waskaweb/model/casedocument.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/model/casedocument.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -8,19 +8,23 @@
 
 from waskaweb.model.nodecomponents import Document
 from waskaweb.model.data           import PageNode
-from waskaweb.model.datapage       import PageStore
+from waskaweb.model.datapage       import PageStore, EmptyPageStore
 
 class CaseDocument(Document):
     def __init__(self, root=None):
         Document.__init__(self, root)
 
-    def getPageStore(self, name, ds_id=None, proxy=None):
+    def getPageStore(self, name, ds_id=None, proxy=None, no_data=False):
         db_view = "%s_view" % name
         nc = self.findByClassAndName(PageNode, name)
         if proxy:
             proxy.set(nc)
             nc = proxy
-        page = PageStore(db_view, nc, ds_id)
+        print no_data
+        if no_data:
+            page = EmptyPageStore(db_view, nc, ds_id)
+        else:
+            page = PageStore(db_view, nc, ds_id)
         return page
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: trunk/waskaweb/model/datapage.py
===================================================================
--- trunk/waskaweb/model/datapage.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/model/datapage.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -248,4 +248,11 @@
 
         return old_errors
 
+class EmptyPageStore(PageStore):
+    def __init__(self, relation, nc, id = None):
+        PageStore.__init__(self, relation, nc, id)
+
+    def _fetchData(self):
+        pass
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Deleted: trunk/waskaweb/model/help.py
===================================================================
--- trunk/waskaweb/model/help.py	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/model/help.py	2008-08-13 13:14:42 UTC (rev 52)
@@ -1,38 +0,0 @@
-# -*- coding: latin1 -*-
-#
-# Copyright (c) 2007 by Intevation GmbH
-# Authors:
-# Sascha L. Teichmann <teichmann at intevation.de>
-#
-
-from xml.dom.minidom import parseString
-
-from xml.dom.ext     import Print
-
-from cStringIO       import StringIO
-
-class HelpProvider:
-
-    def __init__(self, xhtml):
-        helps = {}
-        dom = None
-        try:
-            dom = parseString(xhtml)
-            for div in dom.getElementsByTagName("div"):
-                id = div.getAttribute("id")
-                if not id: continue
-                out = StringIO()
-                Print(div, out, 'UTF-8')
-                helps[id] = out.getvalue()
-                out.close()
-        finally:
-            if dom: dom.unlink()
-        self.helps = helps
-
-    def hasHelp(self, id):
-        return self.helps.has_key(id)
-
-    def getHelp(self, id, default=None):
-        return self.helps.get(id, default)
-
-# vim:set ts=4 sw=4 si et sta sts=4:

Modified: trunk/waskaweb/templates/casemanagement/agency_overview.mako
===================================================================
--- trunk/waskaweb/templates/casemanagement/agency_overview.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/casemanagement/agency_overview.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -38,12 +38,16 @@
 <div class="waska_form">
   ${h.form(h.url(action='bundleAction'), method='post')}
   <%include file="./agencylist.mako" />
+  <div class="waska_form_element">
+    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">Alle angezeigten Agenturen auswählen</label>
+  </div>
   <div class="waska_form_element w30">
     <select name="action">
       <option value="no_action">Keine Aktion</option>
       <option value="delete">Auswahl löschen</option>
-      <option value="export">Auswahl exportieren</option>
-      ##<option value="evaluate">Auswahl auswerten</option>
+      <option value="exportXLS">Auswahl als Excel-Tabellen exportieren</option>
+      <option value="exportXML">Auswahl als XML-Datei exportieren</option>
+      <option value="exportCSV">Auswahl als CSV-Datei exportieren</option>
     </select>
   </div>
   <div class="waska_form_element w50">

Modified: trunk/waskaweb/templates/casemanagement/caselist.mako
===================================================================
--- trunk/waskaweb/templates/casemanagement/caselist.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/casemanagement/caselist.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -27,7 +27,7 @@
             ${case.getEditor().last_name | F.NA, h}, ${case.getEditor().first_name[0] | F.NA, h}.
           </td>
         % else:
-          <td>${case.state.getAccessTime('%d.%m.%y %H:%M') | F.NA, h}</td>
+          <td>${case.state.getAccessTime('%d.%m.%Y') | F.NA, h}</td>
         % endif
         <td>
           % if h.hasRole(['cm_ka']):
@@ -74,7 +74,7 @@
             ${case.getEditor().last_name | F.NA, h}, ${case.getEditor().first_name[0] | F.NA, h}.
           </td>
         % else:
-          <td class="table_row_h">${case.state.getAccessTime('%d.%m.%y %H:%M') | F.NA, h}</td>
+          <td class="table_row_h">${case.state.getAccessTime('%d.%m.%Y') | F.NA, h}</td>
         % endif
         <td class="table_row_h">
           % if h.hasRole(['cm_ka']):
@@ -113,7 +113,7 @@
     % endif
     <% idset = not idset %>
   % endfor
-  % if len(c.cases.getDatasets()) == 0:
+  % if len(c.cases.getDatasets()) <= 0:
   <tr>
     <td colspan="6">
       ${_('cm_overview_tbl_no_data_found')}

Modified: trunk/waskaweb/templates/casemanagement/main.mako
===================================================================
--- trunk/waskaweb/templates/casemanagement/main.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/casemanagement/main.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -53,7 +53,8 @@
       ${self.buildInfofield()}
       <ul>
         <li><a href="${h.url_for(controller='/case_overview')}" onclick="return checkModification();"> ${_('cm_menu_link_backtooverview')}</a></li>
-        <li><a href="/case/printAll/${session.get('case').id}" onclick="return checkModification();"> ${_('cm_menu_link_print')}</a></li>
+        <li><a href="/case/printAll/${session.get('case').id}/0" onclick="return checkModification();"> ${_('cm_menu_link_print')}</a></li>
+        <li><a href="/case/printAll/${session.get('case').id}/1" onclick="return checkModification();"> ${_('cm_menu_link_printempty')}</a></li>
         % if h.hasRole(['cm_ka']):
           <li><a href="/case/newReminder/${session.get('case').id}" onclick="return checkModification();"> ${_('cm_menu_link_create_reminder')}</a></li>
         % endif

Modified: trunk/waskaweb/templates/casemanagement/overview.mako
===================================================================
--- trunk/waskaweb/templates/casemanagement/overview.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/casemanagement/overview.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -46,6 +46,9 @@
 <div class="waska_form">
   ${h.form(h.url(action='bundleAction'), method='post')}
   <%include file="./caselist.mako" />
+  <div class="waska_form_element">
+    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">Alle angezeigten Fallakten auswählen</label>
+  </div>
   <div class="waska_form_element w30">
     <select name="action">
       <option value="no_action">Keine Aktion</option>

Modified: trunk/waskaweb/templates/main.mako
===================================================================
--- trunk/waskaweb/templates/main.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/main.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -121,7 +121,7 @@
     <div class="actions">
       <h1>${_('menu_header_cm')}</h1>
       <ul>
-        <li><a href="${h.url_for(controller='/agency_overview')}"> ${_('menu_cm_link_overview')}</a> </li>
+        <li><a href="${h.url_for(controller='/agency_overview', action='overview', reset=1)}"> ${_('menu_cm_link_overview')}</a> </li>
         <li><a href="${h.url_for(controller='/evaluate', action='evaluate', id=1)}"> ${_('cm_actions_link_evaluate')}</a></li>
       </ul>
     </div>

Modified: trunk/waskaweb/templates/start/start.mako
===================================================================
--- trunk/waskaweb/templates/start/start.mako	2008-08-13 13:14:16 UTC (rev 51)
+++ trunk/waskaweb/templates/start/start.mako	2008-08-13 13:14:42 UTC (rev 52)
@@ -19,10 +19,19 @@
      <li>die &#220;bermittlung anonymisierter Fallakten aktivieren</li>
   </ul>
  </div>
-%endif
-% if (h.getLogin() != 'adm'):
-<h2>Automatisierte Wiedervorlagen</h2>
-<%include file="/start/remindlist.mako"/>
-<h2>Eigene Termine</h2>
-<%include file="/start/appointmentlist.mako"/>
+%else:
+  % if c.isEvaluationServer: 
+  <div id="adm_beta">
+    <p>Sie befinden sich auf dem zentralen Auswerteserver. Diese enthält den Datenbestand aller Fallakten der einzelnen Kompetenzagenturen in anonymisierter Form.<br>Bitte beachten Sie folgende Hinweise:</p>
+    <ul>
+      <li>Eine Aktualisierung des Datenbestandes findet wöchentlich am Wochende statt. Die Spalte "Aktualisiert" in der Fallakenübersicht gibt das Alter des Datenbestands einer jeweiligen KA an.</li>
+      <li>Damit Fallakten einer KA auf diesen Server übertragen werden, muss die Option "Fallakten übertragen" in den Agentureinstellungen der jeweiligen KA aktiviert sein. Diese Einstellung kann nur durch den Administrator vorgenommen werden</li>
+    </ul>
+  </div>
+  % else:
+  <h2>Automatisierte Wiedervorlagen</h2>
+  <%include file="/start/remindlist.mako"/>
+  <h2>Eigene Termine</h2>
+  <%include file="/start/appointmentlist.mako"/>
+  % endif
 % endif



More information about the Mpuls-commits mailing list