Index: WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTool.py	(revision 1168)
+++ WAeUP_SRP/trunk/WAeUPTool.py	(revision 1169)
@@ -134,5 +134,5 @@
         student_obj.invokeFactory('StudentApplication','application')
         application = student_obj.application
-        self.portal_workflow.doActionFor(application,'close',dest_container=application)
+        self.portal_workflow.doActionFor(application,'open',dest_container=application)
         da = {'Title': 'Application Data'}
         student_obj.invokeFactory('StudentPersonal','personal')
@@ -144,5 +144,5 @@
         student_obj.invokeFactory('StudentClearance','clearance')
         clearance = student_obj.clearance
-        self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance)
+        self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance)
         dc = {'Title': 'Clearance/Eligibility Record'}
         dc['matric_no'] = matric_no
@@ -162,6 +162,8 @@
         dp['perm_address'] = student.Permanent_Address
         application.getContent().edit(mapping=da)
+        self.portal_workflow.doActionFor(application,'close',dest_container=application)
         personal.getContent().edit(mapping=dp)
         clearance.getContent().edit(mapping=dc)
+        self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance)
         catd = {}
         catd['id'] = sid
Index: WAeUP_SRP/trunk/Widgets.py
===================================================================
--- WAeUP_SRP/trunk/Widgets.py	(revision 1168)
+++ WAeUP_SRP/trunk/Widgets.py	(revision 1169)
@@ -317,4 +317,12 @@
     """ JambRegNo Widget"""
     meta_type = "JambRegNo Widget"
+    _properties = CPSStringWidget._properties + (
+        {'id': 'catalog', 'type': 'string', 'mode': 'w',
+         'label': 'Catalog to search'},
+         {'id': 'reference', 'type': 'string', 'mode': 'w',
+         'label': 'Reference Field'},
+         )
+    catalog = "portal_pumeresults" #the catalog to search for jamb_reg_no
+    reference = ""
     digits = 8
     digits_str = "N"*digits
@@ -323,29 +331,33 @@
     def validate(self, datastructure, **kw):
         """Validate datastructure and update datamodel."""
-
         valid = CPSStringWidget.validate(self, datastructure, **kw)
         #import pdb;pdb.set_trace()
-        pumeresults = self.portal_pumeresults
-        if not valid:
-            return 0
-        else:
-            widget_id = self.getWidgetId()
-            value = datastructure[widget_id].upper()
-            err = 0
-            if not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()):
-                err = 'Invalid number, the expected format is: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str)
+        jamb_nr_catalog = getattr(self,self.catalog)
+        widget_id = self.getWidgetId()
+        value = datastructure[widget_id].upper()
+        err = 0
+        if not valid: #or not (len(value) == self.digits + self.letters and value[:self.digits].isdigit() and value[self.digits:].isalpha()):
+            #err = 'Invalid number, the expected format is: %s%s with N = Number, L = Letter' % (self.digits_str,self.letters_str)
+            err = 'Invalid number'
+        elif self.reference == '':
+            #s = getStudentByRegNo(self,value)
+            pume = jamb_nr_catalog(jamb_reg_no = value)
+            if len(pume) < 1:
+                err = 'No Student with JAMB RegNo %s.' % (value)
             else:
-                #s = getStudentByRegNo(self,value)
-                pume = pumeresults(jamb_reg_no = value)
-                if len(pume) < 1:
-                    err = 'No Student with JAMB RegNo %s.' % (value)
-                else:
-                    datastructure['pume'] = pume[0]
-            if err:
-                datastructure.setError(widget_id, err)
-            else:
-                datamodel = datastructure.getDataModel()
-                datamodel[self.fields[0]] = value
-            return not err
+                datastructure['pume'] = pume[0]
+        else:
+            #import pdb;pdb.set_trace()
+            record = datastructure[self.reference]
+            #jamb_reg_no = getattr(record,widget_id)
+            jamb_reg_no = record.Entryregno
+            if jamb_reg_no != value:
+                err = 'Entry Registration Nr does not match.'
+        if err:
+            datastructure.setError(widget_id, err)
+        else:
+            datamodel = datastructure.getDataModel()
+            datamodel[self.fields[0]] = value
+        return not err
 
 InitializeClass(JambRegNoWidget)
