Index: WAeUP_SRP/trunk/profiles/default/layouts.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 478)
+++ WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 479)
@@ -11,5 +11,4 @@
  <object name="faculty" meta_type="CPS Layout"/>
  <object name="student" meta_type="CPS Layout"/>
- <object name="student_check_pin" meta_type="CPS Layout"/>
  <object name="student_study_course" meta_type="CPS Layout"/>
  <object name="student_application" meta_type="CPS Layout"/>
Index: WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 478)
+++ WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 479)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
-<object name="student_application" meta_type="CPS Layout">
+<object name="student_application_fe" meta_type="CPS Layout">
  <property name="layout_create_method"></property>
  <property name="layout_edit_method"></property>
@@ -7,5 +7,31 @@
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
-
+ <widget name="app_ac_batch_no" meta_type="String Widget">
+  <property name="title">Batch No</property>
+  <property name="fields">
+   <element value="app_ac_batch_no"/>
+  </property>
+  <property name="label">Batch</property>
+  <property name="label_edit">Batch</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">2</property>
+  <property name="size_max">2</property>
+ </widget>
+ <widget name="app_ac_batch_no_old" meta_type="Int Widget">
+  <property name="title">Batch No</property>
+  <property name="fields">
+   <element value="app_ac_batch_no"/>
+  </property>
+  <property name="label">Batch</property>
+  <property name="label_edit">Batch</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="is_limited">True</property>
+  <property name="min_value">1</property>
+  <property name="max_value">99</property>
+ </widget>
  <widget name="app_ac_pin" meta_type="Scratchcard Pin Widget">
   <property name="title">Application PIN</property>
@@ -13,18 +39,99 @@
    <element value="app_ac_pin"/>
   </property>
-  <property name="is_required"></property>
-  <property name="label">Application PIN</property>
-  <property name="label_edit">Application PIN</property>
-  <property
-     name="help"></property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>     
-  <property name="hidden_layout_modes">
-   <element value="create"/>
-  </property>
+  <property name="is_required">True</property>
+  <property name="label">Pin</property>
+  <property name="label_edit">Pin</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">10</property>
   <property name="size_max">12</property>
  </widget>
-
+ <widget name="app_ac_prefix" meta_type="String Widget">
+  <property name="title">Pin Prefix</property>
+  <property name="fields">
+   <element value="app_ac_prefix"/>
+  </property>
+  <property name="label">Prefix</property>
+  <property name="label_edit">Prefix</property>
+  <property name="readonly_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">3</property>
+ </widget>
+ <widget name="entry_mode" meta_type="String Widget">
+  <property name="title">Mode of Entry</property>
+  <property name="fields">
+   <element value="entry_mode"/>
+  </property>
+  <property name="label">Mode of Entry</property>
+  <property name="label_edit">Mode of Entry</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="jamb_first_cos" meta_type="String Widget">
+  <property name="title">JAMB First Choice Course of Study</property>
+  <property name="fields">
+   <element value="jamb_first_cos"/>
+  </property>
+  <property name="label">JAMB First Choice Course of Study</property>
+  <property name="label_edit">JAMB First Choice Course of Study</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="jamb_firstname" meta_type="String Widget">
+  <property name="title">JAMB First Name</property>
+  <property name="fields">
+   <element value="jamb_firstname"/>
+  </property>
+  <property name="label">Name</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="jamb_lastname" meta_type="String Widget">
+  <property name="title">JAMB Lastname</property>
+  <property name="fields">
+   <element value="jamb_lastname"/>
+  </property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="jamb_middlename" meta_type="String Widget">
+  <property name="title">JAMB Middle Name</property>
+  <property name="fields">
+   <element value="jamb_middlename"/>
+  </property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
  <widget name="jamb_reg_no" meta_type="StudentId Widget">
   <property name="title">JAMB Registration Number</property>
@@ -32,9 +139,8 @@
    <element value="jamb_reg_no"/>
   </property>
-  <property name="is_required">False</property>
   <property name="label">JAMB Registration Number</property>
   <property name="label_edit">JAMB Registration Number</property>
   <property name="readonly_layout_modes">
-     <element value="edit"/>
+   <element value="edit"/>
   </property>
   <property name="hidden_layout_modes"/>
@@ -43,62 +149,19 @@
   <property name="size_max">10</property>
  </widget>
