[Mpuls-commits] r5838 - in base/trunk/mpulsweb: controllers i18n i18n/de/LC_MESSAGES lib templates/evaluation

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Mar 1 13:01:42 CET 2012


Author: ludwig
Date: 2012-03-01 13:01:42 +0100 (Thu, 01 Mar 2012)
New Revision: 5838

Modified:
   base/trunk/mpulsweb/controllers/evaluation_overview.py
   base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
   base/trunk/mpulsweb/i18n/mpulsweb.pot
   base/trunk/mpulsweb/lib/helpers.py
   base/trunk/mpulsweb/templates/evaluation/overview.mako
Log:
Issue 2916: In evaluation server the datadump date is displayed in the
overview.
Bugfix of helpers.dd_mm_YYYY: str part was broken.


Modified: base/trunk/mpulsweb/controllers/evaluation_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-01 11:44:55 UTC (rev 5837)
+++ base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-01 12:01:42 UTC (rev 5838)
@@ -7,6 +7,7 @@
 
 from mpulsweb.lib.validators import BundleActionForm
 from mpulsweb.lib.base import c, render, request, session, BaseController
+from mpulsweb.lib.db import db
 from mpulsweb.lib.security import checkRole
 from mpulsweb.lib.helpers import url_for
 from mpulsweb.lib.translation import _, ungettext
@@ -125,6 +126,7 @@
         session.save()
 
         c.cases = cases
+        c.datadump = self._get_datadump()
         overview = render('/evaluation/overview.mako')
         return formencode.htmlfill.render(overview, defaults=form_defaults,
                                           errors=form_errors)
@@ -239,4 +241,18 @@
             raise
         return "Not implemented"
 
+    def _get_datadump(self):
+        v_dataset = None
+        try:
+            try:
+                conn = db.getConnection()
+                cur = conn.cursor()
+                cur.execute("SELECT value FROM dbinfo WHERE key = 'datadump'")
+                v_dataset = str(cur.fetchone()[0])
+            except:
+                log.exception('Error: get datadump failed')
+        finally:
+            db.recycleConnection(conn, None)
+        return v_dataset
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
===================================================================
--- base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-03-01 11:44:55 UTC (rev 5837)
+++ base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-03-01 12:01:42 UTC (rev 5838)
@@ -8,7 +8,7 @@
 "Project-Id-Version: mpulsweb 0.0.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
 "POT-Creation-Date: 2011-09-15 17:48+0200\n"
-"PO-Revision-Date: 2012-02-27 13:58+0100\n"
+"PO-Revision-Date: 2012-03-01 12:11+0100\n"
 "Last-Translator: Roland Geider <roland.geider at intevation.de>\n"
 "Language-Team: de <LL at li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -689,12 +689,12 @@
 "können."
 
 #: mpulsweb/controllers/case_bundle.py:259
-#: mpulsweb/controllers/evaluation_overview.py:188
+#: mpulsweb/controllers/evaluation_overview.py:190
 msgid "No action specified for the selection"
 msgstr "Keine Aktion für die Auswahl angegeben!"
 
 #: mpulsweb/controllers/case_bundle.py:260
-#: mpulsweb/controllers/evaluation_overview.py:189
+#: mpulsweb/controllers/evaluation_overview.py:191
 msgid ""
 "You have not selected any action for the\n"
 "selection. Please click OK to go to the case overview and select there\n"
@@ -1035,11 +1035,11 @@
 msgid "Error: Evaluation failed"
 msgstr "Fehler: Auswertung fehlgeschlagen"
 
-#: mpulsweb/controllers/evaluation_overview.py:181
+#: mpulsweb/controllers/evaluation_overview.py:183
 msgid "No valid agencys in the selection!"
 msgstr "Keine gültigen Agenturen in der Auswahl!"
 
-#: mpulsweb/controllers/evaluation_overview.py:182
+#: mpulsweb/controllers/evaluation_overview.py:184
 msgid ""
 "The selected action can not be executed\n"
 "on any of the agencys in your selection. Please make sure that the "
@@ -1051,13 +1051,13 @@
 "Agenturen in einem Zustand befinden, aus dem Sie die Aktion ausführen "
 "können."
 
