Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml	(revision 478)
@@ -22,5 +22,6 @@
   </property>
   <property name="hidden_layout_modes">
-   <element value="create"/>
+    <element value="create"/>
+    <element value="edit"/>
   </property>
   <property name="size_max">12</property>
@@ -35,5 +36,7 @@
   <property name="label">JAMB Registration Number</property>
   <property name="label_edit">JAMB Registration Number</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -50,6 +53,7 @@
   <property name="label">JAMB First Name</property>
   <property name="label_edit">JAMB First Name</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_readonly_layout_modes"/>
  </widget>
@@ -74,5 +78,7 @@
   <property name="label">JAMB Middl Name</property>
   <property name="label_edit">JAMB Middle Name</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -86,6 +92,11 @@
   <property name="label">Mode of Entry</property>
   <property name="label_edit">Mode of Entry</property>
-  <property name="readonly_layout_modes"/>
-  <property name="hidden_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes">
+    <element value="create"/>
+    <element value="edit"/>
+  </property>
   <property name="hidden_readonly_layout_modes"/>
  </widget>
@@ -98,5 +109,7 @@
   <property name="label">JAMB Sex</property>
   <property name="label_edit">JAMB Sex</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -110,5 +123,7 @@
   <property name="label">JAMB Age</property>
   <property name="label_edit">JAMB Age</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -122,5 +137,7 @@
   <property name="label">JAMB State</property>
   <property name="label_edit">JAMB State</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -134,5 +151,7 @@
   <property name="label">JAMB Local Government Area</property>
   <property name="label_edit">JAMB Local Government Area</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -146,5 +165,7 @@
   <property name="label">JAMB Score</property>
   <property name="label_edit">JAMB Score</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -158,5 +179,7 @@
   <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"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -170,5 +193,7 @@
   <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"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -182,5 +207,7 @@
   <property name="label">JAMB First Choice University</property>
   <property name="label_edit">JAMB First Choice University</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -194,5 +221,7 @@
   <property name="label">JAMB Second Choice University</property>
   <property name="label_edit">JAMB Second Choice University</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -206,5 +235,7 @@
   <property name="label">PUME General Paper</property>
   <property name="label_edit">PUME General Paper</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -218,5 +249,7 @@
   <property name="label">PUME English Score</property>
   <property name="label_edit">PUME English Score</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -230,5 +263,7 @@
   <property name="label">PUME Mathematics Score</property>
   <property name="label_edit">PUME Mathematics Score</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -242,5 +277,7 @@
   <property name="label">PUME Total Score</property>
   <property name="label_edit">PUME Total Score</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
@@ -254,5 +291,7 @@
   <property name="label">Passport Picture</property>
   <property name="label_edit">Passport Picture</property>
-  <property name="readonly_layout_modes"/>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 478)
@@ -4,5 +4,5 @@
  <property name="layout_edit_method"></property>
  <property name="layout_view_method"></property>
- <property name="style_prefix">layout_waeup_</property>
+ <property name="style_prefix">layout_student_</property>
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_check_pin.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_check_pin.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_check_pin.xml	(revision 478)
@@ -1,14 +1,27 @@
 <?xml version="1.0"?>
 <object name="student_check_pin" meta_type="CPS Layout">
- <property name="layout_create_method">layout_check_pin_create</property>
+ <property name="layout_create_method"></property>
  <property name="layout_edit_method"></property>
  <property name="layout_view_method"></property>
- <property name="style_prefix">layout_default_</property>
+ <property name="style_prefix">layout_waeup_</property>
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
- <widget name="jamb_id" meta_type="JambRegNo Widget">
-  <property name="title">Jamb Registration No</property>
+ <widget name="batch_no" meta_type="String Widget">
+  <property name="title">Batch Nr</property>
   <property name="fields">
-   <element value="jamb_reg_no"/>
+   <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>
@@ -21,6 +34,7 @@
   <property name="title">Scratchcard Pin</property>
   <property name="fields">
-   <element value="app_ac_pin"/>
+   <element value="pin"/>
   </property>
+  <property name="is_required">True</property>
   <property name="label_edit">Enter Scratch Card Pin</property>
   <property name="readonly_layout_modes"/>
@@ -28,9 +42,25 @@
   <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_id"/>
+   <cell name="jamb_reg_no" ncols="3"/>
   </row>
   <row>
