Index: WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1178)
+++ WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1179)
@@ -25,6 +25,6 @@
    <element value="secret"/>
   </property>
-  <property name="label">Enter Your Firstname,Middlename or Lastname</property>
-  <property name="label_edit">Enter Your Firstname,Middlename or Lastname</property>
+  <property name="label">Firstname, Middlename or Lastname</property>
+  <property name="label_edit">Enter either your  Firstname, Middlename or Lastname</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes">
Index: WAeUP_SRP/trunk/skins/waeup_default/srp_anonymous_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/srp_anonymous_view.pt	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_default/srp_anonymous_view.pt	(revision 1179)
@@ -5,8 +5,43 @@
           <br />New Student Registration Portal of the University of Benin, Nigeria</h2>
         <br />
-        <p>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part 
+        <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>).
-           At present, fresh students can view their 2006 PUME/PDE results and admission status (free of charge):</p>
+           (<a href="" tal:attributes="href string:http://waeup.org">WAeUP</a>).</strong>
+         
+          <br />  <br />     
+         
+          <h3>Returning Students</h3>         
+          
+          <p>can view their 2006 session results, log into the portal, update their personal data and book accommodation on campus:</p>
+          
+          <br />
+          <ul>
+          <li> Simply click "View Sess. Results", </li> 
+          <li> enter your Matriculation Number and either your firstname, middlename or lastname</li> 
+          <li> press the "Search" button. </li> 
+          </ul>
+          <br />
+          <p>Your 2006 session results will be shown. Please check the data. 
+             Then proceed to create your member and student records .</p>
+          
+          <br />
+          <ul>
+          <li> Press the "Continue to Login" button, </li> 
+          <li> check if you are the designated person on the access data form,</li> 
+          <li> enter your email address and phone number,</li> 
+          <li> choose and verify your password (minimum size 5, at least 1 digit),</li>
+          <li> tick the acknowledgement check box,</li>           
+          <li> press the "Save & First-time Login" button. </li> 
+          </ul>
+          <br />
+          
+          
+          
+          
+          <hr>
+          
+          <h3>New Students</h3>
+
+          <p>can view their 2006 PUME/PDE results and admission status (free of charge):</p>
           <br />
           <ul>
@@ -50,5 +85,5 @@
           <strong><a target="_blank" href="http://files.saoas.org/Procedure_for_clearance.pdf">UME</a></strong>,
           <strong><a target="_blank" href="http://files.saoas.org/Procedure_for_clearance_Direct.pdf">DE</a></strong> (1 page).
-          After clearance you are eligible for booking your accommodation on campus.
+          After being cleared you are eligible for booking your accommodation on campus.
           </p>
           <br />
Index: WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/getAccommodationInfo.py	(revision 1179)
@@ -65,12 +65,12 @@
 review_state = info['review_state'] = wf.getInfoFor(student,'review_state',None)
 booking_allowed = False
-if not review_state not in ('cleared_and_validated',):
+if review_state in ('returning','school_fee_paid','courses_registered', 'courses_validated',):
     res = context.results_import(matric_no = s_brain.matric_no)
     if res:
         booking_allowed = res[0].Verdict in ("SUCCESSFUL STUDENT",
                                              "STUDENT WITH CARRYOVER COURSES",)
-else:
+elif review_state in ('cleared_and_validated',):
     booking_allowed = True
-info['booking_allowed'] = booking_allowed    
+info['booking_allowed'] = booking_allowed
 if not booking_allowed:
     return info
@@ -102,5 +102,5 @@
 elif s_brain.course in pti_certificates:
     bt += "_pti"
-elif s_brain.faculty in ('MED') and int(s_brain.level) >= 400:
+elif s_brain.faculty in ('MED') and int(s_brain.level) >= 500:
     bt += "_med"
 
Index: WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py	(revision 1179)
@@ -58,4 +58,6 @@
 with_courses_cat = hasattr(context,'courses_catalog')
 fields = context.results_import.schema()
+gpa = 0
+course_count = 0
 for r in results:
     result = {}
@@ -66,12 +68,30 @@
     if with_courses_cat and res:
         result['title'] = res[0].title
+        result['credits'] = res[0].credits
+        try:
+            weight = int(result['WEIGHT'])
+            credits = int(res[0].credits)
+            gpa_course =  int(res[0].credits) * weight
+            gpa += gpa_course
+            course_count += credits
+            result['gpa'] = 'ok'
+        except:
+            result['gpa'] = 'na'
     else:
