Index: eUP_SRP/trunk/skins/waeup_student/co_searchStudents.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/co_searchStudents.py	(revision 885)
+++ 	(revision )
@@ -1,181 +1,0 @@
-## Script (Python) "co_searchStudents"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=REQUEST
-##title=
-##
-# $Id: $
-"""
-list Students for ClearanceOfficers
-"""
-request = REQUEST
-wftool = context.portal_workflow
-mtool = context.portal_membership
-member = mtool.getAuthenticatedMember()
-roles = member.getRolesInContext(context)
-try:
-    from Products.AdvancedQuery import Eq, Between, Le,In
-    evalAdvancedQuery = context.portal_catalog.evalAdvancedQuery
-except:
-    evalAdvancedQuery = None
-
-def cmp_id(a,b):
-    if a.getId() > b.getId():
-        return 1
-    return -1
-
-request = context.REQUEST
-form = request.form
-fget = form.get
-student_subobjects = ("StudentApplication",
-                      "StudentPersonal",
-                      "StudentStudyCourse",
-                      "StudentAccommodation",
-                      "StudentStudyLevel",)
-
-student_objects = student_subobjects + ("Student",)
-
-info = {}
-items = []
-wf = context.portal_workflow
-catalog = context.portal_catalog
-#student_wf_states = wf.waeup_student_wf.states.keys()
-#info['wf_states'] = student_wf_states
-#info['wf_states'][0] = " ----- "
-lt = context.portal_layouts
-pr = context.portal_registration
-path_info = request.get('PATH_INFO').split('/')
-is_manager = context.isManager()
-validate = request.has_key("cpsdocument_edit_button")
-default = {'search_mode': 'name',
-        'review_state': 'clearance_requested',
-        'search_string': ''
-        }
-
-rend,psm,ds = lt.renderLayout(layout_id= 'student_search',
-                      schema_id= 'student_search',
-                      context=context,
-                      mapping=validate and request,
-                      ob=default,
-                      layout_mode='edit',
-                      formaction="co_searchStudents"
-                      )
-if psm == '':
-    return context.students_manager_view(rendered = rend,
-                             psm = psm,
-                             #psm = "%s, %s" % (psm,ds),
-                             students = items,
-                             allowed = True,
-                             )
-what = ds.get('search_mode')
-state = ds.get('review_state')
-st = term = ds.get('search_string')
-err = False
-with_review = state != "all"
-only_review = with_review and not term
-##with_level_results = state.startswith("category") or\
-##                     state in ('content_addable',) and\
-##                     evalAdvancedQuery is not None
-bools = "with_review = %s<br\> only_review = %s<br\>" % (with_review,only_review)
-if not term and not with_review:
-    psm = "You must specify a search string when searching 'all states'."
-    err = True
-elif '*' in term:
-    psm = "you cannot use the '*' alone"
-    err = True
-if err:
-    return context.students_manager_view(rendered = rend,
-                             psm = psm,
-                             #psm = "%s, %s" % (psm,ds),
-                             students = items,
-                             allowed = True,
-                             )
-items = []
-res = []
-portal_type_query = {'query':['Student','StudentApplication','StudentPersonal']}
-st_queries = ('jamb_reg_no','matric_no','name')
-query_step = 0
-review_res = None
-query = None
-if len(term) > 0:
-    if what == "student_id":
-        query_step = 1
-        query = Eq('portal_type','Student') & Eq('id', term.strip())
-    elif what in st_queries:
-        if what == "jamb_reg_no":
-            query_step = 2
-            pt = ('StudentApplication',)
-            st = "%s" % term.strip().lower()
-        elif what == "matric_no":
-            query_step = 3
-            pt = ('StudentClearance',)
-            st = "%s" % term.strip().lower()
-        elif what == "name":
-            query_step = 4
-            pt = ('StudentPersonal')
-            st = "%s" % term.strip()
-        query = In('portal_type',pt) & Eq('SearchableText',"%s*" % term.strip())
-    res = evalAdvancedQuery(query)
-if with_review:
-    query_step += 10
-    review_res = evalAdvancedQuery(In('portal_type',student_objects) & Eq('review_state',state))
-search_set = []
-if res:
-    for r in res:
-        if r.portal_type in ("StudentStudyLevel",):
-            student = r.getObject().aq_parent.aq_parent
-        elif r.portal_type in student_subobjects:
-            student = r.getObject().aq_parent
-        else:
-            student = r.getObject()
-        search_set.append(student)
-review_set = []
-if review_res:
-    for r in review_res:
-        if r.portal_type in ("StudentStudyLevel",):
-            student = r.getObject().aq_parent.aq_parent
-        elif r.portal_type in student_subobjects:
-            student = r.getObject().aq_parent
-        else:
-            student = r.getObject()
-        review_set.append(student)
-all = []
-if only_review:
-    all = review_set
-elif with_review:
-    for i in search_set:
-        if i in review_set:
-            all.append(i)
-else:
-    all = search_set
-for a in all:
-    if a in items:
-        continue
-    items.append(a)
-students = []
-items.sort(cmp_id)
-if items:
-    for item in items:
-        #if context.isClearanceOfficer(info):
-        droles = member.getRolesInContext(item)
-        if "ClearanceOfficer" in droles:
-            info = context.getStudentInfo(item)
-            students.append(info)
-    return context.students_manager_view(rendered = rend,
-                             psm = "",
-                             #psm = "%d,%d matching Students found QS = %s" %\
-                             #       (len(review_set),len(search_set),query_step),
-                             #psm = "%d found QS = %s items: %s" % (len(items),query_step,items),
-                             students = students,
-                             allowed = True,
-                             )
-return context.students_manager_view(rendered = rend,
-                             psm = """Step: %s found: %s Your search for "%s" in %s with state %s failed.<br\>%s""" % (query_step,len(items),st,what,state,bools),
-                             students = students,
-                             allowed = True,
-                             )
-
-
Index: /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py	(revision 885)
+++ /WAeUP_SRP/trunk/skins/waeup_student/searchStudents.py	(revision 886)
@@ -1,3 +1,3 @@
-## Script (Python) "searchStudents"
+## Script (Python) "co_searchStudents"
 ##bind container=container
 ##bind context=context