-
- <widget name="jamb_firstname" meta_type="String Widget">
-  <property name="title">JAMB First Name</property>
-  <property name="fields">
-   <element value="jamb_firstname"/>
-  </property>
-  <property name="is_required">False</property>
-  <property name="label">Name</property>
-  <property name="label_edit"></property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
- <widget name="jamb_lastname" meta_type="String Widget">
-  <property name="title">JAMB Lastname</property>
-  <property name="fields">
-   <element value="jamb_lastname"/>
-  </property>
-  <property name="label"></property>
-  <property name="label_edit"></property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
- <widget name="jamb_middlename" meta_type="String Widget">
-  <property name="title">JAMB Middle Name</property>
-  <property name="fields">
-   <element value="jamb_middlename"/>
-  </property>
-  <property name="label"></property>
-  <property name="label_edit"></property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
- <widget name="entry_mode" meta_type="String Widget">
-  <property name="title">Mode of Entry</property>
-  <property name="fields">
-   <element value="entry_mode"/>
-  </property>
-  <property name="label">Mode of Entry</property>
-  <property name="label_edit">Mode of Entry</property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
+ <widget name="jamb_second_cos" meta_type="String Widget">
+  <property name="title">JAMB Second Choice Course of Study</property>
+  <property name="fields">
+   <element value="jamb_second_cos"/>
+  </property>
+  <property name="label">JAMB Second Choice Course of Study</property>
+  <property name="label_edit">JAMB Second Choice Course of Study</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
  <widget name="jamb_sex" meta_type="String Widget">
   <property name="title">JAMB Sex</property>
@@ -109,40 +172,11 @@
   <property name="label_edit">JAMB Sex</property>
   <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
-
- <widget name="jamb_first_cos" meta_type="String Widget">
-  <property name="title">JAMB First Choice Course of Study</property>
-  <property name="fields">
-   <element value="jamb_first_cos"/>
-  </property>
-  <property name="label">JAMB First Choice Course of Study</property>
-  <property name="label_edit">JAMB First Choice Course of Study</property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
- <widget name="jamb_second_cos" meta_type="String Widget">
-  <property name="title">JAMB Second Choice Course of Study</property>
-  <property name="fields">
-   <element value="jamb_second_cos"/>
-  </property>
-  <property name="label">JAMB Second Choice Course of Study</property>
-  <property name="label_edit">JAMB Second Choice Course of Study</property>
-  <property name="readonly_layout_modes">
-     <element value="edit"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
-
-
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
  <widget name="passport" meta_type="Image Widget">
   <property name="title">Passport Picture</property>
@@ -150,47 +184,50 @@
    <element value="passport"/>
   </property>
+  <property name="is_required">True</property>
   <property name="label">Passport Picture</property>
   <property name="label_edit">Passport Picture</property>
+  <property
+     name="help">Upload passport photograph with red background</property>
   <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
-  <property name="help">Upload passport photograph with red background</property>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
   <property name="size_max">204800</property>
+  <property name="display_external_editor">False</property>
   <property name="display_width">300</property>
   <property name="display_height">600</property>
   <property name="allow_resize">True</property>
  </widget>
-
  <table>
   <row>
-   <cell name="app_ac_pin"/>
-  </row>
-  <row>
-   <cell name="jamb_reg_no"/>
-  </row>
-  <row>
-   <cell name="jamb_firstname"/>
-  </row>
-  <row>
-   <cell name="jamb_middlename"/>
-  </row>
-  <row>
-   <cell name="jamb_lastname"/>
-  </row>
-  <row>
-   <cell name="jamb_sex"/>
-  </row>
-  <row>
-   <cell name="jamb_first_cos"/>
-  </row>
-  <row>
-   <cell name="jamb_second_cos"/>
-  </row>
-  <row>
-   <cell name="passport"/>
+   <cell name="jamb_reg_no" ncols="3"/>
+  </row>
+  <row>
+   <cell name="app_ac_prefix" ncols="1"/>
+   <cell name="app_ac_batch_no" ncols="1"/>
+   <cell name="app_ac_pin" ncols="1"/>
+  </row>
+  <row>
+   <cell name="jamb_firstname" ncols="3"/>
+  </row>
+  <row>
+   <cell name="jamb_middlename" ncols="3"/>
+  </row>
+  <row>
+   <cell name="jamb_lastname" ncols="3"/>
+  </row>
+  <row>
+   <cell name="jamb_sex" ncols="3"/>
+  </row>
+  <row>
+   <cell name="jamb_first_cos" ncols="3"/>
+  </row>
+  <row>
+   <cell name="jamb_second_cos" ncols="3"/>
+  </row>
+  <row>
+   <cell name="passport" ncols="3"/>
   </row>
  </table>
