[Mpuls-commits] r1136 - wasko/branches/2.0/waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 2 15:00:25 CET 2010


Author: torsten
Date: 2010-02-02 15:00:24 +0100 (Tue, 02 Feb 2010)
New Revision: 1136

Modified:
   wasko/branches/2.0/waskaweb/controllers/caseappointment.py
Log:
* waskaweb/controllers/caseappointment.py
(CaseappointmentController.new): New. Moved from case controller



Modified: wasko/branches/2.0/waskaweb/controllers/caseappointment.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/caseappointment.py	2010-02-02 13:47:18 UTC (rev 1135)
+++ wasko/branches/2.0/waskaweb/controllers/caseappointment.py	2010-02-02 14:00:24 UTC (rev 1136)
@@ -1,10 +1,14 @@
 import logging
+from datetime import datetime
 
+import formencode 
+
 from pylons import request, response, session, tmpl_context as c
 from pylons.controllers.util import abort, redirect_to
 
 from waskaweb.lib.security import checkRole
 from waskaweb.lib.base import BaseController, render
+from waskaweb.lib.helpers import dd_mm_YYYY, HH_MM 
 from waskaweb.model.appointment import CaseAppointmentOverview, \
      CaseAppointmentFactory, CaseReminderOverview
 from waskaweb.controllers.case import checkPrivacyStatement
@@ -34,6 +38,21 @@
         c.appointmentlist = CaseAppointmentOverview(id)
         return render('/casemanagement/appointments.mako')
 
+    @checkRole('cm_ka')
+    def new(self, id):
+        id = self._checkInt(id)
+        c.form_errors = {}
+        c.form_result = {}
+        cd = datetime.now()
+        form_defaults = {'start_date': dd_mm_YYYY(cd),
+                           'start_time': HH_MM(cd),
+                           'case_id': id,
+                           'type': 0}
+        form = render('/casemanagement/newAppointment.mako')
+        return formencode.htmlfill.render(unicode(form, 'utf-8'),
+                                          defaults=form_defaults)
+
+
     @checkRole(('admin_ka', 'cm_ka'))
     @checkPrivacyStatement('showAppointment')
     def show(self, id, confirmed):



More information about the Mpuls-commits mailing list