+   <cell name="prefix"/>
+   <cell name="batch_no"/>
    <cell name="pin"/>
   </row>
Index: /WAeUP_SRP/trunk/profiles/default/schemas.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/schemas.xml	(revision 478)
@@ -14,7 +14,8 @@
  <object name="student" meta_type="CPS Schema"/>
  <object name="student_study_course" meta_type="CPS Schema"/>
- <object name="scratch_card_batch.xml" meta_type="CPS Schema"/>
+ <object name="scratch_card_batch" meta_type="CPS Schema"/>
  <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)
+++ /WAeUP_SRP/trunk/profiles/default/schemas/student_check_pin.xml	(revision 478)
@@ -0,0 +1,7 @@
+<?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/types/StudentsFolder.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/types/StudentsFolder.xml	(revision 478)
@@ -36,10 +36,12 @@
   <permission value="View"/>
  </action>
- <action title="Add JAMB Data" action_id="add_jamb" category="object"
-    condition_expr="" url_expr="string:${object/absolute_url}/create_jamb"
-    visible="False"/>
+ <action title="Apply for PUME " action_id="apply_admission" category="object"
+    condition_expr="" url_expr="string:${object/absolute_url}/apply_admission"
+    visible="True">
+  <permission value="View"/>
+ </action>
  <action title="Check Application Status" action_id="check_application"
     category="object"
-    condition_expr="object/portal_membership/isAnonymousUser"
+    condition_expr=""
     url_expr="string:${object/absolute_url}/check_application" visible="False">
   <permission value="View"/>
Index: /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 477)
+++ /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_wf/definition.xml	(revision 478)
@@ -63,5 +63,5 @@
  <transition transition_id="admit" title=""
              new_state="admitted" trigger="USER"
-             before_script="" after_script="open_clearance">
+             before_script="" after_script="">
 
   <guard>
@@ -74,5 +74,5 @@
              new_state="admission_applied" trigger="USER"
              before_script=""
-             after_script="close_application">
+             after_script="">
 
   <guard>
@@ -85,5 +85,5 @@
              new_state="cleared_and_validated"
              trigger="USER" before_script=""
-             after_script="open_personal">
+             after_script="">
 
   <guard>
@@ -123,6 +123,6 @@
              new_state="application_pin_entered"
              trigger="USER"
-             before_script="validate_application_pin"
-             after_script="open_application">
+             before_script=""
+             after_script="">
 
   <guard>
@@ -135,6 +135,6 @@
              new_state="clearance_pin_entered"
              trigger="USER"
-             before_script="validate_clearance_pin"
-             after_script="open_clearance">
+             before_script=""
+             after_script="">
 
   <guard>
@@ -195,5 +195,5 @@
  <transition transition_id="reject_clearance" title=""
              new_state="clearance_pin_entered"
-             trigger="USER" before_script="open_clearance"
+             trigger="USER" before_script=""
              after_script="">
 
@@ -206,30 +206,11 @@
  <transition transition_id="request_clearence" title=""
              new_state="clearence_requested" trigger="USER"
-             before_script="" after_script="close_clearance">
-
-  <guard>
-   <guard-role>Manager</guard-role>
-   <guard-role>SectionManager</guard-role>
-   <guard-role>Owner</guard-role>
-  </guard>
- </transition>
- <script script_id="close_application"
-         type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/close_application.py"/>
- <script script_id="close_clearance" type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/close_clearance.py"/>
- <script script_id="close_personal" type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/close_personal.py"/>
- <script script_id="open_application" type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/open_application.py"/>
- <script script_id="open_clearance" type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/open_clearance.py"/>
- <script script_id="open_personal" type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/open_personal.py"/>
- <script script_id="validate_application_pin"
-         type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/validate_application_pin.py"/>
- <script script_id="validate_clearance_pin"
-         type="Script (Python)"
-         filename="workflows/waeup_student_wf/scripts/validate_clearance_pin.py"/>
+             before_script="" after_script="">
+
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+   <guard-role>Owner</guard-role>
+  </guard>
+ </transition>
 </cps-workflow>
