[Mpuls-commits] r5834 - in base/trunk/mpulsweb: i18n i18n/de/LC_MESSAGES model public/styles templates/documents

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 27 14:07:37 CET 2012


Author: ludwig
Date: 2012-02-27 14:07:37 +0100 (Mon, 27 Feb 2012)
New Revision: 5834

Modified:
   base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
   base/trunk/mpulsweb/i18n/mpulsweb.pot
   base/trunk/mpulsweb/model/document.py
   base/trunk/mpulsweb/public/styles/all.css
   base/trunk/mpulsweb/templates/documents/case_overview.mako
   base/trunk/mpulsweb/templates/documents/global_overview.mako
Log:
Issue 2682: Add datum to ka_dokumente_tbl, modify Document, the SQL statements
and the templates to set and display this field.


Modified: base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
===================================================================
--- base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-02-27 13:07:37 UTC (rev 5834)
@@ -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-16 15:59+0100\n"
+"PO-Revision-Date: 2012-02-27 13:58+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"
@@ -1888,19 +1888,19 @@
 "Die XML-Datei hat die Version '%s', unterstützt wird aber nur Version "
 "'%s'."
 
-#: mpulsweb/model/document.py:212
+#: mpulsweb/model/document.py:215
 msgid "Could not create new document"
 msgstr "Konnte neues Dokument nicht anlegen."
 
-#: mpulsweb/model/document.py:306
+#: mpulsweb/model/document.py:310
 msgid "No document available"
 msgstr "Kein Dokument vorhanden."
 
-#: mpulsweb/model/document.py:331
+#: mpulsweb/model/document.py:335
 msgid "An ID is needed"
 msgstr "ID wird benötigt"
 
-#: mpulsweb/model/document.py:350
+#: mpulsweb/model/document.py:354
 msgid "The requested document can't be found."
 msgstr "Das angeforderte Dokument kann nicht gefunden werden."
 
@@ -1961,7 +1961,7 @@
 msgid "Wrong formular input"
 msgstr "Fehlerhafte Formulareingabe"
 
-#: mpulsweb/templates/base.mako:75
+#: mpulsweb/templates/base.mako:79
 #, python-format
 msgid ""
 "You are using a public demo installation of %s. Do not enter any real "
@@ -2489,8 +2489,8 @@
 #: mpulsweb/templates/appointments/overview_body.mako:7
 #: mpulsweb/templates/appointments/remindlist_body.mako:7
 #: mpulsweb/templates/casemanagement/caselist.mako:96
-#: mpulsweb/templates/documents/case_overview.mako:42
-#: mpulsweb/templates/documents/global_overview.mako:33
+#: mpulsweb/templates/documents/case_overview.mako:45
+#: mpulsweb/templates/documents/global_overview.mako:37
 #: mpulsweb/templates/home/globalappointmentlist.mako:13
 #: mpulsweb/templates/logbook/overview.mako:101
 #: mpulsweb/templates/meta/search.mako:81
@@ -2508,10 +2508,10 @@
 #: mpulsweb/templates/casemanagement/caselist.mako:263
 #: mpulsweb/templates/casemanagement/reminderlist.mako:6
 #: mpulsweb/templates/casemanagement/reminderlist.mako:7
-#: mpulsweb/templates/documents/case_overview.mako:66
-#: mpulsweb/templates/documents/case_overview.mako:67
-#: mpulsweb/templates/documents/global_overview.mako:56
-#: mpulsweb/templates/documents/global_overview.mako:57
+#: mpulsweb/templates/documents/case_overview.mako:72
+#: mpulsweb/templates/documents/case_overview.mako:73
+#: mpulsweb/templates/documents/global_overview.mako:63
+#: mpulsweb/templates/documents/global_overview.mako:64
 #: mpulsweb/templates/home/caseappointmentlist.mako:7
 #: mpulsweb/templates/home/caseappointmentlist.mako:11
 #: mpulsweb/templates/home/caseappointmentlist.mako:15
@@ -2535,9 +2535,9 @@
 #: mpulsweb/templates/casemanagement/overview.mako:44
 #: mpulsweb/templates/casemanagement/reminderlist.mako:12
 #: mpulsweb/templates/casemanagement/reminderlist.mako:13
-#: mpulsweb/templates/documents/case_overview.mako:80
-#: mpulsweb/templates/documents/case_overview.mako:81
-#: mpulsweb/templates/documents/global_overview.mako:66
+#: mpulsweb/templates/documents/case_overview.mako:86
+#: mpulsweb/templates/documents/case_overview.mako:87
+#: mpulsweb/templates/documents/global_overview.mako:73
 msgid "Delete"
 msgstr "Löschen"
 
