Index: /WAeUP_SRP/trunk/profiles/default/layouts.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 599)
+++ /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 600)
@@ -3,4 +3,5 @@
  <property name="title"></property>
  <object name="accommodation" meta_type="CPS Layout"/>
+ <object name="academics_search" meta_type="CPS Layout"/>
  <object name="certificate" meta_type="CPS Layout"/>
  <object name="certificate_course" meta_type="CPS Layout"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/academics_search.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/academics_search.xml	(revision 600)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/academics_search.xml	(revision 600)
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<object name="student_search" meta_type="CPS Layout">
+ <property name="layout_create_method"></property>
+ <property name="layout_edit_method"></property>
+ <property name="layout_view_method"></property>
+ <property name="style_prefix">layout_search_</property>
+ <property name="flexible_widgets"/>
+ <property name="validate_values_expr"></property>
+ <widget name="review_state" meta_type="Select Widget">
+  <property name="title">Review State</property>
+  <property name="fields">
+   <element value="review_state"/>
+  </property>
+  <property name="label">Review State</property>
+  <property name="label_edit">Review State</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">searchable_academics_states</property>
+ </widget>
+ <widget name="search_mode" meta_type="Generic Select Widget">
+  <property name="title">Searchmode</property>
+  <property name="fields">
+   <element value="search_mode"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Search for</property>
+  <property name="label_edit">Search for</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">academics_search_mode</property>
+  <property name="render_format">radio</property>
+ </widget>
+ <widget name="search_string" meta_type="String Widget">
+  <property name="title">Searchstring</property>
+  <property name="fields">
+   <element value="search_string"/>
+  </property>
+  <property name="label">Search for</property>
+  <property name="label_edit">Search for</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">30</property>
+ </widget>
+ <table>
+  <row>
+   <cell name="review_state" ncols="2"/>
+  </row>
+  <row>
+   <cell name="search_string"/>
+   <cell name="search_mode"/>
+  </row>
+ </table>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/schemas.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 599)
+++ /WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 600)
@@ -3,4 +3,5 @@
  <property name="title"></property>
  <object name="academics" meta_type="CPS Schema"/>
+ <object name="academics_search" meta_type="CPS Schema"/>
  <object name="accommodation" meta_type="CPS Schema"/>
  <object name="certificate" meta_type="CPS Schema"/>
@@ -24,4 +25,3 @@
  <object name="study_level" meta_type="CPS Schema"/>
  <object name="university" meta_type="CPS Schema"/>
- <object name="members_search" meta_type="CPS Schema"/>
 </object>
Index: /WAeUP_SRP/trunk/profiles/default/schemas/academics_search.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas/academics_search.xml	(revision 600)
+++ /WAeUP_SRP/trunk/profiles/default/schemas/academics_search.xml	(revision 600)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<object name="student_search" meta_type="CPS Schema">
+ <field name="review_state" meta_type="CPS String Field"/>
+ <field name="search_mode" meta_type="CPS String Field"/>
+ <field name="search_string" meta_type="CPS String Field"/>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/vocabularies/academics_search_mode.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/vocabularies/academics_search_mode.xml	(revision 600)
+++ /WAeUP_SRP/trunk/profiles/default/vocabularies/academics_search_mode.xml	(revision 600)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<object name="search_mode_voc" meta_type="CPS Vocabulary">
+ <property name="title"></property>
+ <property name="title_msgid"></property>
+ <property name="description"></property>
+ <property name="acl_write_roles">Manager</property>
+ <item key="course" msgid="">Course</item>
+ <item key="cert_course" msgid="">Certificate Course</item>
+ <item key="department" msgid="">Department</item>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_academics_states.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_academics_states.xml	(revision 600)
+++ /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_academics_states.xml	(revision 600)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<object name="searchable_review_states_voc" meta_type="CPS Vocabulary">
+ <property name="title"></property>
+ <property name="title_msgid"></property>
+ <property name="description"></property>
+ <property name="acl_write_roles">Manager</property>
+ <item key="all" msgid="">All States</item>
+  <item key="created" msgid="">Data Imported</item>
+  <item key="unchecked" msgid="">unchecked</item>
+  <item key="checked" msgid="">checked</item>
+</object>
Index: /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_student_states.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_student_states.xml	(revision 599)
+++ /WAeUP_SRP/trunk/profiles/default/vocabularies/searchable_student_states.xml	(revision 600)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
-<object name="searchable_review_states_voc" meta_type="CPS Vocabulary">
+<object name="searchable_student_states_voc" meta_type="CPS Vocabulary">
  <property name="title"></property>
  <property name="title_msgid"></property>