Index: /WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt	(revision 477)
+++ /WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_create.pt	(revision 478)
@@ -1,2 +1,3 @@
-<tal:block define="global creation python:1" />
-<metal:block use-macro="here/layout_waeup_lib/macros/default_edit" />
+<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_default/layout_waeup_edit.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt	(revision 477)
+++ /WAeUP_SRP/trunk/skins/waeup_default/layout_waeup_edit.pt	(revision 478)
@@ -1,1 +1,179 @@
-<metal:block use-macro="here/layout_waeup_lib/macros/default_edit" />
+<!-- a layout_lib macro -->
+<!-- $Id: layout_lib_default_edit.pt 34052 2006-03-06 14:59:24Z atchertchian $ -->
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+              ds options/datastructure;
+              dm ds/getDataModel;
+              creation creation|nothing;
+              metadata metadata|nothing;
+              type_name request/type_name|nothing;
+              ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
+              creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
+              edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
+              metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
+              formaction formaction|python: test(creation, creation_form,
+                                 test(metadata, metadata_form,
+                                                edit_form));
+              first_layout options/first_layout|python:0;
+              last_layout options/last_layout|python:0;
+              is_flexible options/is_flexible;
+              cpsmcat nocall:here/translation_service;
+              ">
+<tal:block condition="python:1 or first_layout">
+  <tal:block
+  content="structure string:<form id='editForm' action='${formaction}' method='post'
+  enctype='multipart/form-data' class='workflow'>
+  <div class='group'><div class='documentFields'>" />
+  <input type="hidden" name="type_name" value="."
+    tal:condition="creation" tal:attributes="value request/type_name" />
+</tal:block>
+
+<table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"
+       tal:condition="layout/rows">
+  <tr tal:repeat="row layout/rows" valign="top">
+    <td tal:repeat="cell row"
+      tal:attributes="colspan cell/ncols">
+      <tal:block define="widget cell/widget;
+                         wid widget/getWidgetId;
+                         err python:ds.getError(wid);
+                         err_mapping python:ds.getErrorMapping(wid);
+                         is_required widget/is_required|nothing;
+                         tooltip_id python:wid + '_help';
+                         widget_css_class cell/widget_css_class|nothing;
+                         widget_css_class python:test(is_flexible, 'group', widget_css_class);
+                         css_class python:test(err, 'row error',
+                                               test(is_flexible, 'group', 'row'))">
+        <div tal:attributes="class widget_css_class;
+                             id python:widget.getHtmlWidgetId()+'_widget';
+                            ">
+          <div class="label" tal:condition="widget/label_edit"
+            tal:attributes="class python:test(is_required, 'label required',
+                                              'label')">
+            <label i18n:translate="" tal:condition="widget/is_i18n"
+              tal:content="widget/label_edit"
+              tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+            <label tal:condition="not:widget/is_i18n"
+              tal:content="widget/label_edit"
+              tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+          </div>
+          <button type="button" class="tooltipControl"
+                  tal:condition="widget/help"
+                  tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
+          <div class="field">
+            <div tal:replace="structure cell/widget_rendered"/>
+          </div>
+          <div class="tooltipArea" style="visibility: hidden;"
+               tal:condition="widget/help"
+               tal:attributes="id tooltip_id;
+                               onclick python:'showElement(false, \'%s\')' % tooltip_id;">
+            <tal:block i18n:translate="" tal:condition="widget/is_i18n"
+              tal:content="widget/help">i18_key-help_for_this_field</tal:block>
+            <tal:block tal:condition="not:widget/is_i18n"
+              tal:content="widget/help">This is the help for this field</tal:block>
+          </div>
+          <tal:block condition="err">
+              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
+                <br /><em style="color: red"
+                  tal:content="msg">err</em>
+              </tal:block>
+          </tal:block>
+          <div style="float: right;" tal:condition="is_flexible">
+            <input type="button" value="button_move_up"
+              tal:condition="not:repeat/row/start"
+              tal:attributes="name string:uprow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'"
+              class="context moveUp" i18n:attributes="value" />
+            <input type="button" value="button_move_down"
+              tal:condition="not:repeat/row/end"
+              tal:attributes="name string:downrow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'"
+              class="context moveDown" i18n:attributes="value" />
+            <input type="button" value="button_delete"
+              class="destructive" i18n:attributes="value"
+              tal:attributes="name string:deleterow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'%s\')' %
+                                (cpsmcat('description_confirm_delete'), )" />
+          </div>
+        </div>
+      </tal:block>
+    </td>
+  </tr>
+</table>
+
+<tal:block condition="is_flexible">
+<div tal:define="flexible_widgets options/flexible_widgets">
+  <input type="hidden" name="layout_id" value="."
+    tal:attributes="value layout/layout_id" />
+  <tal:select condition="python:len(flexible_widgets)>1">
+    <select name="widget_type">
+      <tal:block repeat="widget options/flexible_widgets">
+      <option value="."
+        tal:condition="widget/is_i18n"
+        i18n:translate=""
+        tal:attributes="value widget/getWidgetId"
+        tal:content="widget/title_or_id">Type</option>
+      <option value="."
+        tal:condition="not:widget/is_i18n"
+        tal:attributes="value widget/getWidgetId"
+        tal:content="widget/title_or_id">Type</option>
+      </tal:block>
+    </select>
+    <input type="button" id="addwidget_button"
+           name="addwidget_button" value="button_add"
+           class="context"
+           i18n:attributes="value"
+           tal:attributes="onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'" />
+  </tal:select>
+  <tal:button condition="python:len(flexible_widgets) == 1">
+    <tal:block define="widget python:flexible_widgets[0]">
+      <input type="hidden" name="widget_type"
+        tal:attributes="value widget/getWidgetId">
+      <input type="submit" name="addwidget_button"
+        id="addwidget_button"
+        tal:define="button_add python:cpsmcat('button_add');
+          widget_title python:cpsmcat(widget.title_or_id())"
+        tal:attributes="value string:${button_add} ${widget_title}"
+        class="context" />
+    </tal:block>
+  </tal:button>
+</div>
+</tal:block>
+
+<tal:block condition="python: 1 or last_layout">
+  <tal:block content="structure string:</div>" />
+  <metal:block define-slot="additional_content" />
+
+  <tal:block condition="not:creation">
+    <div class="tooltipArea" style="visibility: hidden;"
+      id="transition_comments_help"
+      onclick="showElement(false, 'transition_comments_help')"
+      i18n:translate="help_transition_comments_modification">
+      In this filed you can give the reason of the modification that you are doing on this document.
+      Your comments may be used to notify other users.
+    </div>
+    <dl>
+      <dt><label for="comments"
+          i18n:translate="transition_comments_modification">Reason of the modification</label>
+        <button type="button" class="tooltipControl"
+          onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
+      </dt>
+      <dd>
+        <textarea name="comments" id="comments" cols="60" rows="3"
+          tal:content="nothing">
+        </textarea>
+      </dd>
+    </dl>
+  </tal:block>
+  <input type="submit" class="standalone" name="cpsdocument_edit_button"
+    value="button_change" i18n:attributes="value" id="cpsdocument_edit_button"
+    tal:condition="not:creation" />
+  <input type="submit" class="standalone" name="cpsdocument_edit_and_view_button"
+    value="button_change_and_view" i18n:attributes="value"
+    id="cpsdocument_edit_and_view_button"
+    tal:condition="not:creation" />
+  <input type="submit" class="standalone" name="cpsdocument_create_button"
+    value="button_create" i18n:attributes="value" tal:condition="creation" />
+  <tal:block content="structure string:</div></form>" />
+</tal:block>
+
+</metal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_form.pt	(revision 477)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_form.pt	(revision 478)
@@ -10,23 +10,14 @@
   </metal:block>
 
