Index: /WAeUP_SRP/trunk/PatchCPSSchemasAttributeStorageAdapter.py
===================================================================
--- /WAeUP_SRP/trunk/PatchCPSSchemasAttributeStorageAdapter.py	(revision 537)
+++ /WAeUP_SRP/trunk/PatchCPSSchemasAttributeStorageAdapter.py	(revision 537)
@@ -0,0 +1,6 @@
+def _getContentUrl(self, object, field_id, file_name):
+    return '%s/%s' % (
+        object.aq_parent.absolute_url(), field_id)
+    
+from Products.CPSSchemas.StorageAdapter import AttributeStorageAdapter
+AttributeStorageAdapter._getContentUrl = _getContentUrl
Index: /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py
===================================================================
--- /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py	(revision 536)
+++ /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py	(revision 537)
@@ -43,8 +43,8 @@
             not_found = True
     if not_found:
-        self._initProperties(node)
-        self._initObjects(node)
-        self._initIndexes(node)
-        self._initColumns(node)
+        #self._initProperties(node)
+        #self._initObjects(node)
+        #self._initIndexes(node)
+        #self._initColumns(node)
         self._refreshCatalog()
 
Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 536)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 537)
@@ -6,5 +6,5 @@
 ##from Products.CPSSchemas.Widget import CPSWidgetType
 from Products.CMFCore.utils import getToolByName
-from Products.CPSSchemas.BasicWidgets import CPSWidget, CPSStringWidget, CPSEmailWidget
+from Products.CPSSchemas.BasicWidgets import CPSWidget, CPSStringWidget, CPSEmailWidget,CPSImageWidget
 from Products.CPSSchemas.BasicWidgets import renderHtmlTag,CPSSelectWidget, CPSStringWidget
 from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
@@ -380,4 +380,24 @@
 ###)
 
+class WAeUPImageWidget(CPSImageWidget):
+    """Photo widget."""
+    meta_type = 'WAeUP Image Widget'
+
+    def render(self, mode, datastructure, **kw):
+        render_method = 'widget_waeup_image_render'
+        meth = getattr(self, render_method, None)
+        if meth is None:
+            raise RuntimeError("Unknown Render Method %s for widget type %s"
+                               % (render_method, self.getId()))
+        img_info = self.getImageInfo(datastructure)
+        return meth(mode=mode, datastructure=datastructure, **img_info)
+
+
+
+InitializeClass(WAeUPImageWidget)
+
+widgetRegistry.register(WAeUPImageWidget)
+
+
 ###########
 
Index: /WAeUP_SRP/trunk/__init__.py
===================================================================
--- /WAeUP_SRP/trunk/__init__.py	(revision 536)
+++ /WAeUP_SRP/trunk/__init__.py	(revision 537)
@@ -13,4 +13,5 @@
 import PatchCPSWorkflowWorkflowDefinition
 import PatchCatalogToolXMLAdapter
+import PatchCPSSchemasAttributeStorageAdapter
 # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
 import PatchCPSDefaultImportExport
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml	(revision 536)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml	(revision 537)
@@ -2,5 +2,5 @@
 <object name="student_application" meta_type="CPS Layout">
  <property name="layout_create_method"></property>
- <property name="layout_edit_method"></property>
+ <property name="layout_edit_method">layout_application_print</property>
  <property name="layout_view_method"></property>
  <property name="style_prefix">layout_waeup_</property>
@@ -219,5 +219,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="passport" meta_type="Image Widget">
+ <widget name="passport" meta_type="WAeUPImage Widget">
   <property name="title">Passport Picture</property>
   <property name="fields">
@@ -324,4 +324,7 @@
   </row>
   <row>
+   <cell name="entry_mode" ncols="3"/>
+  </row>
+  <row>
    <cell name="jamb_first_cos" ncols="3"/>
   </row>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 536)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml	(revision 537)
@@ -160,5 +160,5 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="passport" meta_type="Image Widget">
+ <widget name="passport" meta_type="WAeUPImage Widget">
   <property name="title">Passport Picture</property>
   <property name="fields">
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 536)
+++ /WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml	(revision 537)
@@ -30,6 +30,8 @@
   <exit-transition transition_id="close"/>
   <permission-map name="Modify portal content"
