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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jan 13 15:55:35 CET 2010


Author: torsten
Date: 2010-01-13 15:55:34 +0100 (Wed, 13 Jan 2010)
New Revision: 752

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/case_overview.py
   waska/trunk/waskaweb/controllers/waska.py
   waska/trunk/waskaweb/templates/casemanagement/listbadcases.mako
Log:
Issue903


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2010-01-13 11:06:39 UTC (rev 751)
+++ waska/trunk/ChangeLog.txt	2010-01-13 14:55:34 UTC (rev 752)
@@ -1,3 +1,8 @@
+2010-01-13 	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Issue903:
+
+	* waskaweb/controllers/case_overview.py: List bad cases with state 3 
 2009-12-10 	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Issue911:

Modified: waska/trunk/waskaweb/controllers/case_overview.py
===================================================================
--- waska/trunk/waskaweb/controllers/case_overview.py	2010-01-13 11:06:39 UTC (rev 751)
+++ waska/trunk/waskaweb/controllers/case_overview.py	2010-01-13 14:55:34 UTC (rev 752)
@@ -312,9 +312,16 @@
             for k,v in build_inconsistency_type_querys().iteritems():
                 # igonore checks on phases for old cases
                 if rexpr_phases.match(k):
-                    s = "state:1;state:2;own:%s;only_cases_after:'%s';inconsistency:%s" % (user.id, INCONSISTENCY_CHECK_AFTER, k)
+                    if h.hasRole(['cm_ka']):
+                        s = "state:1;state:2;own:%s;only_cases_after:'%s';inconsistency:%s" % (user.id, INCONSISTENCY_CHECK_AFTER, k)
+                    else:
+                        s = "state:4;only_cases_after:'%s';inconsistency:%s" % (INCONSISTENCY_CHECK_AFTER, k)
+
                 else:
-                    s = 'state:1;state:2;state:4;state:5;own:%s;inconsistency:%s' % (user.id, k)
+                    if h.hasRole(['cm_ka']):
+                        s = 'state:1;state:2;own:%s;inconsistency:%s' % (user.id, k)
+                    else:
+                        s = 'state:4;inconsistency:%s' % (k)
                 l = CaseOverview().search(s)
                 c.inconsistency_types[k] = l
         except StandardError, err:

Modified: waska/trunk/waskaweb/controllers/waska.py
===================================================================
--- waska/trunk/waskaweb/controllers/waska.py	2010-01-13 11:06:39 UTC (rev 751)
+++ waska/trunk/waskaweb/controllers/waska.py	2010-01-13 14:55:34 UTC (rev 752)
@@ -89,9 +89,15 @@
 
             #find out if there are cases with errors
             #Search inconsistencys on dates
-            search_str1 = "state:1;state:2;state:4;state:5;bad:1;bad:2;bad:3;bad:4;bad:5;bad:6;bad:7;own:%s" % user.id
-            #Search inconsistencys on phases but ignore older cases. 
-            search_str2 = "state:1;state:2;state:4;bad:clearing_start;bad:clearing_ende;bad:beratung_start;bad:beratung_ende;bad:cm_start;bad:cm_ende;bad:nachbetreuung_start;bad:nachbetreuung_ende;only_cases_after:'%s';own:%s" % (INCONSISTENCY_CHECK_AFTER, user.id)
+            if h.hasRole(['cm_ka']):
+                search_str1 = "state:1;state:2;bad:1;bad:2;bad:3;bad:4;bad:5;bad:6;bad:7;own:%s" % user.id
+                #Search inconsistencys on phases but ignore older cases. 
+                search_str2 = "state:1;state:2;bad:clearing_start;bad:clearing_ende;bad:beratung_start;bad:beratung_ende;bad:cm_start;bad:cm_ende;bad:nachbetreuung_start;bad:nachbetreuung_ende;only_cases_after:'%s';own:%s" % (INCONSISTENCY_CHECK_AFTER, user.id)
+            else:
+                search_str1 = "state:4;bad:1;bad:2;bad:3;bad:4;bad:5;bad:6;bad:7;own:%s" % user.id
+                #Search inconsistencys on phases but ignore older cases. 
+                search_str2 = "state:4;bad:clearing_start;bad:clearing_ende;bad:beratung_start;bad:beratung_ende;bad:cm_start;bad:cm_ende;bad:nachbetreuung_start;bad:nachbetreuung_ende;only_cases_after:'%s';own:%s" % (INCONSISTENCY_CHECK_AFTER, user.id)
+
             error_cases1 = Set(c.id for c in CaseOverview().search(search_str1))
             error_cases2 = Set(c.id for c in CaseOverview().search(search_str2))
             c.num_error_cases = len(error_cases1.union(error_cases2))

Modified: waska/trunk/waskaweb/templates/casemanagement/listbadcases.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/listbadcases.mako	2010-01-13 11:06:39 UTC (rev 751)
+++ waska/trunk/waskaweb/templates/casemanagement/listbadcases.mako	2010-01-13 14:55:34 UTC (rev 752)
@@ -39,13 +39,25 @@
         <td class="count ${count%2 or 'table_row_h'}">${len(v)}</td>
         <td class="count ${count%2 or 'table_row_h'}">
           <form name="list1" action="${h.url_for(controller="case_overview", action="search")}" method=post>
-            <input type="hidden" name="show_anonymized" value="1">
-            <input type="hidden" name="show_own" value="1">
-            <input type="hidden" name="show_open" value="1">
+            <input type="hidden" name="show_anonymized" value="0">
             % if regexpr.match(k):
-              <input type="hidden" name="search_str" value="inconsistency:${k};only_cases_after:${start_date}'">
+              % if h.hasRole(['cm_ka']):
+                <input type="hidden" name="show_own" value="1">
+                <input type="hidden" name="show_open" value="1">
+                <input type="hidden" name="search_str" value="inconsistency:${k};only_cases_after:${start_date}'">
+              % else:
+                <input type="hidden" name="show_markanonymize" value="1">
+                <input type="hidden" name="search_str" value="inconsistency:${k};only_cases_after:${start_date}'">
+              % endif
             % else:
-              <input type="hidden" name="search_str" value="inconsistency:${k}">
+              % if h.hasRole(['cm_ka']):
+                <input type="hidden" name="show_own" value="1">
+                <input type="hidden" name="show_open" value="1">
+                <input type="hidden" name="search_str" value="inconsistency:${k}">
+              % else:
+                <input type="hidden" name="show_markanonymize" value="1">
+                <input type="hidden" name="search_str" value="inconsistency:${k}">
+              % endif
             % endif
             <input type="submit" value="Anzeigen">
           </form>



More information about the Mpuls-commits mailing list