-
-
 </object>
-
Index: WAeUP_SRP/trunk/profiles/default/layouts/student_check_pin.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/student_check_pin.xml	(revision 478)
+++ 	(revision )
@@ -1,68 +1,0 @@
-<?xml version="1.0"?>
-<object name="student_check_pin" 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_waeup_</property>
- <property name="flexible_widgets"/>
- <property name="validate_values_expr"></property>
- <widget name="batch_no" meta_type="String Widget">
-  <property name="title">Batch Nr</property>
-  <property name="fields">
-   <element value="batch_no"/>
-  </property>
-  <property name="readonly_layout_modes">
-   <element value="create"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
-  <property name="display_width">2</property>
-  <property name="size_max">2</property>
- </widget>
- <widget name="jamb_reg_no" meta_type="JambRegNo Widget">
-  <property name="title">Student Jamb RegNo</property>
-  <property name="fields">
-   <element value="reg_no"/>
-  </property>
-  <property name="is_required">True</property>
-  <property name="label_edit">Enter Jamb Registration Number</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
- <widget name="pin" meta_type="Scratchcard Pin Widget">
-  <property name="title">Scratchcard Pin</property>
-  <property name="fields">
-   <element value="pin"/>
-  </property>
-  <property name="is_required">True</property>
-  <property name="label_edit">Enter Scratch Card Pin</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
- </widget>
- <widget name="prefix" meta_type="String Widget">
-  <property name="title">Prefix</property>
-  <property name="fields">
-   <element value="prefix"/>
-  </property>
-  <property name="label">Prefix</property>
-  <property name="readonly_layout_modes">
-   <element value="create"/>
-  </property>
-  <property name="hidden_layout_modes"/>
-  <property name="hidden_readonly_layout_modes"/>
-  <property name="display_width">3</property>
-  <property name="size_max">3</property>
- </widget>
- <table>
-  <row>
-   <cell name="jamb_reg_no" ncols="3"/>
-  </row>
-  <row>
-   <cell name="prefix"/>
-   <cell name="batch_no"/>
-   <cell name="pin"/>
-  </row>
- </table>
-</object>
Index: WAeUP_SRP/trunk/profiles/default/schemas.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 478)
+++ WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 479)
@@ -17,5 +17,4 @@
  <object name="student_accommodation" meta_type="CPS Schema"/>
  <object name="student_application" meta_type="CPS Schema"/>
- <object name="student_check_pin" meta_type="CPS Schema"/>
  <object name="student_clearance" meta_type="CPS Schema"/>
  <object name="student_personal" meta_type="CPS Schema"/>
Index: WAeUP_SRP/trunk/profiles/default/schemas/student_check_pin.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/student_check_pin.xml	(revision 478)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<?xml version="1.0"?>
-<object name="student_check_pin" meta_type="CPS Schema">
- <field name="batch_no" meta_type="CPS String Field"/>
- <field name="pin" meta_type="CPS String Field"/>
- <field name="prefix" meta_type="CPS String Field"/>
- <field name="reg_no" meta_type="CPS String Field"/>
-</object>
Index: WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 478)
+++ WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 479)
@@ -14,4 +14,5 @@
  <object name="waeup_section_wf" meta_type="CPS Workflow"/>
  <object name="waeup_student_wf" meta_type="CPS Workflow"/>
+ <object name="waeup_student_subobject_wf" meta_type="CPS Workflow"/>
  <object name="waeup_workspace_wf" meta_type="CPS Workflow"/>
  <bindings>
@@ -50,17 +51,8 @@
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
-  <type type_id="Jamb">
-   <bound-workflow workflow_id="waeup_base_wf"/>
-  </type>
-  <type type_id="Members Workspace">
-   <bound-workflow workflow_id="workspace_folder_wf"/>
-  </type>
   <type type_id="ScratchCardBatch">
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
   <type type_id="ScratchCardBatchesFolder">
-   <bound-workflow workflow_id="section_folder_wf"/>
-  </type>
-  <type type_id="Section">
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
@@ -72,11 +64,11 @@
   </type>
   <type type_id="StudentApplication">
-   <bound-workflow workflow_id="waeup_student_wf"/>
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
   </type>
   <type type_id="StudentClearance">
-   <bound-workflow workflow_id="waeup_student_wf"/>
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
   </type>
   <type type_id="StudentPersonal">