-        result['title'] = "To Be Determined"
+        result['title'] = "na"
+        result['credits'] = "na"
+        result['gpa'] = 'na'
     if r.Semester == '2':
         sem2.append(result)
     else:
         sem1.append(result)
+
+if course_count:
+    gpa = float(gpa) / course_count
+    gpa = "%4.2f" % gpa
+info['gpa'] = gpa
 info['results'] = (sem1, sem2)
 info['student'] = student
 info['s_id'] = student_id
 return info
+
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py	(revision 1179)
@@ -68,6 +68,6 @@
 info['url'] = student.absolute_url()
 info['student_doc'] = student.getContent()
-#info['app'] = student.application
-#info['app_doc'] = student.application.getContent()
+info['app'] = student.application
+info['app_doc'] = student.application.getContent()
 #info['per'] = getattr(student,'personal',None)
 #info['sex'] = 'male'
@@ -149,8 +149,21 @@
         row['s_edit_link'] = "%s/%s" % (soo.absolute_url(),se_link)
     row['review_state'] = so.review_state
-    row['display'] = so.review_state in ('opened','closed','bed_reserved','maintenance_fee_paid',) and so.portal_type != 'StudentPume' or so.portal_type == 'StudentStudyCourse'
+    if info['review_state'] in ('returning',
+                                'school_fee_pin_entered',
+                                'courses_registered',
+                                'courses_validated',):
+          row['display'] = so.review_state in ('opened',
+                                               'bed_reserved',
+                                               'maintenance_fee_paid',) or so.portal_type == 'StudentStudyCourse'
+    else:
+          row['display'] = so.review_state in ('opened',
+                                               'closed',
+                                               'bed_reserved',
+                                               'maintenance_fee_paid',) and\
+                           so.portal_type not in ('StudentPume',) or\
+                           so.portal_type == 'StudentStudyCourse'
+    
     items.append(row)
 info['items'] = items
-
 request.set('student_id',student_id)
 request.set('student_url',info['url'])
Index: WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1179)
@@ -55,11 +55,13 @@
       <div tal:condition="registered">
         <span tal:condition="python: registered == 'no_student_object'">
-          Your Datafiles have not yet been created, please check again later.
+          Your student and member record have not yet been created, please check again later.
         </span>
+        <font color="red">
         <span tal:condition="python: registered != 'no_student_object'">
-          You have already set your Password, please 
+          You have already set your password, please 
           <a href="" tal:attributes="href string:${context/portal_url}/login_student">login</a> 
-          with your UserId <span tal:replace="registered" />
+          with your Student Id <span tal:replace="registered" />.
         </span>
+        </font>
       </div>
       <form tal:condition="not: registered" action="" method="post"
Index: WAeUP_SRP/trunk/skins/waeup_student/session_results_slip.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/session_results_slip.pt	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/session_results_slip.pt	(revision 1179)
@@ -29,5 +29,5 @@
         </tr>
         <tr>
-          <th>Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
+          <th valign="top">Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
         </tr>
         <tr>
@@ -38,9 +38,12 @@
        <table>
           <tr>
-            <th width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" /> 
+            <th valign="top" width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" /> 
           </tr>
           <tr>  
             <th>Session:</th><td tal:content="python:info['results'][0][0]['Session']" /> 
-          </tr>        
+          </tr>
+          <tr>  
+            <th valign="top">GPA:</th><td> <span tal:content="info/gpa" /> (on the basis if the data below)  </td> 
+          </tr>                    
        </table>
 
@@ -51,14 +54,21 @@
             <span tal:repeat="result semester">
              <tr tal:condition="repeat/result/start">
-              <th colspan="5">
-                <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
-              </th>
-             </tr>
+                <th colspan="2">
+                   <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
+                </th>
+                <td>Grade</td>
+                <td>Weight</td>
+                <td>Credits</td>
+             </tr>             
             <tr>     
-            <td width="80px" tal:content="result/CosCode" />
-            <td tal:content="result/title" />
-            <td width="50px" align="center" tal:content="result/GRADE" />
+            <td valign="top" width="80px" tal:content="result/CosCode" />
+            <td valign="top" tal:content="result/title" />
+            <td valign="top" width="50px" align="center" tal:content="result/GRADE" />
+            <td valign="top" width="50px" align="center" tal:content="result/WEIGHT" />
+            <td valign="top" width="50px" align="center" tal:content="result/credits" />
+
           </tr>
         </span>