@@ -3420,8 +3420,8 @@
 
 #: mpulsweb/templates/casemanagement/rename_attachment.mako:5
 #: mpulsweb/templates/documents/case_overview.mako:19
-#: mpulsweb/templates/documents/global_overview.mako:6
-#: mpulsweb/templates/documents/global_overview.mako:10
+#: mpulsweb/templates/documents/global_overview.mako:7
+#: mpulsweb/templates/documents/global_overview.mako:11
 #: mpulsweb/templates/documents/global_rename.mako:5
 #: mpulsweb/templates/documents/global_upload.mako:5
 #: mpulsweb/templates/documents/dialogs/confirm.mako:4
@@ -3443,7 +3443,7 @@
 #: mpulsweb/templates/casemanagement/rename_attachment.mako:37
 #: mpulsweb/templates/documents/case_new.mako:63
 #: mpulsweb/templates/documents/case_overview.mako:36
-#: mpulsweb/templates/documents/global_overview.mako:27
+#: mpulsweb/templates/documents/global_overview.mako:28
 #: mpulsweb/templates/documents/global_rename.mako:38
 #: mpulsweb/templates/documents/global_upload.mako:51
 msgid "Filename"
@@ -3643,7 +3643,7 @@
 msgstr "Anlage hinzufügen"
 
 #: mpulsweb/templates/documents/case_new.mako:24
-#: mpulsweb/templates/documents/global_overview.mako:16
+#: mpulsweb/templates/documents/global_overview.mako:17
 #: mpulsweb/templates/documents/global_upload.mako:11
 msgid "Add new document"
 msgstr "Neue Anlage hinzufügen"
@@ -3691,17 +3691,22 @@
 "wenn Sie Daten gleichen Namens überschreiben wollen."
 
 #: mpulsweb/templates/documents/case_overview.mako:39
-#: mpulsweb/templates/documents/global_overview.mako:30
+#: mpulsweb/templates/documents/global_overview.mako:31
+msgid "Inserted at"
+msgstr "Eingefügt"
+
+#: mpulsweb/templates/documents/case_overview.mako:42
+#: mpulsweb/templates/documents/global_overview.mako:34
 msgid "Filesize"
 msgstr "Dateigröße"
 
-#: mpulsweb/templates/documents/case_overview.mako:72
-#: mpulsweb/templates/documents/global_overview.mako:62
+#: mpulsweb/templates/documents/case_overview.mako:78
+#: mpulsweb/templates/documents/global_overview.mako:69
 msgid "Rename"
 msgstr "Umbenennen"
 
-#: mpulsweb/templates/documents/case_overview.mako:90
-#: mpulsweb/templates/documents/global_overview.mako:75
+#: mpulsweb/templates/documents/case_overview.mako:96
+#: mpulsweb/templates/documents/global_overview.mako:82
 msgid "No files found"
 msgstr "Es wurden keine Dateien gefunden"
 

Modified: base/trunk/mpulsweb/i18n/mpulsweb.pot
===================================================================
--- base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-02-27 13:07:37 UTC (rev 5834)
@@ -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-16 15:55+0100\n"
+"POT-Creation-Date: 2012-02-27 13:57+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"
@@ -1550,19 +1550,19 @@
 msgid "The XML file has the version '%s', but supported is only version '%s'"
 msgstr ""
 
-#: mpulsweb/model/document.py:212
+#: mpulsweb/model/document.py:215
 msgid "Could not create new document"
 msgstr ""
 
-#: mpulsweb/model/document.py:306
+#: mpulsweb/model/document.py:310
 msgid "No document available"
 msgstr ""
 
-#: mpulsweb/model/document.py:331
+#: mpulsweb/model/document.py:335
 msgid "An ID is needed"
 msgstr ""
 
-#: mpulsweb/model/document.py:350
+#: mpulsweb/model/document.py:354
 msgid "The requested document can't be found."
 msgstr ""
 
@@ -1619,7 +1619,7 @@
 msgid "Wrong formular input"
 msgstr ""
 
-#: mpulsweb/templates/base.mako:75
+#: mpulsweb/templates/base.mako:79
 #, python-format
 msgid ""
 "You are using a public demo installation of %s. Do not enter any real "
@@ -2135,8 +2135,8 @@
 #: mpulsweb/templates/appointments/overview_body.mako:7
 #: mpulsweb/templates/appointments/remindlist_body.mako:7
 #: mpulsweb/templates/casemanagement/caselist.mako:96
