[Mpuls-commits] r2072 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 23 12:54:28 CET 2010


Author: torsten
Date: 2010-03-23 12:54:27 +0100 (Tue, 23 Mar 2010)
New Revision: 2072

Modified:
   wasko/branches/2.0/mpulsweb/controllers/case.py
Log:
* mpulsweb/controllers/case.py (keepActive): New. Copied from jmdweb.


Modified: wasko/branches/2.0/mpulsweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/case.py	2010-03-23 11:34:39 UTC (rev 2071)
+++ wasko/branches/2.0/mpulsweb/controllers/case.py	2010-03-23 11:54:27 UTC (rev 2072)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+from datetime import datetime
 import logging
 import formencode
 
@@ -9,10 +10,12 @@
 from mpulsweb.lib.base import BaseController, render, h
 from mpulsweb.lib.navigation import get_navigation
 from mpulsweb.lib.security import checkRole
+from mpulsweb.lib.dialogs import checkPrivacyStatement 
 from mpulsweb.lib.validators import SetStandinForm, SetEditorForm
 from mpulsweb.lib.anonymize import determineAnonymizedCaseEndPhase
 from mpulsweb.model.case import ConsistenceCheckException 
 from mpulsweb.model.user import UserGroupList, UserListObject
+from mpulsweb.model.logbook import LogbookEntry 
 
 from mpulsweb.controllers.formularpage import get_rendered_page
 
@@ -330,4 +333,29 @@
             c.status_msg = h.status_message("Fehler! Vertretung nicht gesetzt.")
             return render('/casemanagement/organisation.mako')
 
+    @checkRole('cm')
+    @checkPrivacyStatement('keepActive')
+    def keepActive(self, id, confirmed):
+        entry = LogbookEntry()
+        entry.setDate(datetime.now())
+        entry.setKind(-2)
+        form_defaults = {}
+        form_defaults['date'] = entry.getDate()
+        form_defaults['time'] = entry.getTime()
+        form_defaults['kind'] = entry.getKindAsInt()
+        form_defaults['kind'] = entry.getKindAsInt()
+        form_defaults['short_notice'] = u"Aufbewahrung verlängert"
+        form_defaults['notice'] = (u"Bitte geben Sie hier den Grund für"
+                                   u" die Verlängerung der Aufbewahrungsfrist"
+                                   u" ein.")
+        id = self._checkInt(id)
+        case = self.init_case(id)
+        c.entry = entry
+        c.form_errors = {}
+        form = render('/logbook/new.mako')
+        return formencode.htmlfill.render(form,
+                                          defaults=form_defaults,
+                                          auto_insert_errors=False,
+                                          errors=c.form_errors)
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list