-   <bound-workflow workflow_id="waeup_student_wf"/>
+   <bound-workflow workflow_id="waeup_student_subobject_wf"/>
   </type>
   <type type_id="StudentStudyCourse">
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 479)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 479)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<cps-workflow workflow_id="waeup_student_subobject_wf"
+              title="CPS Workflow Definition"
+              state_variable="review_state"
+              meta_type="CPS Workflow">
+ <permission>Modify portal content</permission>
+ <permission>View</permission>
+ <state state_id="closed" title="">
+  <exit-transition transition_id="open"/>
+ </state>
+ <state state_id="created" title="">
+  <exit-transition transition_id="create_content"/>
+  <exit-transition transition_id="enter_application_pin"/>
+  <exit-transition transition_id="open"/>
+  <permission-map name="Modify portal content"
+                  acquired="False">
+   <permission-role>Manager</permission-role>
+   <permission-role>SectionManager</permission-role>
+  </permission-map>
+  <permission-map name="View" acquired="True">
+  </permission-map>
+ </state>
+ <state state_id="opened" title="">
+  <exit-transition transition_id="close"/>
+  <permission-map name="Modify portal content"
+                  acquired="True">
+   <permission-role>Owner</permission-role>
+  </permission-map>
+  <permission-map name="View" acquired="True">
+  </permission-map>
+ </state>
+ <transition transition_id="close" title=""
+             new_state="closed" trigger="USER"
+             before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+  </guard>
+ </transition>
+ <transition transition_id="create" title=""
+             new_state="created" trigger="USER"
+             before_script="" after_script="">
+  
+  <guard>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-create"/>
+  <transition-behavior behavior_id="initial-create"/>
+ </transition>
+ <transition transition_id="open" title=""
+             new_state="opened" trigger="USER"
+             before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+  </guard>
+ </transition>
+</cps-workflow>
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 478)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 479)
@@ -124,5 +124,5 @@
              trigger="USER"
              before_script=""
-             after_script="">
+             after_script="open_application_personal">
 
   <guard>
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_application.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_application.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "close_application"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_clearance.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_clearance.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "close_clearance"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_personal.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/close_personal.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "close_personal"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_application.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_application.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "open_application"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_application_personal.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_application_personal.py	(revision 479)
+++ WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_application_personal.py	(revision 479)
@@ -0,0 +1,11 @@
+## Script (Python) "open_personal"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=wfinfo
+##title=
+##
+context.application.content_status_modify(workflow_action="open")
+context.personal.content_status_modify(workflow_action="open")
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_personal.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/open_personal.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "open_personal"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/validate_application_pin.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/validate_application_pin.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "validate_application_pin"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/validate_clearance_pin.py
===================================================================
--- WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/scripts/validate_clearance_pin.py	(revision 478)
+++ 	(revision )
@@ -1,22 +1,0 @@
-## Script (Python) "validate_clearance_pin"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# Example code:
-
-# Import a standard function, and get the HTML request and response objects.
-from Products.PythonScripts.standard import html_quote
-request = container.REQUEST
-RESPONSE =  request.RESPONSE
-
-# Return a string identifying this script.
-print "This is the", script.meta_type, '"%s"' % script.getId(),
-if script.title:
-    print "(%s)" % html_quote(script.title),
-print "in", container.absolute_url()
-return printed
Index: WAeUP_SRP/trunk/skins/waeup_student/application_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/application_form.pt	(revision 478)
+++ WAeUP_SRP/trunk/skins/waeup_student/application_form.pt	(revision 479)
@@ -11,27 +11,12 @@
 
   <metal:block fill-slot="main">
-
-    <tal:block tal:condition="python:context.portal_type == 'Student'" tal:omit-tag="">  
-      <tal:block tal:define="
-                          rendered python:context.application.getContent().renderEdit(layout_id='student_application_fe',
-                                                         layout_mode='edit');"
-                          >
-
-   
+      <tal:block 
+          tal:define="rendered python:context.getContent().renderEdit(
+                layout_id='student_application_fe',
+                layout_mode='edit',
+                );">
       <tal:block tal:content="structure rendered" />
-
       </tal:block>  
-    </tal:block>
-    <tal:block condition="python:context.portal_type != 'Student'">
-    
-      This is not a student object
-      
-    
-    </tal:block>  
-  
   </metal:block>
-
-
-
   <metal:block fill-slot="sub">
   </metal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py	(revision 478)