-#: mpulsweb/templates/documents/case_overview.mako:42
-#: mpulsweb/templates/documents/global_overview.mako:33
+#: mpulsweb/templates/documents/case_overview.mako:45
+#: mpulsweb/templates/documents/global_overview.mako:37
 #: mpulsweb/templates/home/globalappointmentlist.mako:13
 #: mpulsweb/templates/logbook/overview.mako:101
 #: mpulsweb/templates/meta/search.mako:81 mpulsweb/templates/phase/phase.mako:28
@@ -2153,10 +2153,10 @@
 #: mpulsweb/templates/casemanagement/caselist.mako:263
 #: mpulsweb/templates/casemanagement/reminderlist.mako:6
 #: mpulsweb/templates/casemanagement/reminderlist.mako:7
-#: mpulsweb/templates/documents/case_overview.mako:66
-#: mpulsweb/templates/documents/case_overview.mako:67
-#: mpulsweb/templates/documents/global_overview.mako:56
-#: mpulsweb/templates/documents/global_overview.mako:57
+#: mpulsweb/templates/documents/case_overview.mako:72
+#: mpulsweb/templates/documents/case_overview.mako:73
+#: mpulsweb/templates/documents/global_overview.mako:63
+#: mpulsweb/templates/documents/global_overview.mako:64
 #: mpulsweb/templates/home/caseappointmentlist.mako:7
 #: mpulsweb/templates/home/caseappointmentlist.mako:11
 #: mpulsweb/templates/home/caseappointmentlist.mako:15
@@ -2180,9 +2180,9 @@
 #: mpulsweb/templates/casemanagement/overview.mako:44
 #: mpulsweb/templates/casemanagement/reminderlist.mako:12
 #: mpulsweb/templates/casemanagement/reminderlist.mako:13
-#: mpulsweb/templates/documents/case_overview.mako:80
-#: mpulsweb/templates/documents/case_overview.mako:81
-#: mpulsweb/templates/documents/global_overview.mako:66
+#: mpulsweb/templates/documents/case_overview.mako:86
+#: mpulsweb/templates/documents/case_overview.mako:87
+#: mpulsweb/templates/documents/global_overview.mako:73
 msgid "Delete"
 msgstr ""
 
@@ -3041,8 +3041,8 @@
 
 #: mpulsweb/templates/casemanagement/rename_attachment.mako:5
 #: mpulsweb/templates/documents/case_overview.mako:19
-#: mpulsweb/templates/documents/global_overview.mako:6
-#: mpulsweb/templates/documents/global_overview.mako:10
+#: mpulsweb/templates/documents/global_overview.mako:7
+#: mpulsweb/templates/documents/global_overview.mako:11
 #: mpulsweb/templates/documents/global_rename.mako:5
 #: mpulsweb/templates/documents/global_upload.mako:5
 #: mpulsweb/templates/documents/dialogs/confirm.mako:4
@@ -3064,7 +3064,7 @@
 #: mpulsweb/templates/casemanagement/rename_attachment.mako:37
 #: mpulsweb/templates/documents/case_new.mako:63
 #: mpulsweb/templates/documents/case_overview.mako:36
-#: mpulsweb/templates/documents/global_overview.mako:27
+#: mpulsweb/templates/documents/global_overview.mako:28
 #: mpulsweb/templates/documents/global_rename.mako:38
 #: mpulsweb/templates/documents/global_upload.mako:51
 msgid "Filename"
@@ -3252,7 +3252,7 @@
 msgstr ""
 
 #: mpulsweb/templates/documents/case_new.mako:24
-#: mpulsweb/templates/documents/global_overview.mako:16
+#: mpulsweb/templates/documents/global_overview.mako:17
 #: mpulsweb/templates/documents/global_upload.mako:11
 msgid "Add new document"
 msgstr ""
@@ -3294,17 +3294,22 @@
 msgstr ""
 
 #: mpulsweb/templates/documents/case_overview.mako:39
-#: mpulsweb/templates/documents/global_overview.mako:30
+#: mpulsweb/templates/documents/global_overview.mako:31
+msgid "Inserted at"
+msgstr ""
+
+#: mpulsweb/templates/documents/case_overview.mako:42
+#: mpulsweb/templates/documents/global_overview.mako:34
 msgid "Filesize"
 msgstr ""
 
-#: mpulsweb/templates/documents/case_overview.mako:72
-#: mpulsweb/templates/documents/global_overview.mako:62
+#: mpulsweb/templates/documents/case_overview.mako:78
+#: mpulsweb/templates/documents/global_overview.mako:69
 msgid "Rename"
 msgstr ""
 