@@ -5,11 +5,16 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=
+##parameters=REQUEST
 ##title=
 ##
 # $Id$
 """
-return Info about the current Student
+list Students for ClearanceOfficers
 """
+request = REQUEST
+wftool = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+roles = member.getRolesInContext(context)
 try:
     from Products.AdvancedQuery import Eq, Between, Le,In
@@ -44,8 +49,8 @@
 pr = context.portal_registration
 path_info = request.get('PATH_INFO').split('/')
-is_manager = context.isManager
+is_manager = context.isManager()
 validate = request.has_key("cpsdocument_edit_button")
 default = {'search_mode': 'name',
-        'review_state': 'all',
+        'review_state': 'clearance_requested',
         'search_string': ''
         }
@@ -155,9 +160,18 @@
 if items:
     for item in items:
-        info = context.getStudentInfo(item)
-        students.append(info)
+        #if context.isClearanceOfficer(info):
+        if "ClearanceOfficers" in member.getGroups():
+            droles = member.getRolesInContext(item)
+            if "ClearanceOfficer" in droles:
+                info = context.getStudentInfo(item)
+                students.append(info)
+        else:
+            info = context.getStudentInfo(item)
+            students.append(info)
+                
     return context.students_manager_view(rendered = rend,
-                             psm = "%d,%d matching Students found QS = %s" %\
-                                    (len(review_set),len(search_set),query_step),
+                             psm = "",
+                             #psm = "%d,%d matching Students found QS = %s" %\
+                             #       (len(review_set),len(search_set),query_step),
                              #psm = "%d found QS = %s items: %s" % (len(items),query_step,items),
                              students = students,
@@ -169,2 +183,4 @@
                              allowed = True,
                              )
+
+
Index: /WAeUP_SRP/trunk/skins/waeup_student/students_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/students_index.py	(revision 885)
+++ /WAeUP_SRP/trunk/skins/waeup_student/students_index.py	(revision 886)
@@ -24,5 +24,5 @@
 
 if "ClearanceOfficers" in member.getGroups():
-    return redirect("%s/co_searchStudents" % students_url)
+    return redirect("%s/searchStudents" % students_url)
 if context.isManager():
     return redirect("%s/searchStudents" % students_url)
