[Mpuls-commits] r3008 - in jmd/trunk: . jmdstrukturweb/model jmdstrukturweb/templates jmdstrukturweb/templates/appointments jmdstrukturweb/templates/home

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 15 12:43:33 CEST 2010


Author: roland
Date: 2010-06-15 12:43:31 +0200 (Tue, 15 Jun 2010)
New Revision: 3008

Added:
   jmd/trunk/jmdstrukturweb/templates/appointments/
   jmd/trunk/jmdstrukturweb/templates/appointments/remindlist_body.mako
   jmd/trunk/jmdstrukturweb/templates/home/
   jmd/trunk/jmdstrukturweb/templates/home/remindlist.mako
Modified:
   jmd/trunk/ChangeLog
   jmd/trunk/jmdstrukturweb/model/appointment.py
Log:
show reminder to create new jmd statistics

Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-06-15 10:06:32 UTC (rev 3007)
+++ jmd/trunk/ChangeLog	2010-06-15 10:43:31 UTC (rev 3008)
@@ -1,5 +1,12 @@
 2010-06-15  Roland Geider <roland.geider at intevation.de>
 
+        * jmdstrukturweb/model/appointment.py,
+          jmdstrukturweb/templates/appointments/remindlist_body.mako,
+          jmdstrukturweb/templates/home/remindlist.mako: show reminder to create
+          new jmd statistics
+
+2010-06-15  Roland Geider <roland.geider at intevation.de>
+
         * jmdweb/public/formed/formedtree.xml: Wald issue #780: rename options
 
 2010-06-11  Roland Geider <roland.geider at intevation.de>

Modified: jmd/trunk/jmdstrukturweb/model/appointment.py
===================================================================
--- jmd/trunk/jmdstrukturweb/model/appointment.py	2010-06-15 10:06:32 UTC (rev 3007)
+++ jmd/trunk/jmdstrukturweb/model/appointment.py	2010-06-15 10:43:31 UTC (rev 3008)
@@ -43,6 +43,7 @@
             cur.execute(sql, {'maxdays': days})
             log.debug(cur.query)
             result = cur.fetchone()
+            
             case = {'id': result[0], 'start': result[1], 'end': result[2]}
             return case 
         finally:
@@ -72,14 +73,18 @@
         return False
 
     def makeAppointment(self, case):
-        factory = CaseAppointmentFactory()
-        type = 1
-        title = u"Neue JMD-Statistik erstellen"
-        desc = u"Für den aktuellen Zeitraum konnte keine JMD-Statistik \
-                 gefunden werden. Die letzte JMD-Statistik ist für den \
-                 Zeitraum %s - %s." % (case.get('start'), case.get('end'))
-        mydate = datetime.now()
-        appointment = factory.createByData(None, title, mydate, None, desc,
-                                           case.get('id'), type)
+        factory     = CaseAppointmentFactory()
+        type        = 1
+        title       = u"Neue JMD-Statistik erstellen"
+        description = u"Für den aktuellen Zeitraum konnte keine JMD-Statistik \
+                    gefunden werden. Die letzte JMD-Statistik ist für den \
+                    Zeitraum"
+        appointment = factory.createByData(None,
+                                            title,
+                                            case.get('start'),
+                                            case.get('end'),
+                                            description,
+                                            case.get('id'),
+                                            type)
         return appointment
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Copied: jmd/trunk/jmdstrukturweb/templates/appointments/remindlist_body.mako (from rev 2993, base/trunk/mpulsweb/templates/appointments/remindlist_body.mako)
===================================================================
--- base/trunk/mpulsweb/templates/appointments/remindlist_body.mako	2010-06-10 16:28:47 UTC (rev 2993)
+++ jmd/trunk/jmdstrukturweb/templates/appointments/remindlist_body.mako	2010-06-15 10:43:31 UTC (rev 3008)
@@ -0,0 +1,42 @@
+## -*- coding: utf-8 -*-
+<%!  import mpulsweb.lib.helper.filters as F %>
+<%!  from datetime import datetime %>
+<table class="appointment">
+  <tr>
+    <th class="date table_header_h">${_('app_overview_tbl_header_date')}</th>
+    <th class="title table_header_h">${_('app_overview_tbl_header_desc')}</th>
+    <th class="action table_header_h">${_('app_overview_tbl_header_actions')}</th>
+  </tr>
+  % for appointment in c.remindlist.getDatasets():
+  <tr>
+    <td class="date">${h.dd_mm_YYYY(datetime.now())}</td>
+    <td class="title">${appointment.title | F.NA}</td>
+    <td class="action">
+     ${self.showAppointmentActions(appointment)}
+     % if h.hasRole(['cm_ka']):
+      ${self.showKeepActiveActions(appointment)}
+    % endif
+    </td>
+  </tr>
+  <tr>
+    <% description = F.H(appointment.description) %>
+    <td colspan="3" class="description">
+        ${description}
+        ${h.dd_mm_YYYY(appointment.getStartDate()) | F.NA} bis
+        ${h.dd_mm_YYYY(appointment.getEndDate()) | F.NA}
+    </td>
+  </tr>
+  % endfor
+  % if len(c.remindlist.getDatasets()) <= 0:
+  <tr>
+    <td colspan="3">Keine JMD-Statistiken gefunden</td>
+  </tr>
+  % endif
+</table>
+
+<%def name="showAppointmentActions(appointment)">
+## Default function
+</%def>
+<%def name="showKeepActiveActions(appointment)">
+## Default function
+</%def>


Property changes on: jmd/trunk/jmdstrukturweb/templates/appointments/remindlist_body.mako
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: jmd/trunk/jmdstrukturweb/templates/home/remindlist.mako (from rev 2993, base/trunk/mpulsweb/templates/casemanagement/reminderlist.mako)
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/reminderlist.mako	2010-06-10 16:28:47 UTC (rev 2993)
+++ jmd/trunk/jmdstrukturweb/templates/home/remindlist.mako	2010-06-15 10:43:31 UTC (rev 3008)
@@ -0,0 +1,18 @@
+<%inherit file="/appointments/remindlist_body.mako" />
+<%def name="showAppointmentActions(appointment)">
+  <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')}"
+         alt    = "${_('cm_overview_a_show')}" 
+         title  = "${_('cm_overview_a_show')}"
+         width  = "22"
+         height = "22"></a>
+</%def>
+<%def name="showKeepActiveActions(appointment)">
+  <a href="${h.url_for(controller='/case', action='new')}">
+    <img src    = "${h.url_for('/images/icons/new_22.png')}"
+         width  = "22"
+         height = "22"
+         alt    = "${_('menu_cm_link_new')}"
+         title  = "${_('menu_cm_link_new')}"></a>
+</%def>
\ No newline at end of file



More information about the Mpuls-commits mailing list