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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 28 13:39:38 CEST 2010


Author: bh
Date: 2010-10-28 13:39:37 +0200 (Thu, 28 Oct 2010)
New Revision: 4067

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): Set c.allow_logbook_export to
indicate whether the logbook can exported.  The logbook can only
be exported if the logbook is activated in the application and if
the target format is XMl.

* mpulsweb/templates/casemanagement/dialogs/confirm_export.mako:
Only look at c.allow_logbook_export to determine whether to
display the logbook checkbox.  The logic to decide when logbook
export is possible is now in the controller.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-28 10:35:13 UTC (rev 4066)
+++ base/trunk/ChangeLog	2010-10-28 11:39:37 UTC (rev 4067)
@@ -1,3 +1,16 @@
+2010-10-28  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/controllers/case_bundle.py
+	(CaseBundleController.export): Set c.allow_logbook_export to
+	indicate whether the logbook can exported.  The logbook can only
+	be exported if the logbook is activated in the application and if
+	the target format is XMl.
+
+	* mpulsweb/templates/casemanagement/dialogs/confirm_export.mako:
+	Only look at c.allow_logbook_export to determine whether to
+	display the logbook checkbox.  The logic to decide when logbook
+	export is possible is now in the controller.
+
 2010-10-28  Torsten Irlaender <torsten at intevation.de>
 
 	* mpulsweb/model/case.py (MpulsCase.checkValidity): Used

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2010-10-28 10:35:13 UTC (rev 4066)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2010-10-28 11:39:37 UTC (rev 4067)
@@ -491,6 +491,11 @@
         c.dialog_title = ungettext(u'Export case?', u'Export cases?',
                                    len(case_bundle.getCases()))
         c.dialog_text = "\n".join(self._buildCaseList(case_bundle))
+        # logbook export is only possible for XML exports and if the
+        # logbook is actually activated in the application.
+        c.allow_logbook_export = (g.mpuls_config.is_enabled('case-module',
+                                                            'logbook')
+                                  and type == "XML")
         form = render('/casemanagement/dialogs/confirm_export.mako')
         return formencode.htmlfill.render(form, defaults=data,
                                           auto_insert_errors=False,

Modified: base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako	2010-10-28 10:35:13 UTC (rev 4066)
+++ base/trunk/mpulsweb/templates/casemanagement/dialogs/confirm_export.mako	2010-10-28 11:39:37 UTC (rev 4067)
@@ -31,7 +31,7 @@
 </li>
 % endfor
 </ul>
-% if g.mpuls_config.is_enabled('case-module', 'logbook'):
+% if c.allow_logbook_export:
 <ul>
   <li>
     <input type="checkbox" name="exportselection" value="logbook" id="logbook">



More information about the Mpuls-commits mailing list