+++ WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py	(revision 479)
@@ -5,24 +5,19 @@
 return html renderer + psm
 """
-import DateTime
-current = DateTime.DateTime()
-
 type_name = 'StudentApplication'
-
 ti = context.portal_types[type_name]
-
 REQUEST.set('type_name',type_name)
 
 validate = REQUEST.has_key("cpsdocument_create_button")
 
-
 lt = context.portal_layouts
 pr = context.portal_registration
 
-res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin',
-                      schema_id= 'student_check_pin',
+prefix = 'APP'
+res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe',
+                      schema_id= 'student_application',
                       context=context,
                       mapping=validate and REQUEST,
-                      ob={},
+                      ob={'app_ac_prefix': prefix},
                       layout_mode='create',
                       formaction = "apply_admission",
@@ -60,7 +55,8 @@
 student = application.aq_parent
 if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
-    student.invokeFactory('StudentClearance','clearance')
+    #student.invokeFactory('StudentClearance','clearance')
     student.invokeFactory('StudentPersonal','personal')
     student.content_status_modify(workflow_action="enter_application_pin")
+
 
 apdoc = application.getContent()
@@ -80,7 +76,10 @@
 student.personal.getContent().edit(mapping = dp)
 da = {}
-da['app_ac_pin'] = ds['pin']
+da['app_ac_prefix'] = prefix
+da['app_ac_batch_no'] = ds.get('app_ac_batch_no')
+da['app_ac_pin'] = ds.get('app_ac_pin')
 apdoc.edit(mapping = da)
 # now display the passport form with jamb-data readonly
+return context.REQUEST.RESPONSE.redirect("%s/application_form" % (student.application.absolute_url()))
 return student.application_form()
 
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_student_create.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_student_create.pt	(revision 479)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_student_create.pt	(revision 479)
@@ -0,0 +1,3 @@
+<tal:block define="global creation python:1;
+                   global formaction string:apply_admission" />
+<metal:block use-macro="here/layout_waeup_edit/macros/default_edit" />
Index: WAeUP_SRP/trunk/skins/waeup_student/student_edit.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/student_edit.py	(revision 478)
+++ WAeUP_SRP/trunk/skins/waeup_student/student_edit.py	(revision 479)
@@ -35,23 +35,50 @@
 # (We don't call getEditableContent here, validate does it when needed.)
 doc = context.getContent()
-is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
-                            use_session=True)
 
-if action is None:
-    ti = doc.getTypeInfo()
-    action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
-    action = '/' + action
-
-if is_valid:
-    comments = REQUEST.get('comments')
-    context.cpsdocument_notify_modification(comments=comments)
-    if cpsdocument_edit_and_view_button is not None:
-        action = ''
-    psm = 'psm_content_changed'
-    args = {}
+if context.portal_type == "StudentApplication":
+    student = context.aq_parent
+    if context.portal_workflow.getInfoFor(student,'review_state',None) == "application_pin_entered":
+        student.content_status_modify(workflow_action="apply_for_admission")
+        is_valid, ds = doc.validate(request=REQUEST, 
+                                    proxy=context, 
+                                    layout_id = "student_application_fe",
+                                    layout_mode = 'edit',
+                                    use_session=True)
+        
+        action = '/application_form'
+        
+        if is_valid:
+            comments = REQUEST.get('comments')
+            context.cpsdocument_notify_modification(comments=comments)
+            if cpsdocument_edit_and_view_button is not None:
+                action = ''
+            psm = 'psm_content_changed'
+            args = {}
+        else:
+            psm = 'psm_content_error'
+            args = getFormUidUrlArg(REQUEST)
+    else:
+        psm = "Application applied waiting for results"
+        action = "/view"
 else:
-    psm = 'psm_content_error'
-    args = getFormUidUrlArg(REQUEST)
-
+    is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
+                                use_session=True)
+    
+    if action is None:
+        ti = doc.getTypeInfo()
+        action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
+        action = '/' + action
+    
+    if is_valid:
+        comments = REQUEST.get('comments')
+        context.cpsdocument_notify_modification(comments=comments)
+        if cpsdocument_edit_and_view_button is not None:
+            action = ''
+        psm = 'psm_content_changed'
+        args = {}
+    else:
+        psm = 'psm_content_error'
+        args = getFormUidUrlArg(REQUEST)
+    
 args['portal_status_message'] = psm
 url = context.absolute_url() + action + '?' + urlencode(args)
