Index: WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py	(revision 2098)
+++ WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py	(revision 2098)
@@ -0,0 +1,101 @@
+## Script (Python) "apply_pume"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=REQUEST
+##title=
+##
+# $Id$
+"""
+process the Pume Application Form
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+import DateTime
+current = DateTime.DateTime()
+pr = context.portal_registration
+request = REQUEST
+
+#type_name = 'StudentApplication'
+#ti = context.portal_types[type_name]
+#REQUEST.set('type_name',type_name)
+create = "create" in request.keys()
+apply_pume = "apply" in request.keys()
+edit = "edit" in request.keys()
+mode = request.get('mode','')
+if not mode:
+    if apply_pume or edit:
+        mode = "edit"
+    else:
+        mode = "create"
+validate = create or edit or apply_pume
+
+lt = context.portal_layouts
+reg_no = request.get('widget__reg_no','').upper()
+if not reg_no:
+    reg_no = request.get('reg_no','').upper()
+    
+object = {}
+#set_trace()
+if reg_no:
+    brains = context.applicants_catalog(reg_no = reg_no)
+    if len(brains) == 1:
+        for field in context.applicants_catalog.schema():
+            object[field] = getattr(brains[0],field,None)
+
+res,psm,ds = lt.renderLayout(layout_id= 'application',
+                             schema_id= 'application',
+                             layout_mode = mode,
+                             context=context,
+                             mapping=validate and REQUEST,
+                             ob=object,
+                             commit = False,
+                            )
+
+if psm == 'invalid':
+    return context.apply_pume_form(rendered = res,
+                                   psm = "Please correct your input!",
+                                   #psm = "%s, %s" % (psm,ds),
+                                   mode = mode,
+                                   ds = ds,
+                                  )
+elif psm == '':
+    return context.apply_pume_form(rendered = res,
+                                   psm = None,
+                                   ds = ds,
+                                   mode = mode,
+                                  )
+elif psm == 'valid':
+    pass
+if create or edit or apply_pume:
+    data = {}
+    for field in context.applicants_catalog.schema():
+        if ds.has_key(field) and request.has_key("widget__%s" % field):
+            data[field] = ds.get(field)
+    data['reg_no'] = reg_no
+    if apply_pume:
+        data['registration_date'] = current
+        data['status'] = "submitted"
+    context.applicants_catalog.modifyRecord(**data)
+    if apply_pume:
+        if not request.has_key('confirm'):
+            return context.apply_pume_form(rendered = res,
+                                        psm = "Please confirm Passport Photograph",
+                                        #psm = "%s, %s" % (psm,ds),
+                                        mode = mode,
+                                        ds = ds,
+                                        )
+                    
+        return request.RESPONSE.redirect("%s/apply_pume?mode=view&reg_no=%s" %
+                                     (context.absolute_url(),ds.get('reg_no')))
+    elif edit or create:
+        return request.RESPONSE.redirect("%s/apply_pume?mode=edit&reg_no=%s" %
+                                     (context.absolute_url(),ds.get('reg_no')))
+
+
Index: WAeUP_SRP/trunk/skins/waeup_student/apply_pume_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/apply_pume_form.pt	(revision 2098)
+++ WAeUP_SRP/trunk/skins/waeup_student/apply_pume_form.pt	(revision 2098)
@@ -0,0 +1,58 @@
+<tal:block define="rendered_main options/rendered;
+           portal_status_message options/psm;
+           ds options/ds;
+           jamb options/jamb/getContent|nothing;
+           mode options/mode;
+           "
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/main_template/macros/master">
+      <metal:block fill-slot="main">
+        <h3>Apppply for the Post University Matriculation Examination! </h3>
+        <br />
+        <form action="" id="editForm" method="post" 
+              enctype="multipart/form-data" class="workflow"
+              tal:attributes="action string:${context/absolute_url}/apply_pume"
+              >
+          <input type="hidden" name="reg_no"
+                 tal:attributes="value ds/reg_no|nothing"
+                 tal:condition="ds/reg_no|nothing"/>
+          <div tal:replace="structure rendered_main" />
+          <div class="" tal:condition="python: mode=='edit'">
+          <input type="checkbox" class="standalone" 
+                 name="confirm"
+                 value="" 
+            />
+            I confirm that Passport Photograph uploaded on this form is a true picture of me
+          </div>
+          
+          <input type="submit" class="standalone" 
+                 name="edit"
+                 value="Edit" 
+                 tal:condition="python: mode == 'edit'" />
+          <input type="submit" class="standalone" name="apply"
+                 value="apply for Pume"
+                 tal:condition="python: mode == 'edit'"
+                 />
+          <input type="submit" 
+                 class="standalone" 
+                 name="create"
+                 value="Login for PUME Application"
+                 tal:condition="python: mode == 'create'" 
+                 />
+          </form>
+          <p>Instructions :</p>
+          <ul tal:condition="python: mode in ('create','edit')">
+            <li>Enter your JAMB Registration Number and the Application PIN above.</li> 
+            <li>Upload your passport picture.</li> 
+            <li>Apply for Pume.</li>
+          </ul>
+          <ul tal:condition="python: mode == 'view'">
+            <li>Print the Pume Acknowledgement Slip.</li>
+          </ul>
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_create.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_create.pt	(revision 2098)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_create.pt	(revision 2098)
@@ -0,0 +1,113 @@
+<tal:block define="global creation python:1;
+                   global formaction string:apply_admission" />
+<!-- a layout_lib macro -->
+<!-- $Id$ -->
+
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+  ds options/datastructure;
+  dm ds/getDataModel;
+  creation creation|nothing;
+  metadata metadata|nothing;
+  cpsmcat nocall:here/translation_service;
+  apply request/apply_button|nothing;
+  ">
+  <table class="layoutDefault" summary="Form layout"
+         tal:condition="layout/rows">
+    <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);
+              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 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;
+          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>
+        </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 />
+</metal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_edit.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_edit.pt	(revision 2098)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_edit.pt	(revision 2098)
@@ -0,0 +1,61 @@
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+  ds options/datastructure;
+  dm ds/getDataModel;
+  creation creation|nothing;
+  cpsmcat nocall:here/translation_service;
+  proceed options/proceed|nothing;
+  ">
+<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;
+                         css_class python:test(err, 'row error','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>
+      </tal:block>
+    </td>
+  </tr>
+</table>
+                                </metal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_view.pt	(revision 2098)
+++ WAeUP_SRP/trunk/skins/waeup_student/layout_apply_pume_view.pt	(revision 2098)
@@ -0,0 +1,103 @@
+<metal:block define-macro="default_edit"
+  tal:define="layout options/layout;
+  ds options/datastructure;
+  cpsmcat nocall:here/translation_service;
+  ">
+  <table class="layoutDefault" summary="Form layout"
+         tal:condition="layout/rows">
+    <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);
+              err_mapping python:ds.getErrorMapping(wid);
+              is_required python: widget.is_required;
+              tooltip_id python:wid + '_help';
+              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;
+          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>
+        </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>
+</metal:block>