-                  acquired="True">
+                  acquired="False">
+   <permission-role>Owner</permission-role>
    <permission-role>SectionManager</permission-role>
+   <permission-role>Manager</permission-role>
   </permission-map>
   <permission-map name="WAeUPModify own content"
@@ -37,5 +39,6 @@
    <permission-role>Owner</permission-role>
   </permission-map>
-  <permission-map name="View" acquired="True">
+  <permission-map name="View" acquired="False">
+   <permission-role>Owner</permission-role>
   </permission-map>
  </state>
Index: /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 536)
+++ /WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py	(revision 537)
@@ -82,4 +82,6 @@
 if to_waeup_student_home:
     member.setProperties(last_login_time=current,login_time=current)
+    if info['review_state'] == "application_pin_entered":
+        return response.redirect("%s/passport_entry_view" % student.absolute_url())
     return response.redirect("%s" % student.absolute_url())
     
Index: /WAeUP_SRP/trunk/skins/waeup_default/widget_waeup_image_render.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/widget_waeup_image_render.pt	(revision 537)
+++ /WAeUP_SRP/trunk/skins/waeup_default/widget_waeup_image_render.pt	(revision 537)
@@ -0,0 +1,131 @@
+<tal:block define="mode options/mode;
+  id here/getWidgetId;
+  current_filename options/current_filename;
+  empty_file options/empty_file;
+  session_file options/session_file;
+  mimetype options/mimetype;
+  size options/size;
+  content_url options/content_url;
+  last_modified options/last_modified;
+  image_tag options/image_tag;    
+  ">
+  <img tal:condition="python: mode == 'view' and not empty_file"
+    tal:replace="structure image_tag" />
+
+
+  <tal:block condition="python: 0 and mode == 'view' and not empty_file">
+    <metal:block define-macro="file_view">
+      <a target="_blank" tal:condition="mimetype"
+        tal:attributes="href string:${content_url}?nocache=${last_modified}">
+        <img tal:replace="structure python:here.getImgTag(mimetype.icon_path,
+          title=mimetype.name())" /></a>
+      <a class="strong"
+        tal:attributes="href string:${content_url}?nocache=${last_modified}">
+        <tal:block replace="current_filename" /></a>
+      <span tal:condition="size" class="note"
+        tal:define="str_size python:here.getHumanReadableSize(size);">
+        <tal:block content="str_size"/>
+      </span>
+    </metal:block>
+  </tal:block>
+
+  <tal:block condition="python: mode == 'edit'">
+
+    <metal:block define-macro="file_size_max_view">
+      <tal:block define="size_max python:here.size_max;
+                         str_sizeMax python:here.getHumanReadableSize(size_max)"
+        condition="python:size_max > 0">
+
+        <p i18n:translate="">
+          cpsschemas_size_max
+          <tal:block i18n:name="size_max" content="str_sizeMax"/>
+        </p>
+      </tal:block>
+    </metal:block>
+
+    <metal:block define-macro="file_title_edit">
+      <p tal:define="name here/getHtmlWidgetId;
+                     title_name string:${name}_filename;">
+        <span i18n:translate="cpsschemas_label_filename">
+          Filename
+        </span>
+        <input style="margin-left: 5px" type="text" size="30" maxlength="80"
+               tal:attributes="name title_name;
+                               value current_filename" />
+      </p>
+    </metal:block>
+
+    <metal:block define-macro="file_edit">
+
+      <ul class="fileChoice"
+          tal:define="name here/getHtmlWidgetId;
+                      radio_name string:${name}_choice;">
+        <li>
+          <metal:block define-slot="keep_file">
+            <input type="radio" class="noborder" name="." value="keep"
+                   checked="checked"
+                   tal:attributes="name radio_name;
+                                   id string:${radio_name}_keep;"/>
+            <label i18n:translate="cpsschemas_label_file_none"
+                   tal:condition="empty_file"
+                   tal:attributes="for string:${radio_name}_keep">None</label>
+            <label i18n:translate="cpsschemas_label_file_keep"
+                   tal:condition="not:empty_file"
+                   tal:attributes="for string:${radio_name}_keep">Keep</label>
+            <a href="http://url..." target="_blank"
+               tal:condition="not:empty_file"
+               tal:omit-tag="session_file"
+               tal:attributes="href string:${content_url}?nocache=${last_modified}">
+              <tal:block condition="mimetype"
+                replace="structure python:here.getImgTag(mimetype.icon_path,
+                  title=mimetype.name())" />
+              <tal:block replace="current_filename" />
+            </a>
+            <tal:block condition="python:not empty_file and not session_file and modules['Products.CPSUtil.integration'].isProductPresent('Products.ExternalEditor')">
+              <tal:block define="ds options/datastructure;
+                                 dm ds/getDataModel;
+                                 proxy dm/getProxy;
+                                 display_ee
+                                   here/display_external_editor|python:True;
+                                 portal here/portal_url/getPortalObject;
+                                 field_id python:here.fields[0]">
+              <tal:block condition="python: proxy and display_ee">
+                -
+                <a href="http://url..."
+                   i18n:translate="cpsschemas_label_file_edit_online"
+                   tal:attributes="href python:portal.getExternalEditorPath(proxy, id, field_id)">
+                  Edit file online
+                </a>
+              </tal:block>
+              </tal:block>
+            </tal:block>
+          </metal:block>
+        </li>
+        <metal:block define-slot="edit_file_action" />
+        <li>
+          <metal:block define-slot="change_file">
+            <input type="radio" class="noborder"  name="." value="change"
+                   tal:attributes="name radio_name;
+                                   id string:${radio_name}_change" />
+            <label i18n:translate="cpsschemas_label_file_change"
+                   tal:attributes="for string:${radio_name}_change">Change</label>
+            <input type="file" name="." size="24"
+                   tal:attributes="name name;
+              onclick string:document.getElementById('${radio_name}_change').checked='checked'" />
+          </metal:block>
+        </li>
+        <li tal:condition="python: not here.is_required and not empty_file">
+          <metal:block define-slot="delete_file">
+            <input type="radio" class="noborder" name="." value="delete"
+                   tal:attributes="name radio_name;
+                                   id string:${radio_name}_delete" />
+            <label i18n:translate="cpsschemas_label_file_delete"
+                   tal:attributes="for string:${radio_name}_delete">Delete</label>
+          </metal:block>
+        </li>
+      </ul>
+    </metal:block>
+
+  </tal:block>
+
+</tal:block>
Index: /WAeUP_SRP/trunk/skins/waeup_student/application_slip.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/application_slip.pt	(revision 536)
+++ /WAeUP_SRP/trunk/skins/waeup_student/application_slip.pt	(revision 537)
@@ -1,58 +1,17 @@
-<html metal:use-macro="here/content_lib_master/macros/master">
-  <metal:block fill-slot="head_slot">
-  </metal:block>
-
-  <metal:block fill-slot="css_slot">
-    <link rel="Stylesheet" type="text/css" href=""
-      tal:attributes="href string:${base_url}document.css" />
-  </metal:block>
-  
-  <metal:block fill-slot="header">
-  </metal:block>
-
-  <metal:block fill-slot="main">
-
-    <tal:block tal:condition="python:context.portal_type == 'StudentApplication'" tal:omit-tag="">
-    <h3>Post UME Acknowledegement Slip</h3>
-        <br />
-        
-      <tal:block tal:define="application_data python:context.getContent();">
-      
-      
-      <table cellpadding="10em" cellspacing="">
-      <tr>
-      <td valign="top">
-        <img tal:condition="application_data/passport|nothing" 
-             tal:attributes="src string:${context/absolute_url}/passport"/>
-              <span tal:condition="nothing" tal:replace="structure application_data/passport" />
-      </td>
-
-      <td>
-      
-      <table width="" cellpadding="2" cellspacing="0" summary="Form layout">
-      <tr><td>Access Code: </td><td><span tal:content="application_data/app_ac_pin" /></td></tr>
-      <tr><td>Application Date: </td><td><span tal:content="python:application_data.app_ac_date.aCommonZ()" /></td></tr>
-      <tr><td>JAMB Registration Number: </td><td><span tal:content="application_data/jamb_reg_no" /></td></tr>
-      <tr><td>Student's Name: </td><td><span tal:content="application_data/jamb_firstname" /> <span tal:content="application_data/jamb_middlename" /> <span tal:content="application_data/jamb_lastname" /></td></tr>
-      <tr><td>Sex: </td><td><span tal:content="application_data/jamb_sex" /></td></tr>
-      <tr><td>Mode of Entry: </td><td><span tal:content="application_data/entry_mode" /></td></tr>
-      <tr><td>Course of Study: </td><td><span tal:content="application_data/jamb_first_cos" />, <span tal:content="application_data/jamb_second_cos" /></td></tr>
-      <tr><td>State of Origin: </td><td><span tal:content="application_data/jamb_state" /> / <span tal:content="application_data/jamb_lga" /></td></tr>
-      <tr><td>Post UME Examination Date: </td><td></td></tr>
-      </table>
-
-      </td>
-      </tr>
-      </table>
-      
-      </tal:block>
-    </tal:block>
-    <tal:block condition="python:context.portal_type != 'StudentApplication'">
-      Please do not manipulate the URL! This is not an application object.
-    </tal:block>  
-  
-  </metal:block>
-
-  <metal:block fill-slot="sub">
-  </metal:block>
-</html>
+<metal:html tal:define="info context/getStudentInfo">
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+      <span tal:condition="not: info">
+        <metal:block use-macro="here/error_not_found/macros/not_found" />
+      </span>
+      <span tal:condition="info"
+            tal:define="review_state info/review_state">
+        <span tal:omit-tag=""
+              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
+              layout_mode='view', 
+              layout_id='student_application')" 
+              />
+      </span>
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 536)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt	(revision 537)
@@ -13,6 +13,7 @@
   cpsmcat nocall:here/translation_service;
   apply request/apply_button|nothing;
