Index: /WAeUP_SRP/base/skins/waeup_default/srp_view.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_default/srp_view.pt	(revision 3610)
+++ /WAeUP_SRP/base/skins/waeup_default/srp_view.pt	(revision 3611)
@@ -8,5 +8,7 @@
       </span>     
     
-      <span tal:condition="python: not getattr(context.campus.documents,'srp_home_doc',None)">
+      <span tal:condition="python: not getattr(context.campus.documents,'srp_home_doc',None)"
+            tal:define="groups python: context.portal_membership.getAuthenticatedMember().getGroups()"
+            >
       
         <h2>Welcome to the     
@@ -16,7 +18,33 @@
           <br /><br />
           
-          <span tal:define="ca_view python: 'CourseAdvisers' in context.portal_membership.getAuthenticatedMember().getGroups()"
-                tal:condition="ca_view">The first-time access to the students section (Students tab above) my take some time. Your local roles are being determined.</span>  
+          <span tal:condition="python: 'CourseAdvisers' in groups">
+                The first-time access to the students section (Students tab above) my take some time. Your local roles are being determined.
+          </span>
+
+          <div tal:condition="python: 'Lecturers' in groups"
+                tal:define="info context/getLecturerCoursesInfo">
           
+                You are registered lecturer of the following courses: <br /><br />
+                
+
+          <table>
+            <tr>
+            <th align='center'>Code</th> 
+            <th align='center'>Title</th>
+            <th align='center'>Semester</th>
+            <th align='center'></th>
+            </tr>          
+            <tr tal:repeat="row info/courses"
+                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <td align="center" width="50pt"> <a href="" tal:attributes="href row/course_url"><span tal:content="row/id" /></a></td>     
+              <td width="400pt" tal:content="row/title"></td>
+              <td align="center" width="20pt"><span tal:content="row/semester" /></td>      
+              <td> <a href="" tal:attributes="href row/list_url">[list students] </a></td>
+            </tr>
+          </table>                
+                
+                
+          
+          </div>
        </span>
        
Index: /WAeUP_SRP/base/skins/waeup_design/index_html.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_design/index_html.py	(revision 3610)
+++ /WAeUP_SRP/base/skins/waeup_design/index_html.py	(revision 3611)
@@ -19,7 +19,10 @@
 if pm.isAnonymousUser():
     return redirect("%s/srp_anonymous_view" % request.get('URL1'))
+#    return redirect("http://uniben.edu/index.php")
+
 elif context.isStudent():
     return redirect("%s/srp_anonymous_view" % context.absolute_url())
 else:
-	return redirect("%s/srp_view" % context.absolute_url())
+    return redirect("%s/srp_view" % context.absolute_url())
 
