[Mpuls-commits] r4402 - in base/trunk: . mpulsweb/controllers mpulsweb/model mpulsweb/templates/logbook

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Dec 17 11:11:52 CET 2010


Author: roland
Date: 2010-12-17 11:11:50 +0100 (Fri, 17 Dec 2010)
New Revision: 4402

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/logbook.py
   base/trunk/mpulsweb/model/logbook.py
   base/trunk/mpulsweb/templates/logbook/overview_print.mako
Log:
issue863: Die Tagebuchdruckfunktion (G312) zeigt nun auch den Namen des Jungendlichen an

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-12-16 12:00:28 UTC (rev 4401)
+++ base/trunk/ChangeLog	2010-12-17 10:11:50 UTC (rev 4402)
@@ -1,5 +1,13 @@
 2010-12-13  Roland Geider <roland.geider at intevation.de>
 
+	* mpulsweb/model/logbook.py,
+	  mpulsweb/controllers/logbook.py,
+	  mpulsweb/templates/logbook/overview_print.mako: issue863:
+	  Die Tagebuchdruckfunktion (G312) zeigt nun auch den Namen des
+	  Jungendlichen an
+
+2010-12-13  Roland Geider <roland.geider at intevation.de>
+
 	* mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po: issue1605: correct
 	  translation of tooltips in the phase overview for fields with
 	  errors

Modified: base/trunk/mpulsweb/controllers/logbook.py
===================================================================
--- base/trunk/mpulsweb/controllers/logbook.py	2010-12-16 12:00:28 UTC (rev 4401)
+++ base/trunk/mpulsweb/controllers/logbook.py	2010-12-17 10:11:50 UTC (rev 4402)
@@ -283,9 +283,16 @@
     def printout(self, id):
         id = self._checkInt(id)
         c.print_version = 1
+        
+        # Load logbook
         logbook = Logbook()
         logbook.loadById(id)
         c.logbook = logbook
+        
+        # Load case
+        case = self._loadCase(logbook.getMasterId())
+        c.case = case
+        
         return render('/logbook/overview_print.mako')
     
     

Modified: base/trunk/mpulsweb/model/logbook.py
===================================================================
--- base/trunk/mpulsweb/model/logbook.py	2010-12-16 12:00:28 UTC (rev 4401)
+++ base/trunk/mpulsweb/model/logbook.py	2010-12-17 10:11:50 UTC (rev 4402)
@@ -51,14 +51,14 @@
 ALLOWED_SORTING = ['name', 'art', 'dauer', 'datum', 'asc', 'desc', 'bearbeiter']
 LOAD_LOGBOOK = """
 SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ,
-       uuid_id
+       uuid_id, master_id
 FROM ka_logbuch_tbl_view l WHERE l.master_id = %s
 ORDER BY %s %s
 """
 
 LOAD_LOGBOOK_BY_ID = """
 SELECT l.id AS id, datum, bearbeiter, art, kurz_notiz, notiz, dauer, typ,
-       uuid_id
+       uuid_id, master_id
 FROM ka_logbuch_tbl_view l WHERE l.id = %(mid)s
 """
 
@@ -114,6 +114,7 @@
         self.dauer = None
         self.typ = None
         self.uuid = None
+        self.master_id = None
 
     def setByRow(self, row):
         self.id = row[0]
@@ -125,6 +126,7 @@
         self.dauer = row[6]
         self.typ = row[7]
         self.uuid = row[8]
+        self.master_id = row[9]
 
     def loadById(self, id):
         self.id = id
@@ -146,6 +148,9 @@
     def getId(self, id):
         return self.id
 
+    def getMasterId(self):
+        return self.master_id
+
     def getDate(self):
         return h.dd_mm_YYYY(self.datum)
 
@@ -236,6 +241,10 @@
     def __init__(self, mid=None):
         self.entries = []
         self.mid = mid
+        self.masterId = None
+        
+    def getMasterId(self):
+        return self.masterId
 
     def deleteEntryById(self, mid):
         db.execute(DELETE_LOGBOOK_ENTRY, {'mid': mid})
@@ -262,6 +271,7 @@
                     break
                 entry = LogbookEntry()
                 entry.setByRow(row)
+                self.masterId = row[9]
                 self.entries.append(entry)
         finally:
             db.recycleConnection(conn, cur)

Modified: base/trunk/mpulsweb/templates/logbook/overview_print.mako
===================================================================
--- base/trunk/mpulsweb/templates/logbook/overview_print.mako	2010-12-16 12:00:28 UTC (rev 4401)
+++ base/trunk/mpulsweb/templates/logbook/overview_print.mako	2010-12-17 10:11:50 UTC (rev 4402)
@@ -9,7 +9,7 @@
 </%def>
 <div id="content_header_small">
   <div id="content_ueberschrift">
-    Tagebuch 
+    Tagebuch - ${c.case.last_name}, ${c.case.first_name}
   </div>
   <div id="modusfield">
     <div class="actions">



More information about the Mpuls-commits mailing list