+  widgets python:context.getRenderedWidgets(layout);
   ">
-
+  <span tal:condition="python: 0" tal:replace="structure widgets" />
   <form action="" id="editForm" method="post" 
         enctype="multipart/form-data" class="workflow"
@@ -20,10 +21,9 @@
         
         >
-  <table width="" cellpadding="2" cellspacing="0" summary="Form layout"
+  <table class="layoutDefault" summary="Form layout"
          tal:condition="layout/rows">
-    <tr tal:repeat="row layout/rows" valign="top" >
-      <span tal:repeat="cell row"
-          tal:attributes="colspan cell/ncols">
-        <tal:block define="widget cell/widget;
+    <span tal:repeat="row python: layout['rows']" valign="top" >
+      <span tal:repeat="cell row">
+        <tr tal:define="widget cell/widget;
               wid widget/getWidgetId;
               err python:ds.getError(wid);
@@ -33,4 +33,5 @@
               widget_css_class cell/widget_css_class|nothing;
               css_class python:test(err, 'row error','row')"
+              tal:condition="python: wid != 'passport'"
               >
           <div tal:attributes="class widget_css_class;
@@ -67,11 +68,56 @@
             </td>
           </div>
-        </tal:block>
-       </span>
-      </tr>
-    </table>
+        </tr>
+      </span>
+    </span>
+    <tr tal:condition="widgets/passport|nothing" tal:define="cell widgets/passport|nothing;">
+      <tal:block tal:define="widget cell/widget;
+      wid widget/getWidgetId;
+      err python:ds.getError(wid);
+      err_mapping python:ds.getErrorMapping(wid);
+      is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes);
+      tooltip_id python:wid + '_help';
+      widget_css_class widget/widget_css_class|nothing;
+      css_class python:test(err, 'row error','row')"
+      >
+        <div tal:attributes="class widget_css_class;
+        id python:widget.getHtmlWidgetId()+'_widget';"
+        >
+          <td>
+            <div class="label" tal:condition="widget/label_edit"
+                 tal:attributes="class python:test(is_required, 'label required','label')">
+              <label 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>
+          </td>
+          <td>
+            <span class="field">
+              <div tal:replace="structure cell/widget_rendered"/>
+            </span>
+            <div class="tooltipArea" style="visibility: hidden;"
+                 tal:condition="widget/help"
+                 tal:attributes="id tooltip_id;
+                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
+                 >
+              <tal:block 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>
+          </td>
+        </div>
+      </tal:block>
+    </tr>
+  </table>
   <br />
   <input type="submit" class="standalone" name="cpsdocument_edit_button"
