[Mpuls-commits] r194 - in waska/trunk: . waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 25 12:02:31 CEST 2008


Author: teichmann
Date: 2008-09-25 12:02:31 +0200 (Thu, 25 Sep 2008)
New Revision: 194

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/agency_overview.py
Log:
Fixed issue575


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-09-25 09:19:24 UTC (rev 193)
+++ waska/trunk/ChangeLog.txt	2008-09-25 10:02:31 UTC (rev 194)
@@ -1,5 +1,12 @@
 2008-09-25	Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
+	Fixed issue575
+
+	* waskaweb/controllers/agency_overview.py: Rewired link paths. They are
+	  not equal to the ones in case overview! TODO: This should be harmonized.
+
+2008-09-25	Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
 	* waskaweb/controllers/waska.py, waskaweb/lib/base.py: make question
 	  if server is evaluation server more robust. Now it's not mandatory any
 	  more to set evaluation_server in *.ini. It defaults to '0'.

Modified: waska/trunk/waskaweb/controllers/agency_overview.py
===================================================================
--- waska/trunk/waskaweb/controllers/agency_overview.py	2008-09-25 09:19:24 UTC (rev 193)
+++ waska/trunk/waskaweb/controllers/agency_overview.py	2008-09-25 10:02:31 UTC (rev 194)
@@ -247,14 +247,39 @@
             return htmlfill.render(unicode(form, 'utf-8'), c.form_result, c.form_errors, auto_insert_errors=False)
         return render('/casemanagement/agency_overview.mako')
 
-    @checkRole(('pb_ka'))
+    @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")
+        c.success_for    = EXPORT_SUCCESS
+        c.success_text   = EXPORT_SUCCESS_EXPLAINATION
+        c.selection_link = h.url_for(action="selectCSVParts");
+        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 selectCSVParts(self):
+        selection_checker  = self.__getSelectionChecker()
+        c.selection_question = SELECT_PARTS_FOR_EXPORT
+        c.store_action       = h.url_for(action="storeSelectedCSVParts")
+        c.back_url           = h.url_for(controller='/agency_overview', action='downloadCSV', confirmed=1)
+        c.back_title         = "CSV Export"
+        page = render('casemanagement/selectParts.mako')
+        return formencode.htmlfill.render(unicode(page, 'utf-8'),defaults=selection_checker.selections)
+
+    @checkRole(('pb_ka',))
+    def storeSelectedCSVParts(self):
+        validator = CasePartSelectionForm()
+        selection_checker = self.__getSelectionChecker()
+        try:
+            params = validator.to_python(request.params)
+            for key, value in params.iteritems():
+                selection_checker.setChecked(key, value)
+            session['selected_export_parts'] = selection_checker
+            session.save()
+        except formencode.Invalid, error:
+            return selectCSVParts()
+        return self.downloadCSV()
+
     @checkRole(('pb_ka'))
     def downloadXML(self):
         c.success_for        = EXPORT_SUCCESS_XML



More information about the Mpuls-commits mailing list