Index: /WAeUP_SRP/trunk/profiles/default/vocabularies/student_search_mode.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/vocabularies/student_search_mode.xml	(revision 1032)
+++ /WAeUP_SRP/trunk/profiles/default/vocabularies/student_search_mode.xml	(revision 1033)
@@ -9,3 +9,4 @@
  <item key="matric_no" msgid="">Matriculation No</item>
  <item key="jamb_reg_no" msgid="">Jamb Registration No</item>
+ <item key="department" msgid="">Department (complete ids only)</item>
 </object>
Index: /WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py	(revision 1032)
+++ /WAeUP_SRP/trunk/skins/waeup_student/get_searchable_student_states.py	(revision 1033)
@@ -21,5 +21,6 @@
     return voc.get(key)
 if "ClearanceOfficers" in member.getGroups():
-    return [item for item in voc.items() if item[0].startswith('clear')]
+    return [item for item in voc.items() if item[0].startswith('clear') or
+                                         item[0] in ("all",)]
 return voc.items()
 
Index: /WAeUP_SRP/trunk/skins/waeup_student/search_students.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1032)
+++ /WAeUP_SRP/trunk/skins/waeup_student/search_students.py	(revision 1033)
@@ -13,8 +13,11 @@
 """
 request = REQUEST
+form = request.form
+fget = form.get
 wftool = context.portal_workflow
 mtool = context.portal_membership
 member = mtool.getAuthenticatedMember()
 roles = member.getRolesInContext(context)
+students_folder = context.portal_url.getPortalObject().campus.students
 try:
     from Products.AdvancedQuery import Eq, Between, Le,In
@@ -28,7 +31,4 @@
     return -1
 
-request = context.REQUEST
-form = request.form
-fget = form.get
 student_subobjects = ("StudentApplication",
                       "StudentPersonal",
@@ -82,7 +82,4 @@
 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:
@@ -109,5 +106,11 @@
     if what == "student_id":
         query_step = 1
-        query = Eq('portal_type','Student') & Eq('id', term.strip())
+        if hasattr(students_folder,term.strip()):
+            request.RESPONSE.redirect("%s/%s" % (students_folder.absolute_url(),term))
+        return context.search_students_form(rendered = rend,
+                             psm = "No student found!",
+                             students = [],
+                             allowed = True,
+                             )
     elif what in st_queries:
         if what == "jamb_reg_no":
@@ -124,18 +127,21 @@
             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:
-        pl = r.getPath().split('/')
-        search_set.append(pl[pl.index('students') + 1])
-review_set = []
-if review_res:
-    for r in review_res:
-        pl = r.getPath().split('/')
-        review_set.append(pl[pl.index('students') + 1])
+        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:
+                pl = r.getPath().split('/')
+                search_set.append(pl[pl.index('students') + 1])
+        review_set = []
+        if review_res:
+            for r in review_res:
+                pl = r.getPath().split('/')
+                review_set.append(pl[pl.index('students') + 1])
+    elif what == "department":
+        res = context.students_catalog(department=term.strip())
+        search_set = [r.id for r in res]
 all = []
 if only_review:
@@ -147,5 +153,5 @@
 else:
     all = search_set
-for a in all[:100]:
+for a in all[:1000]:
     if a in items:
         continue