-#: mpulsweb/controllers/evaluation_overview.py:221
+#: mpulsweb/controllers/evaluation_overview.py:223
 msgid "Agency was marked for evaluation"
 msgid_plural "Agency were marked for evaluation"
 msgstr[0] "Agentur wurde für die Auswertung markiert."
 msgstr[1] "Agenturen wurden für die Auswertung markiert."
 
-#: mpulsweb/controllers/evaluation_overview.py:225
+#: mpulsweb/controllers/evaluation_overview.py:227
 #, python-format
 msgid ""
 "%d agency was marked for evaluation. All following evaluations will be "
@@ -3353,14 +3353,14 @@
 msgstr "Fallaktenübersicht"
 
 #: mpulsweb/templates/casemanagement/overview.mako:11
-#: mpulsweb/templates/evaluation/overview.mako:10
+#: mpulsweb/templates/evaluation/overview.mako:11
 msgid "List all case documents of the organisation or the user"
 msgstr ""
 "Hier wird eine Auflistung aller Fallakten der Einrichtung bzw. der Fälle "
 "des angemeldeten Benutzers angezeigt"
 
 #: mpulsweb/templates/casemanagement/overview.mako:15
-#: mpulsweb/templates/evaluation/overview.mako:14
+#: mpulsweb/templates/evaluation/overview.mako:15
 msgid "List all cases of this user"
 msgstr "Hier wird eine Auflistung der Fälle des angemeldeten Benutzers angezeigt"
 
@@ -3787,21 +3787,25 @@
 msgid "Agency overview"
 msgstr "Agenturübersicht"
 
-#: mpulsweb/templates/evaluation/overview.mako:17
+#: mpulsweb/templates/evaluation/overview.mako:8
+msgid "Datadump of"
+msgstr "Datenabzug vom "
+
+#: mpulsweb/templates/evaluation/overview.mako:18
 #, python-format
 msgid "%s case in %s agency was found."
 msgid_plural "%s cases in %s agencys where found."
 msgstr[0] "Es wurde %s Fallakte in %s Einrichtung gefunden."
 msgstr[1] "Es wurden %s Fallakten in %s Einrichtungen gefunden."
 
-#: mpulsweb/templates/evaluation/overview.mako:24
+#: mpulsweb/templates/evaluation/overview.mako:25
 #, python-format
 msgid "Select the %s found agency."
 msgid_plural "Select all %s found agencys"
 msgstr[0] "Die angezeigte Einrichtung (%s) auswählen"
 msgstr[1] "Alle angezeigten Einrichtungen (%s) auswählen"
 
-#: mpulsweb/templates/evaluation/overview.mako:66
+#: mpulsweb/templates/evaluation/overview.mako:67
 msgid "Do action for selected items"
 msgstr "Aktion für Auswahl ausführen"
 

Modified: base/trunk/mpulsweb/i18n/mpulsweb.pot
===================================================================
--- base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-03-01 11:44:55 UTC (rev 5837)
+++ base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-03-01 12:01:42 UTC (rev 5838)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: mpulsweb 2.1.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
-"POT-Creation-Date: 2012-02-27 13:57+0100\n"
+"POT-Creation-Date: 2012-03-01 12:10+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -568,12 +568,12 @@
 msgstr ""
 
 #: mpulsweb/controllers/case_bundle.py:259
-#: mpulsweb/controllers/evaluation_overview.py:188
+#: mpulsweb/controllers/evaluation_overview.py:190
 msgid "No action specified for the selection"
 msgstr ""
 
 #: mpulsweb/controllers/case_bundle.py:260
-#: mpulsweb/controllers/evaluation_overview.py:189
+#: mpulsweb/controllers/evaluation_overview.py:191
 msgid ""
 "You have not selected any action for the\n"
 "selection. Please click OK to go to the case overview and select there\n"
@@ -864,11 +864,11 @@
 msgid "Error: Evaluation failed"
 msgstr ""
 
-#: mpulsweb/controllers/evaluation_overview.py:181
+#: mpulsweb/controllers/evaluation_overview.py:183
 msgid "No valid agencys in the selection!"
 msgstr ""
 
