[Mpuls-commits] r551 - in wasko/trunk: . waskaweb/controllers waskaweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 28 10:54:37 CEST 2009


Author: torsten
Date: 2009-07-28 10:54:34 +0200 (Tue, 28 Jul 2009)
New Revision: 551

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/controllers/case.py
   wasko/trunk/waskaweb/templates/casemanagement/digest_body.mako
Log:
Make printing of the digest work again


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-07-28 08:05:56 UTC (rev 550)
+++ wasko/trunk/ChangeLog.txt	2009-07-28 08:54:34 UTC (rev 551)
@@ -62,6 +62,12 @@
 	  formularpage to handle print requests. Added new styles for
 	  printing.
 
+	Make printing if the digest work again
+
+	* waskaweb/controllers/case.py,
+	  waskaweb/templates/casemanagement/digest_body.mako: New function in
+	  controller to handle print requests for the digest.
+
 2009-07-16	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	Set version to 1.0.5

Modified: wasko/trunk/waskaweb/controllers/case.py
===================================================================
--- wasko/trunk/waskaweb/controllers/case.py	2009-07-28 08:05:56 UTC (rev 550)
+++ wasko/trunk/waskaweb/controllers/case.py	2009-07-28 08:54:34 UTC (rev 551)
@@ -273,17 +273,23 @@
         c.print_form = "digest" # Which page to open in popup on printing?
         return render('/casemanagement/digest.mako')
 
+    #@checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
+    #def printout(self, ds_id, page_id, form=None):
+    #    ds_id   = self._checkInt(ds_id)
+    #    page_id = self._checkInt(page_id)
+    #    c.print_version = 1
+    #    if form == "digest":
+    #        return self.digest(ds_id)
+    #    elif form == "show":
+    #        return self.show(ds_id, page_id)
+    #    else:
+    #        raise HTTPNotFound()
+
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
-    def printout(self, ds_id, page_id, form=None):
-        ds_id   = self._checkInt(ds_id)
-        page_id = self._checkInt(page_id)
+    def printdigest(self, id):
+        id = self._checkInt(id)
         c.print_version = 1
-        if form == "digest":
-            return self.digest(ds_id)
-        elif form == "show":
-            return self.show(ds_id, page_id)
-        else:
-            raise HTTPNotFound()
+        return self.digest(id)
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
     def printAll(self, id, empty):

Modified: wasko/trunk/waskaweb/templates/casemanagement/digest_body.mako
===================================================================
--- wasko/trunk/waskaweb/templates/casemanagement/digest_body.mako	2009-07-28 08:05:56 UTC (rev 550)
+++ wasko/trunk/waskaweb/templates/casemanagement/digest_body.mako	2009-07-28 08:54:34 UTC (rev 551)
@@ -4,6 +4,7 @@
   <div id="content_ueberschrift">
 ${_('cm_header_digest')}
   </div>
+  ${self.buildModusfield()}
 </div>
 % if not c.print_version:
   % if c.daysToMaxSavetime < 0:
@@ -54,27 +55,27 @@
     <td>
       <table class="digest_table_left">
               <tr>
-                      <td class="label table_header_v table_width_mid_l">${_('cm_digest_tbl_label_lastname')}</td>
-                      <td class="table_row_v">${c.digest.last_name | F.NA, h}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
+                      <td class="hl">${c.digest.last_name | F.NA, h}</td>
               </tr>
               <tr>
                       <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-                      <td class="table_row_v_2">${c.digest.first_name | F.NA, h}</td>
+                      <td class="">${c.digest.first_name | F.NA, h}</td>
               </tr>
               <tr>
-                      <td class="label table_header_v">${_('cm_digest_tbl_label_caseid')}</td>
-                      <td class="table_row_v">${c.digest.knr | F.NA, h}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_caseid')}</td>
+                      <td class="hl">${c.digest.knr | F.NA, h}</td>
               </tr>
               <tr>
                       <td class="label">${_('cm_digest_tbl_label_age')}</td>
