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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 15 10:35:49 CEST 2010


Author: torsten
Date: 2010-04-15 10:35:46 +0200 (Thu, 15 Apr 2010)
New Revision: 2365

Modified:
   wasko/branches/2.0/mpulsweb/controllers/mpuls.py
Log:
* mpulsweb/controllers/mpuls.py: Moved functions to get news,
appointments and reminder into the MpulsController.


Modified: wasko/branches/2.0/mpulsweb/controllers/mpuls.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/mpuls.py	2010-04-15 08:33:58 UTC (rev 2364)
+++ wasko/branches/2.0/mpulsweb/controllers/mpuls.py	2010-04-15 08:35:46 UTC (rev 2365)
@@ -12,27 +12,6 @@
 log = logging.getLogger(__name__)
 
 
-def get_newslist(user):
-    return NewsList(user)
-
-def get_global_appointments():
-    return GlobalAppointmentOverview()
-
-def get_case_appointments():
-    return CaseAppointmentOverview()
-
-def get_reminders():
-    """Return an AppointmentOverview instance with reminders.
-    The overview always contains the max save time reminders. For case
-    managers it also contains the case reminders.
-    """
-    remindlist = MaxSaveTimeReminderOverview()
-    if h.hasRole(['cm']):
-        remindlist.join(CaseReminderOverview())
-        remindlist.sort()
-    return remindlist
-
-
 class MpulsController(BaseController):
 
     def index(self):
@@ -41,20 +20,42 @@
         # LOAD NEWS
         if g.mpuls_config.is_enabled('module', 'news'):
             log.debug('Loading news list')
-            c.news = get_newslist(user)
+            c.news = self.get_newslist(user)
 
         # LOAD APPOINTMENTS
         if g.mpuls_config.is_enabled('case-module', 'appointments'):
             # Case appointments
             log.debug('Loading case appointment list')
-            c.appointmentlist = get_case_appointments()
+            c.appointmentlist = self.get_case_appointments()
         if g.mpuls_config.is_enabled('case-module', 'reminders'):
             # Case appointments
             log.debug('Loading reminders list')
-            c.remindlist = get_reminders()
+            c.remindlist = self.get_reminders()
         if g.mpuls_config.is_enabled('module', 'appointments'):
             # Global appointments
             log.debug('Loading global appointment list')
-            c.globalappointmentlist = get_global_appointments()
+            c.globalappointmentlist = self.get_global_appointments()
 
         return render('/home/home.mako')
+
+    def get_newslist(self, user):
+        return NewsList(user)
+
+    def get_global_appointments(self):
+        return GlobalAppointmentOverview()
+
+    def get_case_appointments(self):
+        return CaseAppointmentOverview()
+
+    def get_reminders(self):
+        """Return an AppointmentOverview instance with reminders.
+        The overview always contains the max save time reminders. For case
+        managers it also contains the case reminders.
+        """
+        remindlist = MaxSaveTimeReminderOverview()
+        if h.hasRole(['cm']):
+            remindlist.join(CaseReminderOverview())
+            remindlist.sort()
+        return remindlist
+
+



More information about the Mpuls-commits mailing list