[Mpuls-commits] r180 - in waska/trunk: . waskaweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 19 17:06:54 CEST 2008


Author: teichmann
Date: 2008-09-19 17:06:53 +0200 (Fri, 19 Sep 2008)
New Revision: 180

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/templates/casemanagement/phase.mako
Log:
Fixed issue568


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2008-09-19 15:05:45 UTC (rev 179)
+++ waska/trunk/ChangeLog.txt	2008-09-19 15:06:53 UTC (rev 180)
@@ -1,5 +1,12 @@
 2008-09-19  Sascha L. Teichmann <sascha.teichmann at intevation.de>
 
+	Fixed issue568
+
+	* waskaweb/templates/casemanagement/phase.mako: Only enable change buttons
+	  for cm_kas.
+
+2008-09-19  Sascha L. Teichmann <sascha.teichmann at intevation.de>
+
 	Fixed issue565
 
 	* waskaweb/controllers/case.py: fetch "Erstgespraech" and "Kundennummer" from

Modified: waska/trunk/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/phase.mako	2008-09-19 15:05:45 UTC (rev 179)
+++ waska/trunk/waskaweb/templates/casemanagement/phase.mako	2008-09-19 15:06:53 UTC (rev 180)
@@ -11,12 +11,17 @@
 <form method="POST" action="${h.url_for(controller='/case', action='setPhaseAction')}">
   <input type="hidden" name="case_id" value="${session.get('case').id}">
   <table id="cmphases">
+    <% is_allowed = h.hasRole(('cm_ka',)) %>
     <tr>
       <th class="table_header_h" width="18%">${_('cm_info_phase')}</th>
       <th class="table_header_h" width="3%">&nbsp;</th>
       <th class="table_header_h" width="44%">${_('case_cm_phase_required_fields')}</th>
       <th class="table_header_h" width="15%">${_('case_cm_phase_time')}</th>
-      <th style="text-align:right" class="table_header_h" width="20%">${_('case_cm_phase_change')}</th>
+      <th style="text-align:right" class="table_header_h" width="20%">
+      % if is_allowed:
+      ${_('case_cm_phase_change')}
+      % endif
+      </th>
     </tr>
     % for count, phase_pair in enumerate(c.phase_pairs):
     <% p1, p2 = phase_pair.getStart(), phase_pair.getEnd()  %>
@@ -39,11 +44,13 @@
       </td>
       <td>${h.dd_mm_YYYY(p1.getTime(), '-/-')}</td>
       <td style="text-align:right">
-        % if (p1.isRecursiveComplete() and not p1.isRunning() and (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1))) or not session.get('case').isYoungerThan('2008-09-01'):
-            <input type="submit" value="Start" name="${p1.getLabel()|h}">
-        % else:
-            <input type="submit" value="Start" name="${p1.getLabel()|h}"
-              disabled="disabled">
+        % if is_allowed:
+            % if (p1.isRecursiveComplete() and not p1.isRunning() and (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1))) or not session.get('case').isYoungerThan('2008-09-01'):
+                <input type="submit" value="Start" name="${p1.getLabel()|h}">
+            % else:
+                <input type="submit" value="Start" name="${p1.getLabel()|h}"
+                  disabled="disabled">
+            % endif
         % endif
       </td>
     </tr>
@@ -58,11 +65,13 @@
       </td>
       <td class="table_row_h">${h.dd_mm_YYYY(p2.getTime(), '-/-')}</td>
       <td style="text-align:right" class="table_row_h">
-        % if (p2.isRecursiveComplete() and p2.isNeighbor(c.current_phase) and not c.current_phase.hasPredecessor(p2)) or not session.get('case').isYoungerThan('2008-09-01'):
-            <input type="submit" value="Ende" name="${p2.getLabel()|h}">
-        % else:
-            <input type="submit" value="Ende" name="${p2.getLabel()|h}" 
-              disabled="disabled">
+        % if is_allowed:
+            % if (p2.isRecursiveComplete() and p2.isNeighbor(c.current_phase) and not c.current_phase.hasPredecessor(p2)) or not session.get('case').isYoungerThan('2008-09-01'):
+                <input type="submit" value="Ende" name="${p2.getLabel()|h}">
+            % else:
+                <input type="submit" value="Ende" name="${p2.getLabel()|h}" 
+                  disabled="disabled">
+            % endif
         % endif
       </td>
     </tr>



More information about the Mpuls-commits mailing list