-                      <td class="table_row_v_2">${c.digest.age | F.NA, h}</td>
+                      <td class="">${c.digest.age | F.NA, h}</td>
               </tr>
               <tr>
-                      <td class="label table_header_v">${_('cm_digest_tbl_label_email')}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_email')}</td>
                       % if c.digest.email != "None":
-                        <td class="table_row_v"><a href="mailto:${c.digest.email | F.NA, h}">${c.digest.email | F.NA, h}</a></td>
+                        <td class="hl"><a href="mailto:${c.digest.email | F.NA, h}">${c.digest.email | F.NA, h}</a></td>
                       % else:
-                        <td class="table_row_v">${c.digest.email | F.NA, h}</td>
+                        <td class="hl">${c.digest.email | F.NA, h}</td>
                       % endif
               </tr>
       </table>
@@ -82,28 +83,28 @@
     <td>
       <table class="digest_table_right">
               <tr>
-                      <td class="label table_header_v table_width_mid_l">${_('cm_digest_tbl_label_street')}</td>
-                      <td class="table_row_v">${c.digest.street | F.NA, h} / ${c.digest.streetnr | F.NA, h}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_street')}</td>
+                      <td class="hl">${c.digest.street | F.NA, h} / ${c.digest.streetnr | F.NA, h}</td>
               </tr>
               <tr>
                       <td class="label">${_('cm_digest_tbl_label_plz')}</td>
-                      <td class="table_row_v_2">${c.digest.plz | F.NA, h}</td>
+                      <td class="">${c.digest.plz | F.NA, h}</td>
               </tr>
               <tr>
-                      <td class="label table_header_v">${_('cm_digest_tbl_label_city')}</td>
-                      <td class="table_row_v">${c.digest.city | F.NA, h}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_city')}</td>
+                      <td class="hl">${c.digest.city | F.NA, h}</td>
               </tr>
               <tr>
                       <td class="label">${_('cm_digest_tbl_label_telephone')} 1</td>
-                      <td class="table_row_v_2">(${c.digest.telephone_1 | F.NA, h}) ${c.digest.telephone_2 | F.NA, h}</td>
+                      <td class="">(${c.digest.telephone_1 | F.NA, h}) ${c.digest.telephone_2 | F.NA, h}</td>
               </tr>
               <tr>
-                      <td class="label table_header_v">${_('cm_digest_tbl_label_telephone')} 2</td>
-                      <td class="table_row_v">(${c.digest.telephone_3| F.NA, h}) ${c.digest.telephone_4| F.NA, h}</td>
+                      <td class="label hl">${_('cm_digest_tbl_label_telephone')} 2</td>
+                      <td class="hl">(${c.digest.telephone_3| F.NA, h}) ${c.digest.telephone_4| F.NA, h}</td>
               </tr>
               <tr>
                       <td class="label">${_('cm_digest_tbl_label_telephone_more')}</td>
-                      <td class="table_row_v_2">${c.digest.telephone_more | }</td>
+                      <td class="">${c.digest.telephone_more | }</td>
               </tr>
       </table>
     </td>
@@ -117,19 +118,19 @@
     <td>
       <table class="digest_table_left">
         <tr>
-          <td class="label table_header_v table_width_mid_l">${_('cm_digest_tbl_label_lastname')}</td>
-          <td class="table_row_v">${c.digest.mother_last_name | F.NA, h}</td>
+          <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
+          <td class="hl">${c.digest.mother_last_name | F.NA, h}</td>
         </tr>
         <tr>
           <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-          <td class="table_row_v_2">${c.digest.mother_first_name | F.NA, h}</td>
+          <td class="">${c.digest.mother_first_name | F.NA, h}</td>
         </tr>
         <tr>
-          <td class="label table_header_v">${_('cm_digest_tbl_label_email')}</td>
+          <td class="label hl">${_('cm_digest_tbl_label_email')}</td>
           % if c.digest.mother_email != "None":
