[Mpuls-commits] r3894 - in base/trunk: . mpulsweb/controllers mpulsweb/templates/home

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 6 11:47:48 CEST 2010


Author: roland
Date: 2010-10-06 11:47:47 +0200 (Wed, 06 Oct 2010)
New Revision: 3894

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/mpuls.py
   base/trunk/mpulsweb/templates/home/caseappointmentlist.mako
Log:
issue1119, issue933: handling of (automatic) reminders

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-10-06 09:43:06 UTC (rev 3893)
+++ base/trunk/ChangeLog	2010-10-06 09:47:47 UTC (rev 3894)
@@ -1,3 +1,13 @@
+2010-10-05
+
+	* mpulsweb/controllers/mpuls.py: issue1119: own reminders
+	  would appear as automatic reminders
+
+	* mpulsweb/templates/home/caseappointmentlist.mako: issue933: adapt
+	  template to show a consistent behaviour for appointments/reminders:
+	  they both open its info page instead of reminders taking the user to
+	  the case overview, using the same icon and text.
+
 2010-10-05  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/i18n/mpulsweb.pot: Regenerated.

Modified: base/trunk/mpulsweb/controllers/mpuls.py
===================================================================
--- base/trunk/mpulsweb/controllers/mpuls.py	2010-10-06 09:43:06 UTC (rev 3893)
+++ base/trunk/mpulsweb/controllers/mpuls.py	2010-10-06 09:47:47 UTC (rev 3894)
@@ -28,7 +28,7 @@
             log.debug('Loading case appointment list')
             c.appointmentlist = self.get_case_appointments()
         if g.mpuls_config.is_enabled('case-module', 'reminders'):
-            # Case appointments
+            # Case reminders
             log.debug('Loading reminders list')
             c.remindlist = self.get_reminders()
         if g.mpuls_config.is_enabled('module', 'appointments'):
@@ -39,23 +39,31 @@
         return render('/home/home.mako')
 
     def get_newslist(self, user):
+        """ Return an agency wide newslist """
+        
         return NewsList(user)
 
     def get_global_appointments(self):
+        """ Return agency wide appointments """
+        
         return GlobalAppointmentOverview()
 
     def get_case_appointments(self):
-        return CaseAppointmentOverview()
+        """ Return the user's appointments and reminders """
+        
+        appointment_list = CaseAppointmentOverview()
+        if h.hasRole(['cm']):
+            appointment_list.join(CaseReminderOverview())
+            appointment_list.sort()
+        return appointment_list
 
     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.
+        The overview always contains the max save time reminders.
         """
+        
         remindlist = MaxSaveTimeReminderOverview()
-        if h.hasRole(['cm']):
-            remindlist.join(CaseReminderOverview())
-            remindlist.sort()
+        remindlist.sort()
         return remindlist
 
 

Modified: base/trunk/mpulsweb/templates/home/caseappointmentlist.mako
===================================================================
--- base/trunk/mpulsweb/templates/home/caseappointmentlist.mako	2010-10-06 09:43:06 UTC (rev 3893)
+++ base/trunk/mpulsweb/templates/home/caseappointmentlist.mako	2010-10-06 09:47:47 UTC (rev 3894)
@@ -1,12 +1,14 @@
 <%inherit file="/appointments/overview_body.mako" />
 <%def name="showAppointmentActions(appointment)">
   %if appointment.case_id:
+    ## Ususal appointment
     % if appointment.type == 0:
       <a href="${h.url_for(controller='/caseappointment', action='show', id=appointment.id, confirmed=0)}">
         <img src="${h.url_for('/images/icons/open_active_22.png')}" border="0" alt="${_('cm_overview_a_show')}" title="${_('cm_overview_a_show')}"></a>
+    ## Reminder
     % else:
-      <a href="${h.url_for(controller='/case', action='select', id=appointment.case_id, confirmed=0)}">
-        <img src="${h.url_for('/images/icons/open_active_22.png')}" border="0" alt="${_('cm_overview_a_show')}" title="${_('cm_overview_a_show')}"></a>
+      <a href="${h.url_for(controller='/caseappointment', action='show', id=appointment.id, confirmed=0)}">
+        <img src="${h.url_for('/images/icons/open_active_22.png')}" alt="${_('cm_overview_a_show')}" title="${_('cm_overview_a_show')}"></a>
     % endif
   % else:
     <a href="${h.url_for(controller='/caseappointment', action='show', id=appointment.id)}">



More information about the Mpuls-commits mailing list