Index: /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/academics_index.py	(revision 600)
@@ -22,10 +22,6 @@
 campus = context.portal_catalog(meta_type = "University")[-1].getObject()
 member = pm.getAuthenticatedMember()
-roles = member.getRolesInContext(context)
-isManager = "Manager" in roles or "SectionManager" in roles
-isStudent = "Student" in roles
-isStaff = "Staff" in roles
 
-if isStaff or isManager:
+if context.isManager():
     if context.portal_type == 'AcademicsFolder':
         return context.academics.academics_index_view()
@@ -43,5 +39,5 @@
         return context.academics_document_view()
     return redirect("%s/academics_contents" % context.absolute_url())
-if isStudent:
+else:
     return redirect("%s/academics_contents" % context.absolute_url())
 
Index: /WAeUP_SRP/trunk/skins/waeup_academics/academics_search_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/academics_search_view.pt	(revision 600)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/academics_search_view.pt	(revision 600)
@@ -0,0 +1,104 @@
+<metal:html tal:define="rendered options/rendered;
+            portal_status_message options/psm;
+            objects options/objects;
+            is_manager options/is_manager;"
+            >
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:block fill-slot="header"
+                 tal:define="creation creation|nothing;
+                 edition edition|nothing;
+                 metadata metadata|nothing"
+                 >
+    </metal:block>
+    
+    <metal:main fill-slot="main">
+      <span tal:condition="not: is_manager">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+      </span>
+      <span tal:condition="is_manager"
+        tal:define="items objects;
+        columns python:3;
+        items_per_page python:40;
+        max_items python:300;
+        zoom python:0;
+        batches_all python:here.getBatchList(items,columns, items_per_page,zoom,max_items=400);
+        batches python:batches_all[0];
+        batch_info python:batches_all[1];
+        zoomed python:batches_all[2];
+        mq nocall:modules/ZTUtils/make_query;"
+        tal:omit-tag=""
+        >
+        <span tal:replace="structure rendered" />
+        <tal:block tal:condition="python: batch_info and batch_info['nb_pages'] > 1">
+          <div class="batchLayout">
+            <span i18n:translate="">
+              Objects: 
+              <strong>
+                <tal:block replace="batch_info/start"
+                           i18n:name="batch_start" /> - <tal:block replace="batch_info/limit"
+                                                                   i18n:name="batch_limit" />
+              </strong>
+              of <tal:block replace="batch_info/length"
+                            i18n:name="batch_length" />
+            </span>
+          </div>
+          <br />
+        </tal:block>
+        <table class="contentListing" width="100%">
+          <span tal:repeat="rows batches" tal:omit-tag="">
+            <tr tal:repeat="student rows"
+                tal:attributes="class python:test(repeat['student'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <td><a href="id" tal:attributes="href string:${student/student/absolute_url}"
+                     tal:content="student/id"></a></td>    
+              <td>
+                <span tal:replace="python: student['per_doc'].firstname" />
+                <span tal:replace="python: student['per_doc'].middlename" />
+                <span tal:replace="python: student['per_doc'].lastname" />
+              </td>    
+              <td><span tal:replace="python: student['app_doc'].jamb_reg_no" /></td>    
+              <td><span tal:replace="student/review_state" /></td>    
+            </tr>
+          </span>
+        </table>
+        <tal:block condition="python:batch_info and batch_info['nb_pages'] > 1">
+          <div class="pageNavigationLayout">
+            <a tal:define="previous batch_info/previous"
+               tal:condition="python:previous is not None"
+               tal:attributes="href python:'%s?%s'%(request['URL'],
+               mq(request.form, b_start=0))"
+               >
+            (&lt;&lt;)</a>
+            <a tal:define="previous batch_info/previous"
+               tal:condition="python:previous is not None"
+               tal:attributes="href python:'%s?%s'%(request['URL'],
+               mq(request.form, b_start=previous))"
+               i18n:translate="batch_previous">Previous</a>
+            <tal:block repeat="page batch_info/pages">
+              <tal:block condition="python:page != batch_info['start'] - 1">
+                <a tal:attributes="href python:'%s?%s'%(request['URL'],
+                mq(request.form, b_start=page))"
+                tal:content="repeat/page/number">1</a>&nbsp;
+              </tal:block>
+              <tal:block condition="python:page == batch_info['start'] - 1">
+                <span tal:content="string:${repeat/page/number}" />&nbsp;
+              </tal:block>
+            </tal:block>
+            <a tal:define="next batch_info/next"
+               tal:condition="python:next is not None"
+               tal:attributes="href python:'%s?%s'%(request['URL'],
+               mq(request.form, b_start=next))"
+               i18n:translate="batch_next">Next</a>
+            <a tal:define="next batch_info/next;
+            last_page python:batch_info['pages'][-1]"
+            tal:condition="python:next is not None"
+            tal:attributes="href python:'%s?%s'%(request['URL'],
+            mq(request.form, b_start=last_page))"
+            >
+            (&gt;&gt;)</a>
+          </div>
+        </tal:block>
+      </span>
+    </metal:main>
+  </metal:body>
+</metal:html>
+  
Index: /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_view.pt	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/faculty_index_view.pt	(revision 600)
@@ -39,9 +39,5 @@
 
             <td> 