@@ -593,5 +605,4 @@
          {'id': 'reference', 'type': 'string', 'mode': 'w',
          'label': 'Reference Field'},
-
         )
     prefix = ''
@@ -626,5 +637,5 @@
 ###)
 
-    def validate(self, datastructure, **kw):
+    def validate(self, datastructure, **kw): ###(
         """Validate datastructure and update datamodel."""
         s_logger = logging.getLogger('Pin.Validate')
@@ -720,4 +731,6 @@
         return not err
 
+###)
+
     def render(self, mode, datastructure, **kw): ###(
         """Render in mode from datastructure."""
@@ -767,5 +780,5 @@
 ###)
 
-class WAeUPImageWidget(CPSImageWidget):
+class WAeUPImageWidget(CPSImageWidget): ###(
     """Photo widget."""
     meta_type = 'WAeUP Image Widget'
@@ -780,4 +793,6 @@
         return meth(mode=mode, datastructure=datastructure, **img_info)
 
+###)
+
 
 
Index: WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1168)
+++ WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1169)
@@ -20,5 +20,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="jamb_reg_no" meta_type="String Widget">
+ <widget name="jamb_reg_no" meta_type="JambRegNo Widget">
   <property name="title">JAMB Registration Number</property>
   <property name="fields">
@@ -29,7 +29,9 @@
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes">
-   <element value="create"/>
+   <element value="edit"/>
   </property>
   <property name="hidden_readonly_layout_modes"/>
+  <property name="catalog">returning_import</property>
+  <property name="reference">student</property>
   <property name="display_width">10</property>
   <property name="size_max">10</property>
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 1168)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 1169)
@@ -110,6 +110,14 @@
   <exit-transition transition_id="notify_change_courses"/>
   <exit-transition transition_id="validate_courses"/>
+  <permission-map name="View" acquired="True">
+   <permission-role>Owner</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
  </state>
  <state state_id="courses_validated" title="">
+  <permission-map name="View" acquired="True">
+   <permission-role>Owner</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
  </state>
  <state state_id="deferred" title="">
@@ -180,8 +188,16 @@
   <exit-transition transition_id="create_content"/>
   <exit-transition transition_id="enter_school_fee_pin"/>
+  <permission-map name="View" acquired="True">
+   <permission-role>Owner</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
  </state>
  <state state_id="school_fee_pin_entered" title="">
   <exit-transition transition_id="create_content"/>
   <exit-transition transition_id="register_courses"/>
+  <permission-map name="View" acquired="True">
+   <permission-role>Owner</permission-role>
+   <permission-role>SectionOfficer</permission-role>
+  </permission-map>
  </state>
  <state state_id="student_created" title="">
Index: WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py	(revision 1168)
+++ WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py	(revision 1169)
@@ -8,6 +8,6 @@
 ##title=
 ##
-# $Id: createStudentFT.py 1151 2006-12-29 22:05:53Z joachim $
-''' create the Studenbase folder'''
+# $Id: createReturningStudent.py 1151 2006-12-29 22:05:53Z joachim $
+''' create the Studentbase folder'''
 
 
@@ -30,13 +30,14 @@
     return "MatricNo %s not found in Returning Table" % matric_no
 student_brain = res[0]
-sid = context.waeup_tool.generateStudentId(student_brain.Firstname[0])
+sid = context.waeup_tool.generateStudentId('?')
 students_folder.invokeFactory('Student', sid)
 logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
 student = getattr(students_folder,sid)