-  <metal:block fill-slot="main"
-               tal:define="roles member/getRoles;
-               frontend python:'Student' in roles or isAnon;
-               folder here/getContent;"                              
-               >
+  <metal:block fill-slot="main">
 
     <tal:block tal:condition="python:context.portal_type == 'Student'" tal:omit-tag="">  
       <tal:block tal:define="
-                          appl python:here.application;
-                          appl_proxy python:appl.getContent();"
+                          rendered python:context.application.getContent().renderEdit(layout_id='student_application_fe',
+                                                         layout_mode='edit');"
                           >
 
-      <h2>Application Form for <span tal:content="appl_proxy/jamb_firstname" /> <span tal:content="appl_proxy/jamb_lastname" /></h2>      
    
-      <tal:block tal:content="structure python:appl_proxy.renderEdit(request=request, layout_id='student_application_fe', proxy=appl_proxy, layout_mode='edit')" />
-      
-      <tal:block tal:content="structure python:appl_proxy.renderEdit(layout_id='student_application_fe', layout_mode='view')" />
-            
-      <tal:block tal:content="structure python:appl_proxy.render(layout_id='student_application_fe')" />
+      <tal:block tal:content="structure rendered" />
 
       </tal:block>  
@@ -34,5 +25,6 @@
     <tal:block condition="python:context.portal_type != 'Student'">
     