-<<<<<<< .mine
             <a tal:condition="row/is_editable"
-=======
-            <a tal:condition="row/is_edit_allowed"
->>>>>>> .r597
                 href="edit" tal:attributes="href string:${row/url}/external_edit_form"
                 target="edit"
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCertificateInfo.py	(revision 600)
@@ -22,6 +22,6 @@
 member_id = str(member)
 roles = member.getRoles()
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles 
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
 info['action'] = "%s" % context.campus.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesCertificatesInfo.py	(revision 600)
@@ -22,6 +22,6 @@
 member_id = str(member)
 roles = member.getRoles()
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles 
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
 info['action'] = "%s/faculty_index_view" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py	(revision 600)
@@ -24,6 +24,6 @@
 dep_id = context.aq_parent.getId()
 roles = member.getRoles()
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles 
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
 info['action'] = "%s" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsInfo.py	(revision 600)
@@ -22,6 +22,6 @@
 member_id = str(member)
 roles = member.getRolesInContext(context)
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
 info['action'] = "%s" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getFacultiesInfo.py	(revision 600)
@@ -22,6 +22,6 @@
 member_id = str(member)
 roles = member.getRoles()
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles 
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent() 
 info['action'] = "%s" % context.campus.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py	(revision 599)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/getLevelInfo.py	(revision 600)
@@ -31,6 +31,6 @@
 level_id = pt[-(1+p)]
 roles = member.getRoles()
-info['is_manager'] = 'Manager' in roles or 'SectionManager' in roles
-info['is_student'] = 'Student' in roles 
+info['is_manager'] = context.isManager()
+info['is_student'] = context.isStudent()
 info['action'] = "%s" % context.absolute_url()
 info['choosen_ids'] = request.get('ids',[])
