[Mpuls-commits] r1775 - wasko/branches/2.0/jmdweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 25 14:18:26 CET 2010


Author: torsten
Date: 2010-02-25 14:18:25 +0100 (Thu, 25 Feb 2010)
New Revision: 1775

Modified:
   wasko/branches/2.0/jmdweb/controllers/case.py
Log:
* jmdweb/controllers/case.py (CaseController.markForAnonymize):
Commented out code. Is now implemented in mpulsbase. 


Modified: wasko/branches/2.0/jmdweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/jmdweb/controllers/case.py	2010-02-25 13:16:40 UTC (rev 1774)
+++ wasko/branches/2.0/jmdweb/controllers/case.py	2010-02-25 13:18:25 UTC (rev 1775)
@@ -441,43 +441,43 @@
         except:
             return render('/tests/trace.mako')
 
-    @checkRole('cm_ka')
-    def markForAnonymize(self, id, confirmed):
-        try:
-            id = self._checkInt(id)
-            confirmed = self._checkBool(confirmed)
-            case = self._loadCase(id)
-            # Check if the case is in a consistent state (all required fields
-            # are filled)
-            if ((not case.getState().phasesAreConsistent()
-                 or not case.getState().phasesAreCompleted())
-                and case.isYoungerThan(INCONSISTENCY_CHECK_AFTER)):
-                c.notification_for = MARKANONYMIZE_INCOMPLETE_PHASE_FAILED
-                if case.getState().getPhase() in (CLEAR_START, CLEAR_ENDE):
-                    c.notification_text = \
-                                MARKANONYMIZE_CLEARING_PHASE_FAILED_TEXT
-                else:
-                    c.notification_text = \
-                                MARKANONYMIZE_INCOMPLETE_PHASE_FAILED_TEXT
-                c.url_ok = "/case/digest/%s" % id
-                return render('/casemanagement/dialogs/failed_markanonymize_phase_incomplete.mako')
-            if confirmed == 1:
-                state = case.getState().setState(4)
-                if state:
-                    _completeAnonymizedCase(case)
-                    c.success_for = MARKANONYMIZE_SUCCESS
-                    c.success_text = MARKANONYMIZE_SUCCESS_TEXT
-                    c.url_ok = h.url_for(controller="/case_overview")
-                    return render('/casemanagement/dialogs/success_markanonymize.mako')
-            else:
-                c.confirm_for = ANONYMIZE_CONFIRM
-                c.question = MARKANONYMIZE_CONFIRM_TEXT % \
-                      PHASE_DESCRIPTIONS[_determineAnonymizedCaseEndPhase(case)]
-                c.url_yes = "/case/markForAnonymize/%s/1" % id
-                c.url_no = "/case/digest/%s" % id
-                return render('/casemanagement/dialogs/confirm_markanonymize.mako')
-        except:
-            return render('/tests/trace.mako')
+    #@checkRole('cm_ka')
+    #def markForAnonymize(self, id, confirmed):
+    #    try:
+    #        id = self._checkInt(id)
+    #        confirmed = self._checkBool(confirmed)
+    #        case = self._loadCase(id)
+    #        # Check if the case is in a consistent state (all required fields
+    #        # are filled)
+    #        if ((not case.getState().phasesAreConsistent()
+    #             or not case.getState().phasesAreCompleted())
+    #            and case.isYoungerThan(INCONSISTENCY_CHECK_AFTER)):
+    #            c.notification_for = MARKANONYMIZE_INCOMPLETE_PHASE_FAILED
+    #            if case.getState().getPhase() in (CLEAR_START, CLEAR_ENDE):
+    #                c.notification_text = \
+    #                            MARKANONYMIZE_CLEARING_PHASE_FAILED_TEXT
+    #            else:
+    #                c.notification_text = \
+    #                            MARKANONYMIZE_INCOMPLETE_PHASE_FAILED_TEXT
+    #            c.url_ok = "/case/digest/%s" % id
+    #            return render('/casemanagement/dialogs/failed_markanonymize_phase_incomplete.mako')
+    #        if confirmed == 1:
+    #            state = case.getState().setState(4)
+    #            if state:
+    #                _completeAnonymizedCase(case)
+    #                c.success_for = MARKANONYMIZE_SUCCESS
+    #                c.success_text = MARKANONYMIZE_SUCCESS_TEXT
+    #                c.url_ok = h.url_for(controller="/case_overview")
+    #                return render('/casemanagement/dialogs/success_markanonymize.mako')
+    #        else:
+    #            c.confirm_for = ANONYMIZE_CONFIRM
+    #            c.question = MARKANONYMIZE_CONFIRM_TEXT % \
+    #                  PHASE_DESCRIPTIONS[_determineAnonymizedCaseEndPhase(case)]
+    #            c.url_yes = "/case/markForAnonymize/%s/1" % id
+    #            c.url_no = "/case/digest/%s" % id
+    #            return render('/casemanagement/dialogs/confirm_markanonymize.mako')
+    #    except:
+    #        return render('/tests/trace.mako')
 
     @checkRole('admin_ka')
     def anonymize(self, id, confirmed):



More information about the Mpuls-commits mailing list