-#: mpulsweb/templates/documents/case_overview.mako:90
-#: mpulsweb/templates/documents/global_overview.mako:75
+#: mpulsweb/templates/documents/case_overview.mako:96
+#: mpulsweb/templates/documents/global_overview.mako:82
 msgid "No files found"
 msgstr ""
 

Modified: base/trunk/mpulsweb/model/document.py
===================================================================
--- base/trunk/mpulsweb/model/document.py	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/model/document.py	2012-02-27 13:07:37 UTC (rev 5834)
@@ -67,17 +67,17 @@
 UPDATE_GLOBAL_WITH_DESC = '''
 UPDATE ka_global_dokumente_tbl_view
 SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s,
-mime = %(mime)s, beschreibung = %(description)s
+mime = %(mime)s, beschreibung = %(description)s, datum = %(datum)s
 WHERE id = %(id)s
 '''
 
 LIST_GLOBAL_WITH_DESC = '''
-SELECT id, master_id, groesse, mime, name, beschreibung
+SELECT id, master_id, groesse, mime, name, datum, beschreibung
 FROM ka_global_dokumente_tbl_view
 '''
 
 LOAD_GLOBAL_WITH_DESC = '''
-SELECT master_id, groesse, mime, daten, name, beschreibung
+SELECT master_id, groesse, mime, daten, name, datum, beschreibung
 FROM ka_global_dokumente_tbl_view
 WHERE id = %(id)s
 '''
@@ -90,7 +90,8 @@
 
 UPDATE_GLOBAL = '''
 UPDATE ka_global_dokumente_tbl_view
-SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s, mime = %(mime)s
+SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s, mime = %(mime)s,
+datum = %(datum)s
 WHERE id = %(id)s
 '''
 
@@ -101,12 +102,12 @@
 '''
 
 LIST_GLOBAL = '''
-SELECT id, master_id, groesse, mime, name
+SELECT id, master_id, groesse, mime, name, datum
 FROM ka_global_dokumente_tbl_view
 '''
 
 LOAD_GLOBAL = '''
-SELECT master_id, groesse, mime, daten, name
+SELECT master_id, groesse, mime, daten, name, datum
 FROM ka_global_dokumente_tbl_view
 WHERE id = %(id)s
 '''
@@ -114,18 +115,18 @@
 UPDATE_CASE_WITH_DESC = '''
 UPDATE ka_fall_dokumente_tbl_view
 SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s,
-mime = %(mime)s, beschreibung = %(description)s
+mime = %(mime)s, beschreibung = %(description)s, datum = %(datum)s
 WHERE id = %(id)s AND master_id = %(case)s
 '''
 
 LIST_CASE_WITH_DESC = '''
-SELECT id, master_id, groesse, mime, name, beschreibung
+SELECT id, master_id, groesse, mime, name, datum, beschreibung
 FROM ka_fall_dokumente_tbl_view
 WHERE master_id = %(master_id)s
 '''
 
 LOAD_CASE_WITH_DESC = '''
-SELECT master_id, groesse, mime, daten, name, beschreibung
+SELECT master_id, groesse, mime, daten, name, datum, beschreibung
 FROM ka_fall_dokumente_tbl_view
 WHERE id = %(id)s
 '''
@@ -138,18 +139,19 @@
 
 UPDATE_CASE = '''
 UPDATE ka_fall_dokumente_tbl_view
-SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s, mime = %(mime)s
+SET daten = %(bytes)s, groesse = %(size)s, name = %(name)s, mime = %(mime)s,
+datum = %(datum)s
 WHERE id = %(id)s AND master_id = %(case)s
 '''
 
 LIST_CASE = '''
-SELECT id, master_id, groesse, mime, name
+SELECT id, master_id, groesse, mime, name, datum
 FROM ka_fall_dokumente_tbl_view
 WHERE master_id = %(master_id)s
 '''
 
 LOAD_CASE = '''