-      This is not a student object!
+      This is not a student object
+      
     
     </tal:block>  
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_pin_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_pin_form.pt	(revision 477)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_pin_form.pt	(revision 478)
@@ -18,5 +18,5 @@
           <p>Instructions :</p>
           <ul>
-            <li>Buy an Application Scratch Card.</li> 
+            <li>Buy an Appliiication Scratch Card.</li> 
             <li>Enter your JAMB registration number and the Application PIN above.</li> 
             <li>Upload your passport picture.</li> 
Index: /WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py	(revision 477)
+++ /WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py	(revision 478)
@@ -14,5 +14,5 @@
 REQUEST.set('type_name',type_name)
 
-validate = REQUEST.has_key("cpsdocument_edit_button")
+validate = REQUEST.has_key("cpsdocument_create_button")
 
 
@@ -21,5 +21,5 @@
 
 res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin',
-                      schema_id= 'student_application',
+                      schema_id= 'student_check_pin',
                       context=context,
                       mapping=validate and REQUEST,
@@ -31,5 +31,8 @@
 if psm == 'invalid':
     return context.application_pin_form(rendered = res,
-                                 psm = "Please correct your input",
+                                 #psm = "Please correct your input",
+                                 psm = "psm : #%s#" % (psm,),
+                                 firstlayout = True,
+                                 lastlayout = True,
                                  ds = ds,
                                  )
@@ -37,8 +40,10 @@
     return context.application_pin_form(rendered = res,
                                  psm = None,
+                                 firstlayout = True,
+                                 lastlayout = True,
                                  ds = ds,
                                  )
 elif psm == 'valid':
