[Mpuls-commits] r5296 - jmd/trunk/jmdstrukturweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 2 14:34:36 CEST 2011


Author: roland
Date: 2011-09-02 14:34:35 +0200 (Fri, 02 Sep 2011)
New Revision: 5296

Modified:
   jmd/trunk/jmdstrukturweb/controllers/case.py
Log:
issue2317: remove copied functions from base. They were probably duplicated to
change the dialogs and other texts, but with the internationalisied base, this
is no longer needed


Modified: jmd/trunk/jmdstrukturweb/controllers/case.py
===================================================================
--- jmd/trunk/jmdstrukturweb/controllers/case.py	2011-09-02 09:54:58 UTC (rev 5295)
+++ jmd/trunk/jmdstrukturweb/controllers/case.py	2011-09-02 12:34:35 UTC (rev 5296)
@@ -54,70 +54,6 @@
 
 
 class CaseController(MpulsCaseController):
-
-    @checkRole('admin')
-    def restore(self, id, confirmed):
-        id = self._checkInt(id)
-        confirmed = self._checkBool(confirmed)
-        case = self._loadCase(id)
-        if confirmed == 1:
-            case.restore()
-            c.dialog_title = u'JMD-Statistik wiederhergestellt!'
-            c.dialog_text = u'Bitte klicken Sie "OK", um fortzufahren.'
-            c.url_ok = h.url_for(controller="/case_overview")
-            return render('/casemanagement/dialogs/success_restore.mako')
-        else:
-            c.context = "../main.mako"
-            c.dialog_title = RESTORE_CONFIRM
-            c.dialog_text = RESTORE_CONFIRM_TEXT
-            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')
-
-    @checkRole('cm')
-    def markForDelete(self, id, confirmed):
-        id = self._checkInt(id)
-        confirmed = self._checkBool(confirmed)
-        if confirmed == 1:
-            case = self._loadCase(id)
-            case.setState(3)
-            c.dialog_title = u'JMD-Statistik gelöscht!'
-            c.dialog_text = (u"Die JMD-Statistik wurde zum Löschen an die"
-                             u" Administration weitergeleitet.")
-            c.url_ok = h.url_for(controller="/case_overview")
-            session['render_mode'] = 'ro'
-            session.save()
-            return render('/casemanagement/dialogs/success_delete_cm.mako')
-        else:
-            c.context = "../main.mako"
-            c.dialog_title = DELETE_CONFIRM
-            c.dialog_text = MARKDELETE_CONFIRM_TEXT
-            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')
-    def delete(self, id, confirmed):
-        id = self._checkInt(id)
-        confirmed = self._checkBool(confirmed)
-        if confirmed == 1:
-            case = self._loadCase(id)
-            case.delete()
-            c.dialog_title = u'JMD-Statistik gelöscht!'
-            c.dialog_text = u'Bitte klicken Sie "OK", um fortzufahren.'
-            c.url_ok = h.url_for(controller="/case_overview")
-            return render('/casemanagement/dialogs/success_delete.mako')
-        else:
-            c.context = "../main.mako"
-            c.dialog_title = DELETE_CONFIRM
-            c.dialog_text = DELETE_CONFIRM_TEXT
-            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')
-
     def _get_validator(self):
         '''Set specific validator'''
         return NewCaseForm()



More information about the Mpuls-commits mailing list