-            <td class="table_row_v"><a href="mailto:${c.digest.mother_email | F.NA, h}">${c.digest.mother_email | F.NA, h}</a></td>
+            <td class="hl"><a href="mailto:${c.digest.mother_email | F.NA, h}">${c.digest.mother_email | F.NA, h}</a></td>
           % else:
-            <td class="table_row_v">${c.digest.mother_email | F.NA, h}</td>
+            <td class="hl">${c.digest.mother_email | F.NA, h}</td>
           % endif
         </tr>
       </table>
@@ -137,8 +138,8 @@
     <td>
       <table class="digest_table_right"> 
         <tr>
-          <td class="label table_header_v table_width_mid_l">${_('cm_digest_tbl_label_telephone')} 1</td>
-          <td class="table_row_v">(${c.digest.mother_telephone_1 | F.NA, h}) ${c.digest.mother_telephone_2| F.NA, h}</td>
+          <td class="label hl">${_('cm_digest_tbl_label_telephone')} 1</td>
+          <td class="hl">(${c.digest.mother_telephone_1 | F.NA, h}) ${c.digest.mother_telephone_2| F.NA, h}</td>
         </tr>
         <tr>
           <td class="label">${_('cm_digest_tbl_label_telephone')} 2</td>
@@ -157,19 +158,19 @@
     <td>
       <table class="digest_table_left">
         <tr>
-          <td class="label table_header_v table_width_mid_l">${_('cm_digest_tbl_label_lastname')}</td>
-          <td class="table_row_v">${c.digest.father_last_name | F.NA, h}</td>
+          <td class="label hl">${_('cm_digest_tbl_label_lastname')}</td>
+          <td class="hl">${c.digest.father_last_name | F.NA, h}</td>
         </tr>
         <tr>
           <td class="label">${_('cm_digest_tbl_label_firstname')}</td>
-          <td class="table_row_v_2">${c.digest.father_first_name | F.NA, h}</td>
+          <td class="">${c.digest.father_first_name | F.NA, h}</td>
         </tr>
         <tr>
-          <td class="label table_header_v">${_('cm_digest_tbl_label_email')}</td>
+          <td class="label hl">${_('cm_digest_tbl_label_email')}</td>
           % if c.digest.father_email != "None":
-            <td class="table_row_v"><a href="mailto:${c.digest.father_email | F.NA, h}">${c.digest.father_email | F.NA, h}</a></td>
+            <td class="hl"><a href="mailto:${c.digest.father_email | F.NA, h}">${c.digest.father_email | F.NA, h}</a></td>
           % else:
-            <td class="table_row_v">${c.digest.father_email | F.NA, h}</td>
+            <td class="hl">${c.digest.father_email | F.NA, h}</td>
           % endif
         </tr>
       </table>
@@ -177,8 +178,8 @@
     <td>
       <table class="digest_table_right"> 
         <tr>
-          <td class="label table_header_v table_width_mid_l">${_('Telefon')} 1</td>
-          <td class="table_row_v">(${c.digest.father_telephone_1 | F.NA, h}) ${c.digest.father_telephone_2 | F.NA, h}</td>
+          <td class="label hl">${_('Telefon')} 1</td>
+          <td class="hl">(${c.digest.father_telephone_1 | F.NA, h}) ${c.digest.father_telephone_2 | F.NA, h}</td>
         </tr>
         <tr>
           <td class="label">${_('Telefon')} 2</td>
@@ -191,3 +192,13 @@
     </td>
   </tr>
 </table>
+
+<%def name="buildModusfield()">
+  <div id="modusfield">
+    <div class="actions">
+      <ul>
+        <li><a href="/case/printdigest/${session['case'].id}" target="_blank" onclick="return checkModification();"> ${_('cm_actions_link_printout')}</a></li>
+      </ul>
+    </div>
+  </div>
+</%def>



More information about the Mpuls-commits mailing list