[Mpuls-commits] r1995 - wasko/branches/2.0/jmdweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 17 14:30:33 CET 2010


Author: torsten
Date: 2010-03-17 14:30:32 +0100 (Wed, 17 Mar 2010)
New Revision: 1995

Modified:
   wasko/branches/2.0/jmdweb/controllers/case_overview.py
Log:
Commented out jmdspecific search option parsing. Use mpuls defaults for now.


Modified: wasko/branches/2.0/jmdweb/controllers/case_overview.py
===================================================================
--- wasko/branches/2.0/jmdweb/controllers/case_overview.py	2010-03-17 13:29:30 UTC (rev 1994)
+++ wasko/branches/2.0/jmdweb/controllers/case_overview.py	2010-03-17 13:30:32 UTC (rev 1995)
@@ -204,80 +204,80 @@
             search_options.append('sort_order:asc')
         return search_options
 
-    def parseSearchOptions(self, options=None):
-        search_options = []
-        user = session['USER_AUTHORIZED']
-        if options.get('editor', '-1') != '-1':
-            search_options.append('editor:%s' % options.get('editor'))
-        if options.get('show_own') == '1':
-            search_options.append('own:%s' % user.id)
-        if options.get('show_other') == '1':
-            search_options.append('standin:%s' % user.id)
-        if options.get('show_open') == '1':
-            search_options.append('state:%s' % 1)
-            search_options.append('state:%s' % 2)
-        if options.get('show_closed') == '1':
-            search_options.append('state:%s' % 2)
-        if options.get('show_markdelete') == '1':
-            search_options.append('state:%s' % 3)
-        if options.get('show_markanonymize') == '1':
-            search_options.append('state:%s' % 4)
-        if options.get('show_anonymized') == '1':
-            search_options.append('state:%s' % 5)
-            # For cm users show cases which are marked for anon too
-            if h.hasRole(['cm_ka']):
-                search_options.append('state:%s' % 4)
-        if options.get('gender', '-2') != '-2':
-            search_options.append('gender:%s' % options.get('gender'))
-        if options.get('branch'):
-            search_options.append('branch:%s' % options.get('branch'))
-        if options.get('search_str'):
-            search_options.append(options.get('search_str'))
+    #def parseSearchOptions(self, options=None):
+    #    search_options = []
+    #    user = session['USER_AUTHORIZED']
+    #    if options.get('editor', '-1') != '-1':
+    #        search_options.append('editor:%s' % options.get('editor'))
+    #    if options.get('show_own') == '1':
+    #        search_options.append('own:%s' % user.id)
+    #    if options.get('show_other') == '1':
+    #        search_options.append('standin:%s' % user.id)
+    #    if options.get('show_open') == '1':
+    #        search_options.append('state:%s' % 1)
+    #        search_options.append('state:%s' % 2)
+    #    if options.get('show_closed') == '1':
+    #        search_options.append('state:%s' % 2)
+    #    if options.get('show_markdelete') == '1':
+    #        search_options.append('state:%s' % 3)
+    #    if options.get('show_markanonymize') == '1':
+    #        search_options.append('state:%s' % 4)
+    #    if options.get('show_anonymized') == '1':
+    #        search_options.append('state:%s' % 5)
+    #        # For cm users show cases which are marked for anon too
+    #        if h.hasRole(['cm_ka']):
+    #            search_options.append('state:%s' % 4)
+    #    if options.get('gender', '-2') != '-2':
+    #        search_options.append('gender:%s' % options.get('gender'))
+    #    if options.get('branch'):
+    #        search_options.append('branch:%s' % options.get('branch'))
+    #    if options.get('search_str'):
+    #        search_options.append(options.get('search_str'))
 
-        #Migration
-        if options.get('migration', '-2') != '-2':
-            search_options.append('migration:%s' % options.get('migration'))
+    #    #Migration
+    #    if options.get('migration', '-2') != '-2':
+    #        search_options.append('migration:%s' % options.get('migration'))
 
-        #cm-states
-        cm_state = options.get('cm_state')
-        phases = [] # default
-        if cm_state:
-            if cm_state == 'none':
-                phases = []
-            if cm_state == 'clearing':
-                phases = [0,1]
-            if cm_state == 'active':
-                phases = [2]
-            if cm_state == 'finished':
-                phases = [3,4,5]
-            if cm_state == 'all':
-                phases = [-1,0,1,2,3,4,5]
-            phases = '%s' % ";".join("phase:%s" % p for p in phases)
-            if phases:
-                search_options.append(phases)
+    #    #cm-states
+    #    cm_state = options.get('cm_state')
+    #    phases = [] # default
+    #    if cm_state:
+    #        if cm_state == 'none':
+    #            phases = []
+    #        if cm_state == 'clearing':
+    #            phases = [0,1]
+    #        if cm_state == 'active':
+    #            phases = [2]
+    #        if cm_state == 'finished':
+    #            phases = [3,4,5]
+    #        if cm_state == 'all':
+    #            phases = [-1,0,1,2,3,4,5]
+    #        phases = '%s' % ";".join("phase:%s" % p for p in phases)
+    #        if phases:
+    #            search_options.append(phases)
 
-        #check build time_interval
-        year = options.get('year')
-        quarter = options.get('quarter')
-        if year != '-1' and year:
-            q_start = "01-01"
-            q_end = "12-31"
-            if quarter == '1':
-                q_end = "03-31"
-            if quarter == '2':
-                q_start = "04-01"
-                q_end = "06-30"
-            if quarter == '3':
-                q_start = "07-01"
-                q_end = "09-30"
-            if quarter == '4':
-                q_start = "10-01"
+    #    #check build time_interval
+    #    year = options.get('year')
+    #    quarter = options.get('quarter')
+    #    if year != '-1' and year:
+    #        q_start = "01-01"
+    #        q_end = "12-31"
+    #        if quarter == '1':
+    #            q_end = "03-31"
+    #        if quarter == '2':
+    #            q_start = "04-01"
+    #            q_end = "06-30"
+    #        if quarter == '3':
+    #            q_start = "07-01"
+    #            q_end = "09-30"
+    #        if quarter == '4':
+    #            q_start = "10-01"
 
-            search_options.append("interval_start_date:%s" % "-".join([year,
-                                                                       q_start]))
-            search_options.append("interval_end_date:%s" % "-".join([year, q_end]))
+    #        search_options.append("interval_start_date:%s" % "-".join([year,
+    #                                                                   q_start]))
+    #        search_options.append("interval_end_date:%s" % "-".join([year, q_end]))
 
-        return search_options
+    #    return search_options
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
     def bundleAction(self):



More information about the Mpuls-commits mailing list