+
Index: /WAeUP_SRP/base/skins/waeup_student/getLecturerCourseResults.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_student/getLecturerCourseResults.py	(revision 3611)
+++ /WAeUP_SRP/base/skins/waeup_student/getLecturerCourseResults.py	(revision 3611)
@@ -0,0 +1,59 @@
+## Script (Python) "getLecturerCourseResultsInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=course_id
+##title=
+##
+# $Id: getCoursesInfo.py 3482 2008-05-01 05:54:53Z henrik $
+"""
+return Info about the Courses
+"""
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+lec_id = member_id = str(member)
+if mtool.isAnonymousUser():
+    return None
+
+
+request = context.REQUEST
+
+path_info = request.get('PATH_INFO').split('/')
+
+info = {}
+info['lec_id'] = lec_id
+info['course_id'] = course_id
+
+res = context.course_results(code=course_id)
+items = [ brain for brain in res]
+rows = []
+for r in items:
+    row = {}
+    if r['carry_over']:
+        row['carry_over'] =  'CO'
+    else:
+        row['carry_over'] =  ''
+    row['credits'] =  r['credits']
+    row['session_id'] =  r['session_id']
+    row['level_id'] =  level_id = r['level_id']
+    row['score'] =  r['score']
+    row['student_id'] = student_id = r['student_id']
+    
+    student_record = context.students_catalog.getRecordByKey(student_id)
+    row['student_record'] = context.getFormattedStudentEntry(student_record)
+    row['url'] = "%s/campus/students/%s/study_course/%s" % (context.portal_url(),student_id,level_id)
+    
+    row['editable'] = not r['score'] and  row['student_record']['review_state'] == 'courses_validated'
+    row['sort_dummy'] = row['student_record']['review_state']
+    rows.append(row)
+    
+rows.sort(cmp=lambda x,y: cmp("%(session_id)s%(sort_dummy)s" % x,
+                              "%(session_id)s%(sort_dummy)s" % y))    
+info['students'] = rows
+
+return context.lecturer_students_list(info = info,)
+
+#return info
Index: /WAeUP_SRP/base/skins/waeup_student/getLecturerCoursesInfo.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_student/getLecturerCoursesInfo.py	(revision 3611)
+++ /WAeUP_SRP/base/skins/waeup_student/getLecturerCoursesInfo.py	(revision 3611)
@@ -0,0 +1,58 @@
+## Script (Python) "getLecturerCoursesInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: getCoursesInfo.py 3482 2008-05-01 05:54:53Z henrik $
+"""
+return Info about the Courses
+"""
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+lec_id = member_id = str(member)
+if mtool.isAnonymousUser():
+    return None
+
+
+def cmpsemester(a,b):
+    if a.semester == b.semester:
+        return 0
+    if a.semester > b.semester:
+        return 1
+    return -1
+
+request = context.REQUEST
+
+path_info = request.get('PATH_INFO').split('/')
+
+
+info = {}
+info['lec_id'] = lec_id
+
+res = context.courses_catalog(lecturer=lec_id)
+items = [ brain for brain in res]
+items.sort(cmpsemester)
+rows = []
+for r in items:
+    row = {}
+    code = getattr(r,'code',None)
+    if code is None:
+        continue
+    #ro = getattr(context,code)
+    row['id'] = code
+    row['title'] = r['title']
+    row['semester'] = r['semester']
+    row['course_url'] = "%s/campus/academics/%s/%s/courses/%s" % (context.portal_url(),r['faculty'],r['department'],code)
+    row['list_url'] = "%s/getLecturerCourseResults?course_id=%s" % (context.portal_url(),code)
+    #row['review_state'] = wf.getInfoFor(ro,'review_state','None')
+    #row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
+    rows.append(row)
+rows.sort(cmp=lambda x,y: cmp("%(semester)s%(id)s" % x,
+                              "%(semester)s%(id)s" % y))
+info['courses'] = rows
+return info
Index: /WAeUP_SRP/base/skins/waeup_student/lecturer_course_edit.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_student/lecturer_course_edit.py	(revision 3611)
+++ /WAeUP_SRP/base/skins/waeup_student/lecturer_course_edit.py	(revision 3611)
@@ -0,0 +1,84 @@
+## Script (Python) "lecturer_course_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST, cpsdocument_edit_button=None, cpsdocument_edit_and_view_button=None, action=None
+##title=
+# $Id: course_edit.py 1071 2006-12-16 15:53:13Z joachim $
+"""
+This method is for demonstration purposes only. 
+There is noi security to deter lecturers from editing courses they are not allowed to edit.
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+from urllib import urlencode
+from Products.CPSDocument.utils import getFormUidUrlArg
+from Products.AdvancedQuery import Eq, Between, Le,In
+import DateTime
+current = DateTime.DateTime()
+import logging
+logger = logging.getLogger('Skins.course_edit')
+wf = context.portal_workflow
+request = REQUEST
+edit = "edit" in request.form.keys()
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+groups = member.getGroups()
+
+member_id = str(member)
+requested_id = context.getStudentId()
+if not 'Lecturers' in groups:
+    logger.info('%s tried to access course result of %s' % (member_id,requested_id))
+    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+
+student_id = requested_id
+
+level_id = context.getId()
+course_id = traverse_subpath[0]
+query = Eq('student_id',student_id) &\
+        Eq('level_id', level_id) &\
+        Eq('code', course_id)
+
+course_results = context.course_results.evalAdvancedQuery(query)
+mode = 'edit'
+object = {}
+course = course_results[0]
+for field in context.course_results.schema():
+    object[field] = getattr(course,field)
+lt = context.portal_layouts
+res,psm, ds = lt.renderLayout(schema_id = 'student_course_result',
+                               layout_id = 'student_course_result',
+                               layout_mode = mode,
+                               context=context,
+                               mapping=edit and REQUEST,
+                               ob=object,
+                               commit = False)
+
+while True:
+    if psm == 'invalid':
+        psm = "Please correct your input"
+        break
+    elif psm == '':
+        break
+    if edit:
+        data = {}
+        dm = ds.getDataModel()
+        for field in context.course_results.schema():
+            if dm.has_key("%s" % field):
+                data[field] = dm.get(field)
+        data['key'] = object['key']
+        context.course_results.modifyRecord(**data)
+        logger.info('%s edited course result data %s' % (student_id, course_id))
+        psm = 'psm_content_changed'
+        break
+
+return context.course_edit_form(rendered = res,
+                                psm = psm,
+                                mode = mode,
+                                ds = ds,
+                               )
Index: /WAeUP_SRP/base/skins/waeup_student/lecturer_students_list.pt
===================================================================
--- /WAeUP_SRP/base/skins/waeup_student/lecturer_students_list.pt	(revision 3611)
+++ /WAeUP_SRP/base/skins/waeup_student/lecturer_students_list.pt	(revision 3611)
@@ -0,0 +1,42 @@
+<metal:body use-macro="here/main_template/macros/master">
+  <metal:main fill-slot="main"
+              tal:define="info options/info;
+                          students info/students;">
+      <h3>Registered Students of Course <span tal:replace="info/course_id"/></h3><br />
+      <span tal:condition="students">
+        <span tal:define="items students">
+          <table class="contentListing" width="100%">
+
+             <span tal:repeat="student students">
+                <tr tal:condition="student" 
+                    tal:attributes="class python:test(repeat['student'].even(), 'even ajaxtd', 'odd ajaxtd')">
+                  <td><a href="id" tal:attributes="href string:${context/portal_url}/campus/students/${student/student_id}"
+                         tal:content="student/student_id"></a></td>    
+                  <td>
+                    <span tal:replace="student/student_record/name" />
+                  </td>                            
+                  <td><span tal:replace="student/student_record/matric_no" /></td>   
+                  <td><span tal:replace="student/student_record/session" /></td>
+                  <td><span tal:replace="student/student_record/level" /></td>
+                  <td><span tal:replace="student/student_record/review_state" /></td>
+                  <td><span tal:replace="student/session_id" /></td>
+                  <td><span tal:replace="student/level_id" /></td>
+                  <td><span tal:replace="student/carry_over" /></td>
+                  <td><span tal:replace="student/score" /></td>
+                  
+                  <td tal:condition="student/editable">
+                    <a href="edit" tal:attributes="href string:${student/url}/lecturer_course_edit/${info/course_id}"
+                    target="edit_course_result"
+                    onclick="javascript:window.open('','edit_course_result','width=600, height=350, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')">
+                    [edit]
+                    </a> 
+                  </td>                   
+                  
+                  
+                </tr>
+            </span>
+          </table>
+        </span>
+      </span>
+  </metal:main>
+</metal:body>
Index: /WAeUP_SRP/uniben/profiles/default/course_results.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/course_results.xml	(revision 3610)
+++ /WAeUP_SRP/uniben/profiles/default/course_results.xml	(revision 3611)
@@ -12,4 +12,5 @@
  <column value="score"/>
  <column value="grade"/>
+ <column value="lecturer"/>
  <index name="key" meta_type="FieldIndex">
   <indexed_attr value="key"/>
@@ -18,4 +19,7 @@
   <indexed_attr value="code"/>
  </index>
+ <index name="lecturer" meta_type="FieldIndex">
+  <indexed_attr value="lecturer"/>
+ </index>  
  <index name="student_id" meta_type="FieldIndex">
   <indexed_attr value="student_id"/>
Index: /WAeUP_SRP/uniben/profiles/default/courses_catalog.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/courses_catalog.xml	(revision 3610)
+++ /WAeUP_SRP/uniben/profiles/default/courses_catalog.xml	(revision 3611)
@@ -3,4 +3,5 @@
 <object name="courses_catalog" meta_type="WAeUP Table">
  <column value="code"/>
+ <column value="lecturer"/>
  <column value="faculty"/>
  <column value="department"/>
@@ -12,4 +13,7 @@
   <indexed_attr value="code"/>
  </index>
+ <index name="lecturer" meta_type="FieldIndex">
+  <indexed_attr value="lecturer"/>
+ </index> 
  <index name="faculty" meta_type="FieldIndex">
   <indexed_attr value="faculty"/>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/course.xml	(revision 3610)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/course.xml	(revision 3611)
@@ -23,4 +23,17 @@
  <property name="display_width">8</property>
 </widget>
+
+ <widget name="lecturer" meta_type="String Widget">
+  <property name="title">Lecturer Id</property>
+  <property name="fields">
+   <element value="lecturer"/>
+  </property>
+  <property name="label">Lecturer Id</property>
+  <property name="label_edit">Lecturer Id</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+
   <widget name="adm_status" meta_type="String Widget">
   <property name="title">Adm Status</property>
@@ -118,4 +131,7 @@
   </row>
   <row>
+   <cell name="lecturer"/>
+  </row>  
+  <row>
    <cell name="title"/>
   </row>
Index: /WAeUP_SRP/uniben/profiles/default/layouts/student_course_result.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/layouts/student_course_result.xml	(revision 3610)
+++ /WAeUP_SRP/uniben/profiles/default/layouts/student_course_result.xml	(revision 3611)
@@ -38,10 +38,10 @@
  </widget>
  <widget name="credits" meta_type="Int Widget">
-  <property name="title">Credits (original value)</property>
+  <property name="title">Credits</property>
   <property name="fields">
    <element value="credits"/>
   </property>
-  <property name="label">Credits (original value)</property>
-  <property name="label_edit">Credits (original value)</property>
+  <property name="label">Credits</property>
+  <property name="label_edit">Credits</property>
   <property name="readonly_layout_modes">
    <element value="edit"/>
@@ -54,10 +54,10 @@
  </widget>
  <widget name="passmark" meta_type="Int Widget">
-  <property name="title">Passmark (original value)</property>
+  <property name="title">Passmark</property>
   <property name="fields">
    <element value="passmark"/>
   </property>
-  <property name="label">Passmark (original value)</property>
-  <property name="label_edit">Passmark (original value)</property>
+  <property name="label">Passmark</property>
+  <property name="label_edit">Passmark</property>
   <property name="readonly_layout_modes">
    <element value="edit"/>
@@ -103,13 +103,4 @@
   </row>
   <row>
-   <cell name="title"/>
-  </row>
-  <row>
-   <cell name="credits"/>
-  </row>
-  <row>
-   <cell name="passmark"/>
-  </row>
-  <row>
    <cell name="score"/>
   </row>
Index: /WAeUP_SRP/uniben/profiles/default/schemas/course.xml
===================================================================
--- /WAeUP_SRP/uniben/profiles/default/schemas/course.xml	(revision 3610)
+++ /WAeUP_SRP/uniben/profiles/default/schemas/course.xml	(revision 3611)
@@ -6,4 +6,5 @@
  <field name="title" meta_type="CPS String Field"/>
  <field name="code" meta_type="CPS String Field"/>
+ <field name="lecturer" meta_type="CPS String Field"/>
  <field name="credits" meta_type="CPS Int Field"/>
  <field name="former_code" meta_type="CPS String Field"/>
Index: eUP_SRP/uniben/waeup_custom/srp_anonymous_view.pt
===================================================================
--- /WAeUP_SRP/uniben/waeup_custom/srp_anonymous_view.pt	(revision 3610)
+++ 	(revision )
@@ -1,103 +1,0 @@
-<metal:html>
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
-
-      <span tal:condition="python: getattr(context.campus.documents,'frontpage_doc',None)">
-          <div tal:define="doc python: context.campus.documents.frontpage_doc.getContent()"
-               tal:content="structure python:doc.wdrender()" />
-      </span> 
-
-      <span tal:condition="python: not getattr(context.campus.documents,'frontpage_doc',None)">
-
-      <h2>Welcome to the     
-      <br />New Student Registration Portal of the University of Benin, Nigeria</h2>
-             
-      <strong>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part 
-                 of the West African e-University Project
-                 (<a href="" tal:attributes="href string:http://waeup.org">WAeUP</a>).</strong>
-      
-      <br /><br />
-      
-      <h2>Admission into Local/Part-Time Programmes 2006/2007</h2>
-      
-      <p><strong>INSTRUCTIONS FOR CHECKING SCREENING 
-                 TEST RESULTS AND ADMISSIONS</strong></p>
-      <br />
-      <ol>
-      <li>Click on 'View CEST Results' (CEST means Common Entrance Screening Test),</li> 
-      <li>enter your Application Number (No Scratch Card is required for this!),</li> 
-      <li>press the "Search" button, </li> 
-      <li>print your Result Slip.</li>
-      
-      <li>If you are admitted or if you are a <strong>Diploma or Non-Exam Programme</strong> applicant, purchase a N250-Admission-Checking and a 
-      N10500-Clearance Scratch Card from any of the following designated banks in Benin City:
-      
-      <br /><br />
-      UBA Plc, Uselu-Ugbowo Rd <br />
-      First Bank Plc, Ugbowo <br />
-      Unity Bank, Uniben <br />
-      Intercontinental Bank, Uniben <br />
-      Wema Bank, Akpakpava Road <br />
-      Zenith Bank Uselu <br /><br />
-      </li>
-      
-      <li>Click "Check Admission",</li> 
-      <li>enter your Registration Number and your Admission Checking PIN (prefix APP),</li> 
-      <li>press the "Check" button,</li> 
-      <li>print your Admission Slip,</li> 
-      <li>buy your Clearance Scratch Card,</li> 
-      <li>log in with your new Student Id (see Admission Slip)
-          and your Password (last 10 digits of your Admission Checking PIN),</li> 
-      <li>press the "Continue" button,</li> 
-      <li>check your email address and phone number,</li> 
-      <li>press the "Save & Continue" button,</li> 
-      <li>enter your Clearance PIN (prefix CLR) and</li> 
-      <li>press the "Start" button.</li> 
-      </ol>
-      <br />       
-      
-      
-      <p><strong>Notice:</strong> Clearance and Orientation for Part-Time and Diploma Students commences on 
-         resumption and ends exactly on <strong><font color="red">1st June 2007</font></strong>. 
-         Part-Time and Diploma Students must fill their 
-         Clearance/Elegibility forms online before 1st June.
-         Any breach of this directive, will result in forfeiture of the adminssion offer. 
-      </p>            
-      
-      <h2>Returning Students</h2>         
-      
-      
-      <ol>
-      <li> Simply click "Return 2006/2007", </li> 
-      <li> enter your Matriculation Number and either your firstname, middlename or lastname,</li> 
-      <li> press the "Search" button,</li> 
-      <li> press the "Continue to Login" button, </li> 
-      <li> check if you are the person indicated on the access data form,</li> 
-      <li> enter your email address and phone number,</li> 
-      <li> choose and verify your password (minimum size 5 characters including 1 digit),</li>
-      <li> tick the acknowledgement check box,</li>           
-      <li> press the "Save & First-time Login" button,</li> 
-      <li> print your Sessional Result Slip (it includes your new Student Id for further logins), </li> 
-      <li> edit your personal data record,</li> 
-      <li> book your accommodation,</li> 
-      <li> pay your school fee,</li>
-      <li> register your courses.</li>          
-      </ol>
-      
-      <br />
-      <p>If you have to register for <strong>previous sessions</strong> or are a 
-      <strong>temporary withdrawn</strong> student, click "Previous Sessions" 
-      instead of "Return 2006/2007".</p> 
-      
-      <p><strong>Notice:</strong> Full Time Students are expected to register their 
-      courses online on or before <strong><font color="red">6th June 2007</font></strong>.
-            
-            
-      </span>       
-      
-    </metal:main>
-  </metal:body>
-</metal:html>
-
-
-
Index: eUP_SRP/uniben/waeup_custom/srp_view.pt
===================================================================
--- /WAeUP_SRP/uniben/waeup_custom/srp_view.pt	(revision 3610)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<metal:html>
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
-    
-      <span tal:condition="python: getattr(context.campus.documents,'srp_home_doc',None)">
-          <div tal:define="doc python: context.campus.documents.srp_home_doc.getContent()"
-               tal:content="structure python:doc.wdrender()" />
-      </span>     
-    
-      <span tal:condition="python: not getattr(context.campus.documents,'srp_home_doc',None)">
-      
-        <h2>Welcome to the     
-          <br />Student Registration Portal of the University of Benin, Nigeria</h2>
-          <br />
-          You are logged in and viewing the portal's root folder. Please go to one of the sections above.   
-          <br /><br />
-          
-          <span tal:define="ca_view python: 'CourseAdvisers' in context.portal_membership.getAuthenticatedMember().getGroups()"
-                tal:condition="ca_view">The first-time access to the students section (Students tab above) my take some time. Your local roles are being determined.</span>  
-          
-       </span>
-       
-    </metal:main>
-  </metal:body>
-</metal:html>
