[Mpuls-commits] r1051 - wasko/branches/2.0/waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Feb 1 12:50:19 CET 2010
Author: torsten
Date: 2010-02-01 12:50:19 +0100 (Mon, 01 Feb 2010)
New Revision: 1051
Modified:
wasko/branches/2.0/waskaweb/controllers/logbook.py
Log:
* waskaweb/controllers/logbook.py (LogbookController.new): New.
Modified: wasko/branches/2.0/waskaweb/controllers/logbook.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/logbook.py 2010-02-01 11:41:59 UTC (rev 1050)
+++ wasko/branches/2.0/waskaweb/controllers/logbook.py 2010-02-01 11:50:19 UTC (rev 1051)
@@ -24,10 +24,12 @@
# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
# European Social Fund resources.
import logging
+import formencode
+from datetime import datetime
from waskaweb.lib.base import *
from waskaweb.lib.security import checkRole
-from waskaweb.model.logbook import Logbook
+from waskaweb.model.logbook import Logbook, LogbookEntry
log = logging.getLogger(__name__)
@@ -49,6 +51,28 @@
c.eval_effort = logbook.getEvaluation()
return render('/logbook/overview.mako')
+ @checkRole('cm_ka')
+ def new(self, id):
+ id = self._checkInt(id)
+
+ entry = LogbookEntry()
+ entry.setDate(datetime.now())
+ entry.setKind(-1)
+
+ form_defaults = {}
+ c.form_errors = {}
+
+ form_defaults['date'] = entry.getDate()
+ form_defaults['time'] = entry.getTime()
+ form_defaults['kind'] = entry.getKindAsInt()
+ form_defaults['case_id'] = id
+
+ form = render('/logbook/new.mako')
+ return formencode.htmlfill.render(unicode(form, 'utf-8'),
+ defaults=form_defaults,
+ auto_insert_errors=False,
+ errors=c.form_errors)
+
@checkRole(('cm_ka'))
def printout(self, id):
id = self._checkInt(id)
More information about the Mpuls-commits
mailing list