Index: /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py	(revision 600)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/searchAcademics.py	(revision 600)
@@ -0,0 +1,96 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return Info about the current Student
+"""
+request = context.REQUEST
+form = request.form
+fget = form.get
+info = {}
+wf = context.portal_workflow
+catalog = context.portal_catalog
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+lt = context.portal_layouts
+pr = context.portal_registration
+path_info = request.get('PATH_INFO').split('/')
+roles = member.getRoles()
+is_manager = 'Manager' in roles or 'SectionManager' in roles
+validate = request.has_key("cpsdocument_edit_button")
+items = []
+default = {'search_mode': 'course', 
+        'review_state': 'unchecked', 
+        'search_string': ''
+        }
+        
+rend,psm,ds = lt.renderLayout(layout_id= 'academics_search',
+                      schema_id= 'academics_search',
+                      context=context,
+                      mapping=validate and request,
+                      ob=default,
+                      layout_mode='edit',
+                      formaction="searchAcademics"
+                      )
+if psm == '':
+    return context.academics_search_view(rendered = rend,
+                             psm = psm,
+                             #psm = "%s, %s" % (psm,ds),
+                             objects = items,
+                             is_manager = is_manager,
+                             )
+what = ds.get('search_mode')
+state = ds.get('review_state')
+term = ds.get('search_string')
+if state == " ----- ":
+    state = ''
+if not term and what in ('student_edit','jamb_id','name','matric_no'):
+    return context.academics_search_view(rendered = rend,
+                             psm = "You must specify a search string",
+                             #psm = "%s, %s" % (psm,ds),
+                             objects = items,
+                             is_manager = is_manager,
+                             )
+onlyreview = state and what == "review_state"
+items = []
+res = []
+portal_type_query = {'query':['Department','Course','CertificateCourse']}
+if onlyreview:
+    res = catalog(portal_type=portal_type_query,
+                  review_state=state)
+elif what == "student_id":
+    res = catalog(portal_type='Student',
+                  id = term.strip())
+elif what == "jamb_id":
+    res = catalog(portal_type='StudentApplication',
+                  SearchableText="%s*" % term.strip().lower())
+elif what == "matric_no":
+    res = catalog(portal_type='StudentClearance',
+                  SearchableText="%s*" % term.strip().lower())
+elif what == "name":
+    res = catalog(portal_type=portal_type_query,
+                  SearchableText="%s*" % term.strip())
+if res:
+    for r in res:
+        row = {}
+        if r.portal_type in ("StudentApplication","StudentPersonal"):
+            items.append(r.getObject().aq_parent)
+        else:
+            items.append(r.getObject())
+objects = []
+if items:
+    for item in items:
+        objects.append(context.getStudentInfo(item))
+return context.academics_search_view(rendered = rend,
+                             psm = "%d matching objects found" % len(items),
+                             #psm = "%s, %s" % (psm,ds),
+                             objects = objects,
+                             is_manager = is_manager,
+                             )
Index: /WAeUP_SRP/trunk/skins/waeup_default/isManager.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isManager.py	(revision 600)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isManager.py	(revision 600)
@@ -0,0 +1,24 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return True if the member is considered a Manager in this context
+"""
+request = context.REQUEST
+
+wf = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+path_info = request.get('PATH_INFO').split('/')
+roles = member.getRolesInContext(context)
+isStudent = "Student" in roles
+isStaff = not isStudent
+isManager = "Manager" in roles or "SectionManager" in roles or isStaff
+return isManager
Index: /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 600)
+++ /WAeUP_SRP/trunk/skins/waeup_default/isStudent.py	(revision 600)
@@ -0,0 +1,24 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student=None
+##title=
+##
+# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return True if the member is considered a Student in this context
+"""
+request = context.REQUEST
+
+wf = context.portal_workflow
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+path_info = request.get('PATH_INFO').split('/')
+roles = member.getRolesInContext(context)
+isStudent = "Student" in roles
+isStaff = not isStudent
+isManager = "Manager" in roles or "SectionManager" in roles or isStaff
+return isStudent