-#: mpulsweb/controllers/evaluation_overview.py:182
+#: mpulsweb/controllers/evaluation_overview.py:184
 msgid ""
 "The selected action can not be executed\n"
 "on any of the agencys in your selection. Please make sure that the agencys "
@@ -876,13 +876,13 @@
 "in a state from which you can execute the selected action."
 msgstr ""
 
-#: mpulsweb/controllers/evaluation_overview.py:221
+#: mpulsweb/controllers/evaluation_overview.py:223
 msgid "Agency was marked for evaluation"
 msgid_plural "Agency were marked for evaluation"
 msgstr[0] ""
 msgstr[1] ""
 
-#: mpulsweb/controllers/evaluation_overview.py:225
+#: mpulsweb/controllers/evaluation_overview.py:227
 #, python-format
 msgid ""
 "%d agency was marked for evaluation. All following evaluations will be "
@@ -2976,12 +2976,12 @@
 msgstr ""
 
 #: mpulsweb/templates/casemanagement/overview.mako:11
-#: mpulsweb/templates/evaluation/overview.mako:10
+#: mpulsweb/templates/evaluation/overview.mako:11
 msgid "List all case documents of the organisation or the user"
 msgstr ""
 
 #: mpulsweb/templates/casemanagement/overview.mako:15
-#: mpulsweb/templates/evaluation/overview.mako:14
+#: mpulsweb/templates/evaluation/overview.mako:15
 msgid "List all cases of this user"
 msgstr ""
 
@@ -3388,21 +3388,25 @@
 msgid "Agency overview"
 msgstr ""
 
-#: mpulsweb/templates/evaluation/overview.mako:17
+#: mpulsweb/templates/evaluation/overview.mako:8
+msgid "Datadump of"
+msgstr ""
+
+#: mpulsweb/templates/evaluation/overview.mako:18
 #, python-format
 msgid "%s case in %s agency was found."
 msgid_plural "%s cases in %s agencys where found."
 msgstr[0] ""
 msgstr[1] ""
 
-#: mpulsweb/templates/evaluation/overview.mako:24
+#: mpulsweb/templates/evaluation/overview.mako:25
 #, python-format
 msgid "Select the %s found agency."
 msgid_plural "Select all %s found agencys"
 msgstr[0] ""
 msgstr[1] ""
 
-#: mpulsweb/templates/evaluation/overview.mako:66
+#: mpulsweb/templates/evaluation/overview.mako:67
 msgid "Do action for selected items"
 msgstr ""
 

Modified: base/trunk/mpulsweb/lib/helpers.py
===================================================================
--- base/trunk/mpulsweb/lib/helpers.py	2012-03-01 11:44:55 UTC (rev 5837)
+++ base/trunk/mpulsweb/lib/helpers.py	2012-03-01 12:01:42 UTC (rev 5838)
@@ -387,7 +387,7 @@
     if type(d) == str:
         try:
             y, m, d = d.split('-')
-            d = datetime(y, m, d)
+            d = datetime.date(int(y), int(m), int(d))
         except:
             return empty
     return "%02d.%02d.%d" % (d.day, d.month, d.year)

Modified: base/trunk/mpulsweb/templates/evaluation/overview.mako
===================================================================
--- base/trunk/mpulsweb/templates/evaluation/overview.mako	2012-03-01 11:44:55 UTC (rev 5837)
+++ base/trunk/mpulsweb/templates/evaluation/overview.mako	2012-03-01 12:01:42 UTC (rev 5838)
@@ -5,7 +5,8 @@
   ${parent.buildNavipath()}
   <li><a href="${h.url_for(controller='/case_overview')}">${_('Agency overview')}</a></li>
 </%def>
-<h1>${_('Agency overview')}</h1>
+<h1>${_('Agency overview')} (${_('Datadump of')}
+${h.NA(h.dd_mm_YYYY(c.datadump))})</h1>
 % if h.hasRole(['admin']):
  <!-- <p>${_('List all case documents of the organisation or the user')}</p>-->
 % endif



More information about the Mpuls-commits mailing list