-    jamb_id = ds.get('jamb_id')
+    jamb_id = ds.get('jamb_reg_no')
     catalog = context.portal_catalog
     search = catalog({'meta_type': 'StudentApplication',
@@ -54,6 +59,27 @@
 application = search[0].getObject()
 student = application.aq_parent
-student.invokeFactory('StudentClearance','clearance')
-student.invokeFactory('StudentPersonal','personal')
+if context.portal_workflow.getInfoFor(student,'review_state',None) == "created":
+    student.invokeFactory('StudentClearance','clearance')
+    student.invokeFactory('StudentPersonal','personal')
+    student.content_status_modify(workflow_action="enter_application_pin")
+
+apdoc = application.getContent()
+names = apdoc.jamb_lastname.split()
+dp = {}
+if len(names) == 3:
+    dp['firstname'] = names[0].capitalize()
+    dp['middlename'] = names[1].capitalize()
+    dp['lastname'] = names[2].capitalize()
+elif len(names) == 2:
+    dp['firstname'] = names[0].capitalize()
+    dp['lastname'] = names[1].capitalize()
+else:
+    dp['lastname'] = apdoc.jamb_lastname
+dp['sex'] = apdoc.jamb_sex == 'M'
+dp['lga'] = "%s/%s" % (apdoc.jamb_state,apdoc.jamb_lga )
+student.personal.getContent().edit(mapping = dp)
+da = {}
+da['app_ac_pin'] = ds['pin']
+apdoc.edit(mapping = da)
 # now display the passport form with jamb-data readonly
 return student.application_form()
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_student_edit.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_student_edit.pt	(revision 478)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_student_edit.pt	(revision 478)
@@ -0,0 +1,181 @@
+<!-- a layout_lib macro -->
+<!-- $Id: layout_lib_default_edit.pt 34052 2006-03-06 14:59:24Z atchertchian $ -->
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+              ds options/datastructure;
+              dm ds/getDataModel;
+              formaction formaction|string:student_edit;
+              creation creation|nothing;
+              metadata metadata|nothing;
+              type_name request/type_name|nothing;
+              ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
+              creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ;
+              edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
+              metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
+              formaction formaction|python: test(creation, creation_form,
+                                 test(metadata, metadata_form,
+                                                edit_form));
+              first_layout options/first_layout|python:0;
+              last_layout options/last_layout|python:0;
+              is_flexible options/is_flexible;
+              cpsmcat nocall:here/translation_service;
+              ">
+
+<tal:block condition="python:1 or first_layout">
+  <tal:block
+  content="structure string:<form id='editForm' action='${formaction}' method='post'
+  enctype='multipart/form-data' class='workflow'>
+  <div class='group'><div class='documentFields'>" />
+  <input type="hidden" name="type_name" value="."
+    tal:condition="creation" tal:attributes="value request/type_name" />
+</tal:block>
+
+<table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"
+       tal:condition="layout/rows">
+  <tr tal:repeat="row layout/rows" valign="top">
+    <td tal:repeat="cell row"
+      tal:attributes="colspan cell/ncols">
+      <tal:block define="widget cell/widget;
+                         wid widget/getWidgetId;
+                         err python:ds.getError(wid);
+                         err_mapping python:ds.getErrorMapping(wid);
+                         is_required widget/is_required|nothing;
+                         tooltip_id python:wid + '_help';
+                         widget_css_class cell/widget_css_class|nothing;
+                         widget_css_class python:test(is_flexible, 'group', widget_css_class);
+                         css_class python:test(err, 'row error',
+                                               test(is_flexible, 'group', 'row'))">
+        <div tal:attributes="class widget_css_class;
+                             id python:widget.getHtmlWidgetId()+'_widget';
+                            ">
+          <div class="label" tal:condition="widget/label_edit"
+            tal:attributes="class python:test(is_required, 'label required',
+                                              'label')">
+            <label i18n:translate="" tal:condition="widget/is_i18n"
+              tal:content="widget/label_edit"
+              tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+            <label tal:condition="not:widget/is_i18n"
+              tal:content="widget/label_edit"
+              tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
+          </div>
+          <button type="button" class="tooltipControl"
+                  tal:condition="widget/help"
+                  tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
+          <div class="field">
+            <div tal:replace="structure cell/widget_rendered"/>
+          </div>
+          <div class="tooltipArea" style="visibility: hidden;"
+               tal:condition="widget/help"
+               tal:attributes="id tooltip_id;
+                               onclick python:'showElement(false, \'%s\')' % tooltip_id;">
+            <tal:block i18n:translate="" tal:condition="widget/is_i18n"
+              tal:content="widget/help">i18_key-help_for_this_field</tal:block>
+            <tal:block tal:condition="not:widget/is_i18n"
+              tal:content="widget/help">This is the help for this field</tal:block>
+          </div>
+          <tal:block condition="err">
+              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
+                <br /><em style="color: red"
+                  tal:content="msg">err</em>
+              </tal:block>
+          </tal:block>
+          <div style="float: right;" tal:condition="is_flexible">
+            <input type="button" value="button_move_up"
+              tal:condition="not:repeat/row/start"
+              tal:attributes="name string:uprow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'"
+              class="context moveUp" i18n:attributes="value" />
+            <input type="button" value="button_move_down"
+              tal:condition="not:repeat/row/end"
+              tal:attributes="name string:downrow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'"
+              class="context moveDown" i18n:attributes="value" />
+            <input type="button" value="button_delete"
+              class="destructive" i18n:attributes="value"
+              tal:attributes="name string:deleterow_${repeat/row/index};
+                              onclick python:'CPSFlexibleEdit.buttonClick(this, \'%s\')' %
+                                (cpsmcat('description_confirm_delete'), )" />
+          </div>
+        </div>
+      </tal:block>
+    </td>
+  </tr>
+</table>
+
+<tal:block condition="is_flexible">
+<div tal:define="flexible_widgets options/flexible_widgets">
+  <input type="hidden" name="layout_id" value="."
+    tal:attributes="value layout/layout_id" />
+  <tal:select condition="python:len(flexible_widgets)>1">
+    <select name="widget_type">
+      <tal:block repeat="widget options/flexible_widgets">
+      <option value="."
+        tal:condition="widget/is_i18n"
+        i18n:translate=""
+        tal:attributes="value widget/getWidgetId"
+        tal:content="widget/title_or_id">Type</option>
+      <option value="."
+        tal:condition="not:widget/is_i18n"
+        tal:attributes="value widget/getWidgetId"
+        tal:content="widget/title_or_id">Type</option>
+      </tal:block>
+    </select>
+    <input type="button" id="addwidget_button"
+           name="addwidget_button" value="button_add"
+           class="context"
+           i18n:attributes="value"
+           tal:attributes="onclick python:'CPSFlexibleEdit.buttonClick(this, \'\')'" />
+  </tal:select>
+  <tal:button condition="python:len(flexible_widgets) == 1">
+    <tal:block define="widget python:flexible_widgets[0]">
+      <input type="hidden" name="widget_type"
+        tal:attributes="value widget/getWidgetId">
+      <input type="submit" name="addwidget_button"
+        id="addwidget_button"
+        tal:define="button_add python:cpsmcat('button_add');
+          widget_title python:cpsmcat(widget.title_or_id())"
+        tal:attributes="value string:${button_add} ${widget_title}"
+        class="context" />
+    </tal:block>
+  </tal:button>
+</div>
+</tal:block>
+
+<tal:block condition="python: 1 or last_layout">
+  <tal:block content="structure string:</div>" />
+  <metal:block define-slot="additional_content" />
+
+  <tal:block condition="nothing">
+    <div class="tooltipArea" style="visibility: hidden;"
+      id="transition_comments_help"
+      onclick="showElement(false, 'transition_comments_help')"
+      i18n:translate="help_transition_comments_modification">
+      In this filed you can give the reason of the modification that you are doing on this document.
+      Your comments may be used to notify other users.
+    </div>
+    <dl>
+      <dt><label for="comments"
+          i18n:translate="transition_comments_modification">Reason of the modification</label>
+        <button type="button" class="tooltipControl"
+          onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
+      </dt>
+      <dd>
+        <textarea name="comments" id="comments" cols="60" rows="3"
+          tal:content="nothing">
+        </textarea>
+      </dd>
+    </dl>
+  </tal:block>
+  <input type="submit" class="standalone" name="cpsdocument_edit_button"
+    value="button_change" i18n:attributes="value" id="cpsdocument_edit_button"
+    tal:condition="not:creation" />
+  <input type="submit" class="standalone" name="cpsdocument_edit_and_view_button"
+    value="button_change_and_view" i18n:attributes="value"
+    id="cpsdocument_edit_and_view_button"
+    tal:condition="not:creation" />
+  <input type="submit" class="standalone" name="cpsdocument_create_button"
+    value="button_create" i18n:attributes="value" tal:condition="creation" />
+  <tal:block content="structure string:</div></form>" />
+</tal:block>
+
+</metal:block>
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 478)
@@ -0,0 +1,58 @@
+## Script (Python) "cpsdocument_edit"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None
+##title=
+##
+# $Id: cpsdocument_edit.py 33302 2006-02-22 15:57:11Z tziade $
+"""
+Called when a document form is posted.
+
+Validates data, then:
+
+ - if there's no error, updates the object and redirects to it,
+
+ - if there's an error, puts data in session and redirects to edit form.
+
+A form uid is propagated during the redirect to uniquely identify the
+form in the session.
+"""
+
+from urllib import urlencode
+from Products.CPSDocument.utils import getFormUidUrlArg
+
+# Until ajax posts directly to its own script...
+if 'ajax_edit' in REQUEST.form:
+    return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)
+
+# Check flexible controls
+context.editLayouts(REQUEST=REQUEST)
+
+# Validate the document and write it if it's valid
+# (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 = {}
+else:
+    psm = 'psm_content_error'
+    args = getFormUidUrlArg(REQUEST)
+
+args['portal_status_message'] = psm
+url = context.absolute_url() + action + '?' + urlencode(args)
+REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_edit_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_edit_form.pt	(revision 478)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_edit_form.pt	(revision 478)
@@ -0,0 +1,130 @@
+<tal:block define="
+    rendered_main python:here.cpsdocument_edit_render(request=request);
+    form_action string:student_edit;
+    creation python:False;
+    edition python:True;
+    metadata metadata|nothing;
+    ">
+<metal:block define-macro="edit_form">
+<metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="style_slot">
+    <link rel="Stylesheet" type="text/css" href=""
+      tal:attributes="href string:${base_url}document.css" />
+
+    <metal:block define-macro="widgets_javascript">
+    <!-- XXX this has to move to CPSSchemas -->
+    <style type="text/css"
+      tal:content="string:@import url(${base_url}calendar-win2k-1.css);"></style>
+    <script type="text/javascript" src="calendar.js"
+      tal:attributes="src string:${base_url}calendar.js"></script>
+    <script type="text/javascript" src="lang/calendar-en.js"
+      tal:define="local cpsmcat/getSelectedLanguage"
+      tal:attributes="src string:${base_url}lang/calendar-${local}.js"></script>
+    <script type="text/javascript" src="calendar-setup.js"
+      tal:attributes="src string:${base_url}calendar-setup.js"></script>
+    <script type="text/javascript" src="prototype.js"
+      tal:attributes="src string:${base_url}prototype.js"></script>
+    <script type="text/javascript" src="effects.js"
+      tal:attributes="src string:${base_url}effects.js"></script>
+    <script type="text/javascript" src="controls.js"
+      tal:attributes="src string:${base_url}controls.js"></script>
+    <script type="text/javascript" src="cpsdocument.js"
+      tal:attributes="src string:${base_url}cpsdocument.js"></script>
+    <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.FCKeditor')">
+      <script type="text/javascript">
+        var popup_editor_form = 'popup_fckeditor_form';
+        var width = 640;
+        var height = 520;
+      </script>
+    </tal:block>
+    <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.Epoz')">
+      <script type="text/javascript">
+        var popup_editor_form = 'popup_rte_form';
+        var width = 640;
+        var height = 480;
+      </script>
+    </tal:block>
+    <script type="text/javascript">
+     function popup_rte(input_id, label_edit) {
+       var args, value;
+       value = document.getElementById(input_id).value;
+       args = '?input_id='+input_id+'&amp;label_edit='+escape(label_edit);
+       str_window_features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,dependent=1,width=' + width + ',height=' + height;
+       popup = window.open(popup_editor_form + args, input_id, str_window_features);
+       if (!popup.opener) {
+         popup.opener = window;
+       }
+       return false;
+     }
+   </script>
+   </metal:block>
+  </metal:block>
+
+  <metal:block fill-slot="header">
+    <h1 tal:condition="creation" i18n:translate="">
+      Create a document of type
+      <tal:block i18n:name="type_name" i18n:translate=""
+            tal:define="type_name request/type_name;
+                        type_info python:here.portal_types[type_name]"
+            tal:content="type_info/Title">Type Title</tal:block>
+    </h1>
+    <h1 tal:condition="not:creation">
+      <tal:block condition="python: edition and not metadata"
+        i18n:translate="">Edit <span id="page_title" i18n:name="title"
+        tal:content="here/title_or_id">Page Title</span></tal:block>
+      <tal:block tal:condition="metadata"
+        i18n:translate="">Metadata of <span i18n:name="title" tal:content="here/title_or_id">Page Title</span></tal:block>
+    </h1>
+  </metal:block>
+
+  <metal:block fill-slot="main">
+    <form action="ACTION" method="post" id="editForm"
+          enctype="multipart/form-data" class="workflow"
+          tal:attributes="action form_action">
+      <div class="group">
+        <div class="documentFields">
+          <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml"
+                     replace="structure python:getFormUidHtml(request)"/>
+          <input type="hidden" name="type_name" value="VALUE"
+                 tal:condition="creation"
+                 tal:attributes="value request/type_name" />
+          <input type="hidden" id="button_placeholder" name="button_placeholder" value="" />
+          <div id="rendered_main" tal:content="structure rendered_main">
+            CONTENT
+          </div>
+        </div>
+
+        <tal:block condition="not:creation">
+          <div class="tooltipArea" style="visibility: hidden;"
+               id="transition_comments_help"
+               onclick="showElement(false, 'transition_comments_help')"
+               i18n:translate="help_transition_comments_modification">
+            In this field you can give the reason for the modification
+            on this document. Your comments may be used to notify other users.
+          </div>
+          <dl>
+            <dt><label for="comments"
+                       i18n:translate="transition_comments_modification"
+                       >Reason of the modification</label>
+              <button type="button" class="tooltipControl"
+                      onclick="toggleElementVisibility('transition_comments_help')"> ? </button>
+            </dt>
+            <dd>
+              <textarea name="comments" id="comments" cols="60" rows="3"
+                        tal:content="nothing">
+              </textarea>
+            </dd>
+          </dl>
+        </tal:block>
+
+        <metal:block use-macro="here/cpsdocument_edit_buttons/macros/buttons"/>
+      </div>
+    </form>
+    <div id="ajax_psm" style="display:none">
+      ajax feedback
+    </div>
+  </metal:block>
+
+</metal:block>
+</metal:block>
+</tal:block>