+        <tr><td colspan="5">&nbsp;</td></tr>
         </span>
       </table>
Index: WAeUP_SRP/trunk/skins/waeup_student/session_results_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/session_results_view.pt	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/session_results_view.pt	(revision 1179)
@@ -29,5 +29,5 @@
         </tr>
         <tr>
-          <th>Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
+          <th valign="top">Course of Study:</th><td tal:content="info/student/Coursemajor" />                     
         </tr>
         <tr>
@@ -38,9 +38,12 @@
        <table>
           <tr>
-            <th width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" /> 
+            <th valign="top" width="180px">Verdict:</th><td tal:content="python:info['results'][0][0]['Verdict']" /> 
           </tr>
           <tr>  
             <th>Session:</th><td tal:content="python:info['results'][0][0]['Session']" /> 
-          </tr>        
+          </tr>
+          <tr>  
+            <th valign="top">GPA:</th><td> <span tal:content="info/gpa" /> (on the basis if the data below)  </td> 
+          </tr>                    
        </table>
 
@@ -51,14 +54,21 @@
             <span tal:repeat="result semester">
              <tr tal:condition="repeat/result/start">
-              <th colspan="5">
-                <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
-              </th>
-             </tr>
+                <th colspan="2">
+                   <span tal:replace="python: test(repeat['semester'].index,'Second','First')" /> Semester
+                </th>
+                <td>Grade</td>
+                <td>Weight</td>
+                <td>Credits</td>
+             </tr>             
             <tr>     
-            <td width="80px" tal:content="result/CosCode" />
-            <td tal:content="result/title" />
-            <td width="50px" align="center" tal:content="result/GRADE" />
+            <td valign="top" width="80px" tal:content="result/CosCode" />
+            <td valign="top" tal:content="result/title" />
+            <td valign="top" width="50px" align="center" tal:content="result/GRADE" />
+            <td valign="top" width="50px" align="center" tal:content="result/WEIGHT" />
+            <td valign="top" width="50px" align="center" tal:content="result/credits" />
+
           </tr>
         </span>
+        <tr><td colspan="5">&nbsp;</td></tr>
         </span>
       </table>
Index: WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1178)
+++ WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1179)
@@ -0,0 +1,66 @@
+##parameters=REQUEST,matric_no
+# $Id$
+"""
+process the Application Form
+return html renderer + psm
+"""
+import DateTime,logging
+current = DateTime.DateTime()
+pr = context.portal_registration
+logger = logging.getLogger('Returning')
+validate = REQUEST.has_key("cpsdocument_edit_button")
+
+lt = context.portal_layouts
+#pr = context.portal_registration
+default = {'matric_no':matric_no}
+st_res = context.students_catalog(matric_no = matric_no)
+if st_res:
+    sid = st_res[0].id
+else:
+    logger.info('"%s","Studentobject does not exist"' % matric_no)
+res,psm,ds = lt.renderLayout(layout_id= 'student_session_results_search',
+                      schema_id= 'student_returning',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob=default,
+                      layout_mode='edit',
+                      formaction = "set_access_data",
+                      button = "Search",
+                      matric_no = matric_no,
+                      commit = False,
+                      )
+if psm == '':
+    return context.set_access_data_form(rendered = res,
+                                 psm = None,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 name = "%(name)s" % REQUEST.form
+                                 )
+elif psm == 'invalid':
+    psm = "Please correct your input!"
+elif psm == 'valid' and not REQUEST.form.has_key('acknowledge'):
+    psm = "You did not check the ackkowledge box!"
+else:
+    psm = ''
+if psm != '':
+    return context.set_access_data_form(rendered = res,
+                                 #psm = "%s, %s" % (psm,ds),
+                                 psm = psm,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 name = "%(name)s" % REQUEST.form
+                                 )
+password = REQUEST.get('widget__password')
+email = ds.get('email')
+context.waeup_tool.makeStudentMember(sid,password=password)
+args = {}
+args['__ac_name'] = sid
+args['__ac_password'] = password
+args['returning'] = '1'
+args['email'] = email
+args['phone_nr'] = ds.get('phone_nr')
+from urllib import urlencode
+url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args))
+return REQUEST.RESPONSE.redirect(url)