-SELECT master_id, groesse, mime, daten, name
+SELECT master_id, groesse, mime, daten, name, datum
 FROM ka_fall_dokumente_tbl_view
 WHERE id = %(id)s
 '''
@@ -190,17 +192,18 @@
         if not row:
             break
         if g.mpuls_config.is_enabled('module', 'documents-description'):
-            id, case, size, mime, name, description = row
+            id, case, size, mime, name, insert_date, description = row
         else:
-            id, case, size, mime, name = row
+            id, case, size, mime, name, insert_date = row
             description = None
-        documents.append(Document(id, case, size, mime, name, description))
+        documents.append(Document(id, case, size, mime, name, description, 
+                                  insert_date))
 
     return documents
 
 
 def create_document_with_cursor(cursor, name, content, mime, case_id, uuid,
-                                description=""):
+                                description="", insert_date='TODAY'):
     if case_id is None:
         cursor.execute(CREATE_GLOBAL, {'name': name})
     else:
@@ -214,7 +217,7 @@
     document_id = row[0]
     fields = {'bytes': dbapi.Binary(content), 'size': len(content),
               'name': name, 'mime': mime, 'id': document_id,
-              'description': description}
+              'description': description, 'datum': insert_date}
 
     if case_id is None:
         if g.mpuls_config.is_enabled("module", "documents-description"):
@@ -282,7 +285,7 @@
 class Document:
 
     def __init__(self, id=None, case=None, size=None, mime=None, name=None,
-                       description=None):
+                       description=None, insert_date=None):
         self.id = id
         self.case = case
         self.size = size
@@ -290,6 +293,7 @@
         self.name = name
         self.data = None
         self.description = description
+        self.insert_date = insert_date
 
     def isCaseAttached(self):
         return not self.case is None
@@ -348,14 +352,14 @@
             row = cur.fetchone()
             if not row:
                 raise DocumentException(_(u"The requested document can't be found."))
-            print "XXX row=" + str(row)
             self.case = row[0]
             self.size = row[1]
             self.mime = row[2]
             self.data = row[3]
             self.name = row[4]
+            self.insert_date = row[5]
             if g.mpuls_config.is_enabled("module", "documents-description"):
-                self.description = row[5]
+                self.description = row[6]
             else:
                 self.description = None
         finally:

Modified: base/trunk/mpulsweb/public/styles/all.css
===================================================================
--- base/trunk/mpulsweb/public/styles/all.css	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/public/styles/all.css	2012-02-27 13:07:37 UTC (rev 5834)
@@ -166,7 +166,9 @@
 	width:16em;
 }
 
-
+.table_width_filename {
+	width:24em;
+}
 .table_description {
 	width:32em;
 }

Modified: base/trunk/mpulsweb/templates/documents/case_overview.mako
===================================================================
--- base/trunk/mpulsweb/templates/documents/case_overview.mako	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/templates/documents/case_overview.mako	2012-02-27 13:07:37 UTC (rev 5834)
@@ -32,9 +32,12 @@
 <%!  import mpulsweb.lib.helper.filters as F %>
 <table class="hovertable">
   <tr>
-    <th class="table_header_h table_description">
+    <th class="table_header_h table_width_filename">
       ${_('Filename')}
     </th>
+    <th class="table_header_h table_date">
+      ${_('Inserted at')}
+    </th>
     <th class="number_field table_header_h table_date">
       ${_('Filesize')}
     </th>
@@ -57,6 +60,9 @@
             <div class="description">${f.description}</div>
           % endif
       </td>
+      <td class="number field">
+    	${h.NA(h.format_date(f.insert_date))}
+      </td>
       <td class="number_field">
           ${kb(f.size)} KB
       </td>

Modified: base/trunk/mpulsweb/templates/documents/global_overview.mako
===================================================================
--- base/trunk/mpulsweb/templates/documents/global_overview.mako	2012-02-27 10:14:50 UTC (rev 5833)
+++ base/trunk/mpulsweb/templates/documents/global_overview.mako	2012-02-27 13:07:37 UTC (rev 5834)
@@ -1,6 +1,7 @@
 ## -*- coding: utf-8 -*-
 <%inherit file="../main.mako" />
 <%!  import mpulsweb.lib.helper.filters as F %>
+
 <%def name="buildNavipath()">
 		${parent.buildNavipath()}
 	<li><a href="${h.url_for(controller='/document', action='globalOverview')}">${_('Document overview')}</a></li>
@@ -23,9 +24,12 @@
 
 <table class="hovertable">
   <tr>
-    <th class="table_header_h table_description">
+    <th class="table_header_h table_width_filename">
       ${_('Filename')}
     </th>
+    <th class="table_header_h table_date">
+      ${_('Inserted at')}
+    </th>
     <th class="table_header_h number_field table_date">
       ${_('Filesize')}
     </th>
@@ -47,6 +51,9 @@
           <div class="description">${f.description}</div>
         % endif
     </td>
+    <td class="number field">
+    	${h.NA(h.format_date(f.insert_date))}
+    </td>
     <td class="number_field">
         ${kb(f.size)} KB
     </td>



More information about the Mpuls-commits mailing list