[Mpuls-commits] r2769 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 26 16:47:21 CEST 2010


Author: bh
Date: 2010-05-26 16:47:20 +0200 (Wed, 26 May 2010)
New Revision: 2769

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/case.py
Log:
* mpulsweb/controllers/case.py (CaseController.markForDelete)
(CaseController.delete, CaseController.markForAnonymize)
(CaseController._markForAnonymize, CaseController.anonymize)
(CaseController.anonymize, CaseController.restore): Use h.url_for
consistently for all-intra application URLs.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-05-26 14:37:45 UTC (rev 2768)
+++ base/trunk/ChangeLog	2010-05-26 14:47:20 UTC (rev 2769)
@@ -1,5 +1,13 @@
 2010-05-26  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/case.py (CaseController.markForDelete)
+	(CaseController.delete, CaseController.markForAnonymize)
+	(CaseController._markForAnonymize, CaseController.anonymize)
+	(CaseController.anonymize, CaseController.restore): Use h.url_for
+	consistently for all-intra application URLs.
+
+2010-05-26  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/casedocument.py
 	(CasedocumentController.delete): Use h.url_for consistently for
 	all-intra application URLs.

Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2010-05-26 14:37:45 UTC (rev 2768)
+++ base/trunk/mpulsweb/controllers/case.py	2010-05-26 14:47:20 UTC (rev 2769)
@@ -110,8 +110,9 @@
             c.context = "../main.mako"
             c.dialog_title = DELETE_CONFIRM
             c.dialog_text = MARKDELETE_CONFIRM_TEXT
-            c.url_yes = "/case/markForDelete/%s/1" % id
-            c.url_no = "/case_overview/"
+            c.url_yes = h.url_for(controller='/case', action='markForDelete',
+                                  id=id, confirmed=1)
+            c.url_no = h.url_for(controller='/case_overview')
             return render('/casemanagement/dialogs/confirm.mako')
 
     @checkRole('admin')
@@ -129,8 +130,9 @@
             c.context = "../main.mako"
             c.dialog_title = DELETE_CONFIRM
             c.dialog_text = DELETE_CONFIRM_TEXT
-            c.url_yes = "/case/delete/%s/1" % id
-            c.url_no = "/case_overview/"
+            c.url_yes = h.url_for(controller='/case', action='delete',
+                                  id=id, confirmed=1)
+            c.url_no = h.url_for(controller='/case_overview')
             return render('/casemanagement/dialogs/confirm_delete.mako')
 
     #
@@ -143,7 +145,7 @@
 
     @checkRole('cm')
     def markForAnonymize(self, id, confirmed):
-        url = "/case/digest/%s" % id
+        url = h.url_for(controller='/case', action='digest', id=id)
         return self._markForAnonymize(id, confirmed, url)
 
     def _markForAnonymize(self, id, confirmed, url):
@@ -179,7 +181,8 @@
             
             c.dialog_title = ANONYMIZE_CONFIRM
             c.dialog_text = MARKANONYMIZE_CONFIRM_TEXT % phase
-            c.url_yes = "/case/markForAnonymize/%s/1" % id
+            c.url_yes = h.url_for(controller='/case', action='markForAnonymize',
+                                  id=id, confirmed=1)
             c.url_no = url
             return render('/casemanagement/dialogs/confirm_markanonymize.mako')
 
@@ -195,7 +198,7 @@
         except ConsistenceCheckException, e:
             c.dialog_title = MARKANONYMIZE_FAILED
             c.dialog_text = h.literal(e.value)
-            c.url_ok = "/case/digest/%s" % id
+            c.url_ok = h.url_for(controller='/case', action='digest', id=id)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
         # Ok, show confirmation dialog if the user really wants to anonymize the
@@ -210,8 +213,9 @@
             c.context = "../main.mako"
             c.dialog_title = ANONYMIZE_CONFIRM
             c.dialog_text = ANONYMIZE_CONFIRM_TEXT
-            c.url_yes = "/case/anonymize/%s/1" % id
-            c.url_no = "/case/digest/%s" % id
+            c.url_yes = h.url_for(controller='/case', action='anonymize',
+                                  id=id, confirmed=1)
+            c.url_no = h.url_for(controller='/case', action='digest', id=id)
             return render('/casemanagement/dialogs/confirm_anonymize.mako')
 
     #
@@ -233,8 +237,9 @@
             c.context = "../main.mako"
             c.dialog_title = RESTORE_CONFIRM
             c.dialog_text = RESTORE_CONFIRM_TEXT
-            c.url_yes = "/case/restore/%s/1" % id
-            c.url_no = "/case_overview/"
+            c.url_yes = h.url_for(controller='/case', action='restore', id=id,
+                                  confirmed=1)
+            c.url_no = h.url_for(controller='/case_overview')
             return render('/casemanagement/dialogs/confirm_restore.mako')
 
     #



More information about the Mpuls-commits mailing list