-wftool.doActionFor(student,'clear_and_validate')
+wftool.doActionFor(student,'return')
 student.manage_setLocalRoles(sid, ['Owner',])
+jamb_reg_no = student_brain.Entryregno,
 context.students_catalog.addRecord(id = sid,
                                    matric_no = matric_no,
-                                   jamb_reg_no = student_brain.Entryregno,
+                                   jamb_reg_no = jamb_reg_no,
                                    sex = student_brain.Sex == "F",
                                    name = "%s %s %s" % (student_brain.Firstname,
@@ -44,4 +45,4 @@
                                                         student_brain.Lastname)
                                 )
-return "Student MatricNo %s and %s created" % (matric_no,sid)
+return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no)
 
Index: WAeUP_SRP/trunk/skins/waeup_student/entry_results_anon_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/entry_results_anon_view.pt	(revision 1168)
+++ WAeUP_SRP/trunk/skins/waeup_student/entry_results_anon_view.pt	(revision 1169)
@@ -1,7 +1,8 @@
-<metal:html tal:define="pume options/pume">
+<metal:html tal:define="pume options/pume;
+                      result_type pume/result_type|string:PU">
   <metal:body use-macro="here/main_template/macros/master">
     <metal:main fill-slot="main">
 
-        <span tal:condition="python:pume['result_type']!='DE'">        
+        <span tal:condition="python:result_type =='PU'">        
         <div style="text-align: right">
         <a href="" target="slip" tal:attributes="href string:entry_results_anon_slip?nr=${pume/jamb_reg_no}"
@@ -14,5 +15,5 @@
         </span>       
                      
-        <span tal:condition="python:pume['result_type']=='DE'">
+        <span tal:condition="python:result_type == 'DE'">
         <div style="text-align: right">
         <a href="" target="slip" tal:attributes="href string:entry_results_anon_slip?nr=${pume/jamb_reg_no}"
Index: WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1168)
+++ WAeUP_SRP/trunk/skins/waeup_student/session_results_anon_view.pt	(revision 1169)
@@ -59,7 +59,13 @@
       </table>
       <br />
-      <a href="" tal:attributes="href string:${context/absolute_url}/set_access_data?matric_no=${student/matric_no}">
-        Continue to Login! 
-      </a>
+      <form action="" method="post"
+            tal:attributes="action string:${context/portal_url}/set_access_data">
+        <input type="hidden" name="matric_no" tal:attributes="value student/matric_no" />
+        <input type="hidden" name="jamb_reg_no" tal:attributes="value student/Entryregno" />
+        <input type="submit" 
+               class="standalone" 
+               value="Continue to Login!"
+               name="submit" />
+      </form>
     </metal:main>
   </metal:body>
Index: WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1168)
+++ WAeUP_SRP/trunk/skins/waeup_student/set_access_data.py	(revision 1169)
@@ -42,14 +42,14 @@
 elif psm == 'valid':
     pass
-    jamb_reg_no = ds.get('jamb_reg_no')
-    r = context.returning_import(matric_no = matric_no)
-    if r and r[0].Entryregno != jamb_reg_no or not r:
-        psm = "Your Jamb Registration Nr is wrong"
-        return context.set_access_data_form(rendered = res,
-                                 psm = psm,
-                                 firstlayout = True,
-                                 lastlayout = True,
-                                 ds = ds,
-                                 )
+##    jamb_reg_no = ds.get('jamb_reg_no')
+##    r = context.returning_import(matric_no = matric_no)
+##    if r and r[0].Entryregno != jamb_reg_no or not r:
+##        psm = "Your Jamb Registration Nr is wrong"
+##        return context.set_access_data_form(rendered = res,
+##                                 psm = psm,
+##                                 firstlayout = True,
+##                                 lastlayout = True,
+##                                 ds = ds,
+##                                 )
 ## from Products.zdb import set_trace;set_trace()
 password = REQUEST.get('widget__password')
@@ -64,4 +64,5 @@
 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))