-         value="button_change" 
+         value="Save" 
          id="cpsdocument_edit_button"
          tal:condition="not:creation" />
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_application_print.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_application_print.pt	(revision 537)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_application_print.pt	(revision 537)
@@ -0,0 +1,78 @@
+<!-- a layout_lib macro -->
+<!-- $Id: layout_lib_default_view.pt 34052 2006-03-06 14:59:24Z atchertchian $ -->
+<metal:block tal:define="layout options/layout;
+             widgets python:context.getRenderedWidgets(layout);"
+             >
+  <h3>Post UME Acknowledegement Slip</h3>
+  <br />
+  <table cellpadding="10em" cellspacing="">
+    <tr>
+      <td tal:define="cell widgets/passport">
+        <span tal:replace="structure cell/widget_rendered" />
+      </td>
+      <td>
+        <table width="" cellpadding="2" cellspacing="0" summary="Form layout">
+          <tr tal:define="cell widgets/app_ac_pin">
+            <td>
+              <span tal:replace="cell/widget/label" />: 
+            </td>
+            <td><span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </tr>
+          <tr tal:define="cell widgets/app_ac_date">
+            <td>
+              <span tal:replace="cell/widget/label" />: 
+            </td>
+            <td><span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </tr>
+          <tr tal:define="cell widgets/jamb_reg_no">
+            <td>
+              <span tal:replace="cell/widget/label" />: 
+            </td>
+            <td><span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </tr>
+          <tr>
+            <td>
+              Student's Name: 
+            </td>
+            <td>
+              <span tal:replace="structure widgets/jamb_firstname/widget_rendered" />
+              <span tal:replace="structure widgets/jamb_lastname/widget_rendered" />
+            </td>
+          </tr>
+          <tr tal:define="cell widgets/jamb_sex">
+            <td>
+              <span tal:replace="cell/widget/label" />: 
+            </td>
+            <td><span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </tr>
+          <tr tal:define="cell widgets/entry_mode">
+            <td>
+              <span tal:replace="cell/widget/label" />: 
+            </td>
+            <td><span tal:replace="structure cell/widget_rendered" />
+            </td>
+          </tr>
+          <tr>
+            <td>Course of Study: </td>
+            <td>
+              <span tal:replace="structure widgets/jamb_first_cos/widget_rendered" /> |
+              <span tal:replace="structure widgets/jamb_second_cos/widget_rendered" />
+            </td>
+          </tr>
+          <tr><td>State of Origin: </td>
+            <td>
+              <span tal:replace="structure widgets/jamb_state/widget_rendered" /> /
+              <span tal:replace="structure widgets/jamb_lga/widget_rendered" />
+            </td>
+          </tr>
+          <tr><td>Post UME Examination Date: </td><td></td></tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</metal:block>
+
Index: /WAeUP_SRP/trunk/skins/waeup_student/layout_application_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/layout_application_view.pt	(revision 536)
+++ /WAeUP_SRP/trunk/skins/waeup_student/layout_application_view.pt	(revision 537)
@@ -13,10 +13,9 @@
                                  'jamb_second_cos',)"
                                  >
-  <span tal:condition="nothing" tal:replace="structure widgets" />
   <table cellpadding="2" cellspacing="2" summary="layout">
     <tr tal:repeat="field fields">
       <tal:block tal:define="cell python: widgets[field]">
         <tal:block define="widget cell/widget">
-          <div tal:attributes="class cell/widget_css_class|nothing;
+          <div tal:attributes="class cell/widget_css_class|string:label;
             id python:widget.getHtmlWidgetId()+'_widget';">
             <td >
@@ -40,10 +39,10 @@
             <td valign="top">
             <tal:block condition="widget/label">
-              <span class="dlabel"
+              <span class="label"
                     tal:content="widget/label">label</span>:
             </tal:block>
             </td>
             <td>
-              <img src="img" tal:attributes="src string:${context/aq_parent/absolute_url}/passport" />
+              <img src="img" tal:replace="structure cell/widget_rendered">
             </td>
           </div>
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_edit.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_edit.py	(revision 536)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_edit.py	(revision 537)
@@ -96,4 +96,5 @@
         args = {}
     else:
+        info['app'].content_status_modify(workflow_action="close")
         psm = 'psm_content_error'
         args = getFormUidUrlArg(REQUEST)
