[Mpuls-commits] r4015 - in base/trunk: . mpulsweb/controllers mpulsweb/templates/casemanagement/dialogs

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Oct 22 15:50:55 CEST 2010


Author: bh
Date: 2010-10-22 15:50:52 +0200 (Fri, 22 Oct 2010)
New Revision: 4015

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/case_bundle.py
   base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako
Log:
* mpulsweb/controllers/case_bundle.py
(CaseBundleController.export): Omit invisible pages from the list
of pages that can be exported.  The user doesn't know about
invisible pages and they are always exported by libformed anyway.

* mpulsweb/templates/casemanagement/dialogs/confirm_export.mako:
Remove special case for pages named "ee".  The reason that was
done in the first place was that that page contains special fields
that the user cannot set via the normal form pages and which
contain information that is nevertheless important like the
current phase of the case.  Simply always exporting invisible
pages is a more generic approach and is not dependent on specific
page names which are not always used consistently in all
applications.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-22 12:27:49 UTC (rev 4014)
+++ base/trunk/ChangeLog	2010-10-22 13:50:52 UTC (rev 4015)
@@ -1,5 +1,22 @@
 2010-10-22  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/case_bundle.py
+	(CaseBundleController.export): Omit invisible pages from the list
+	of pages that can be exported.  The user doesn't know about
+	invisible pages and they are always exported by libformed anyway.
+
+	* mpulsweb/templates/casemanagement/dialogs/confirm_export.mako:
+	Remove special case for pages named "ee".  The reason that was
+	done in the first place was that that page contains special fields
+	that the user cannot set via the normal form pages and which
+	contain information that is nevertheless important like the
+	current phase of the case.  Simply always exporting invisible
+	pages is a more generic approach and is not dependent on specific
+	page names which are not always used consistently in all
+	applications.
+
+2010-10-22  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/helpers.py (get_export_selector): Removed.  No
 	longer used.
 

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2010-10-22 12:27:49 UTC (rev 4014)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2010-10-22 13:50:52 UTC (rev 4015)
@@ -480,7 +480,11 @@
     def export(self, type="XML"):
         c.context = "../main.mako"
         case_bundle = session.get('casebundle')
-        c.pages = list(g.formedTree.findAllByClass(PageNode))
+        # only pages that are not invisible can be selected by the user.
+        # For one thing, the user doesn't know about invisible pages and
+        # they are always exported by libformed anyway.
+        c.pages = [page for page in g.formedTree.findAllByClass(PageNode)
+                   if not page.isInvisible()]
         data = {'exporttype': type,
                 'exportanonym': '1',
                 'exportselection': [i.getName() for i in c.pages]}

Modified: base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako	2010-10-22 12:27:49 UTC (rev 4014)
+++ base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako	2010-10-22 13:50:52 UTC (rev 4015)
@@ -24,11 +24,7 @@
 <p>Bitte wählen Sie die zu exportierenden Seiten der Fallakte:</p>
 <ul>
 % for page in c.pages:
-<%
-   name = page.getName()
-   if name == "ee":
-       continue
-%>
+<% name = page.getName() %>
 <li>
   <input type="checkbox" name="exportselection" value="${name}" id="${name}">
   <label for="${name}">${page.getDescription()}</label>
@@ -46,7 +42,6 @@
   <input type="checkbox" name="exportanonym" id="exportanonym" value="1"> <label for="exportanonym">Daten anonymisiert exportieren<label>
 </p>
 <input type="hidden" name="exporttype" value="">
-<input type="hidden" name="exportselection" value="ee">
 <input type="submit" value="${_('Download export')}">
 </form>
 </div>



More information about the Mpuls-commits mailing list